• Eric Farman's avatar
    vfio/ccw: Create a CLOSE FSM event · f4b4ed44
    Eric Farman authored
    Refactor the vfio_ccw_sch_quiesce() routine to extract the bit that
    disables the subchannel and affects the FSM state. Use this to form
    the basis of a CLOSE event that will mirror the OPEN event, and move
    the subchannel back to NOT_OPER state.
    
    A key difference with that mirroring is that while OPEN handles the
    transition from NOT_OPER => STANDBY, the later probing of the mdev
    handles the transition from STANDBY => IDLE. On the other hand,
    the CLOSE event will move from one of the operating states {IDLE,
    CP_PROCESSING, CP_PENDING} => NOT_OPER. That is, there is no stop
    in a STANDBY state on the deconfigure path.
    
    Add a call to cp_free() in this event, such that it is captured for
    the various permutations of this event.
    
    In the unlikely event that cio_disable_subchannel() returns -EBUSY,
    the remaining logic of vfio_ccw_sch_quiesce() can still be used.
    Signed-off-by: default avatarEric Farman <farman@linux.ibm.com>
    Reviewed-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
    Link: https://lore.kernel.org/r/20220707135737.720765-10-farman@linux.ibm.comSigned-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
    f4b4ed44
vfio_ccw_ops.c 15.1 KB