• D
    spapr: Make DRC reset force DRC into known state · 4f9242fc
    David Gibson 提交于
    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: NDavid Gibson <david@gibson.dropbear.id.au>
    Reviewed-by: NGreg Kurz <groug@kaod.org>
    Reviewed-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
    4f9242fc
spapr_drc.c 34.7 KB