• Jacob Keller's avatar
    ice: wait for reset before reporting devlink info · 1c08052e
    Jacob Keller authored
    Requesting device firmware information while the device is busy cleaning
    up after a reset can result in an unexpected failure:
    
    This occurs because the command is attempting to access the device
    AdminQ while it is down. Resolve this by having the command wait for
    a while until the reset is complete. To do this, introduce
    a reset_wait_queue and associated helper function "ice_wait_for_reset".
    
    This helper will use the wait queue to sleep until the driver is done
    rebuilding. Use of a wait queue is preferred because the potential sleep
    duration can be several seconds.
    
    To ensure that the thread wakes up properly, a new wake_up call is added
    during all code paths which clear the reset state bits associated with
    the driver rebuild flow.
    
    Using this ensures that tools can request device information without
    worrying about whether the driver is cleaning up from a reset.
    Specifically, it is expected that a flash update could result in
    a device reset, and it is better to delay the response for information
    until the reset is complete rather than exit with an immediate failure.
    Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
    Tested-by: default avatarTony Brelinski <tonyx.brelinski@intel.com>
    Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
    1c08052e
ice_lib.h 3.24 KB