Skip to content

Commit 6c02ac4

Browse files
efarmancohuck
authored andcommitted
vfio-ccw: Reset FSM state to IDLE inside FSM
When an I/O request is made, the fsm_io_request() routine moves the FSM state from IDLE to CP_PROCESSING, and then fsm_io_helper() moves it to CP_PENDING if the START SUBCHANNEL received a cc0. Yet, the error case to go from CP_PROCESSING back to IDLE is done after the FSM call returns. Let's move this up into the FSM proper, to provide some better symmetry when unwinding in this case. Signed-off-by: Eric Farman <[email protected]> Reviewed-by: Cornelia Huck <[email protected]> Acked-by: Matthew Rosato <[email protected]> Message-Id: <[email protected]> Signed-off-by: Cornelia Huck <[email protected]>
1 parent c6c82e0 commit 6c02ac4

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

drivers/s390/cio/vfio_ccw_fsm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ static void fsm_io_request(struct vfio_ccw_private *private,
318318
}
319319

320320
err_out:
321+
private->state = VFIO_CCW_STATE_IDLE;
321322
trace_vfio_ccw_fsm_io_request(scsw->cmd.fctl, schid,
322323
io_region->ret_code, errstr);
323324
}

drivers/s390/cio/vfio_ccw_ops.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,6 @@ static ssize_t vfio_ccw_mdev_write_io_region(struct vfio_ccw_private *private,
279279
}
280280

281281
vfio_ccw_fsm_event(private, VFIO_CCW_EVENT_IO_REQ);
282-
if (region->ret_code != 0)
283-
private->state = VFIO_CCW_STATE_IDLE;
284282
ret = (region->ret_code != 0) ? region->ret_code : count;
285283

286284
out_unlock:

0 commit comments

Comments
 (0)