Skip to content

Commit

Permalink
[S390] cio: fix incorrect ccw_device_init_count
Browse files Browse the repository at this point in the history
If device recognition is interrupted by a subchannel event
indicating that the device is gone, ccw_device_init_count
is not correctly decreased.

Fix this by reporting the corresponding event to the device
recognition callback via the state machine.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Sebastian Ott authored and Martin Schwidefsky committed Nov 10, 2010
1 parent 3b210e7 commit 16d2ce2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion drivers/s390/cio/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,16 @@ static int io_subchannel_sch_event(struct subchannel *sch, int process)
break;
case IO_SCH_UNREG_ATTACH:
case IO_SCH_UNREG:
if (cdev)
if (!cdev)
break;
if (cdev->private->state == DEV_STATE_SENSE_ID) {
/*
* Note: delayed work triggered by this event
* and repeated calls to sch_event are synchronized
* by the above check for work_pending(cdev).
*/
dev_fsm_event(cdev, DEV_EVENT_NOTOPER);
} else
ccw_device_set_notoper(cdev);
break;
case IO_SCH_NOP:
Expand Down

0 comments on commit 16d2ce2

Please sign in to comment.