]> git.proxmox.com Git - mirror_qemu.git/commit - hw/ppc/spapr_drc.c
spapr: Make DRC reset force DRC into known state
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 21 Jun 2017 07:21:28 +0000 (15:21 +0800)
committerDavid Gibson <david@gibson.dropbear.id.au>
Fri, 30 Jun 2017 04:03:32 +0000 (14:03 +1000)
commit4f9242fc931ab5e5b1b753c8e5a76c50c0b0612e
treef508b123af4fe9122eb4682a2c18ae6f6392dc1a
parent9c914e53702354bc681dedef2e1e6b43fc349043
spapr: Make DRC reset force DRC into known state

The reset handler for DRCs attempts several state transitions which are
subject to various checks and restrictions.  But at reset time we know
there is no guest, so we can ignore most of the usual sequencing rules and
just set the DRC back to a known state.  In fact, it's safer to do so.

The existing code also has several redundant checks for
drc->awaiting_release inside a block which has already tested that.  This
patch removes those and sets the DRC to a fixed initial state based only
on whether a device is currently plugged or not.

With DRCs correctly reset to a state based on device presence, we don't
need to force state transitions as cold plugged devices are processed.
This allows us to remove all the callers of the set_*_state() methods from
outside spapr_drc.c.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/ppc/spapr.c
hw/ppc/spapr_drc.c