diff options
Diffstat (limited to 'drivers/s390/cio/device_fsm.c')
-rw-r--r-- | drivers/s390/cio/device_fsm.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c index e728ce447f6e..b9613d7df9ef 100644 --- a/drivers/s390/cio/device_fsm.c +++ b/drivers/s390/cio/device_fsm.c | |||
@@ -387,19 +387,35 @@ ccw_device_done(struct ccw_device *cdev, int state) | |||
387 | 387 | ||
388 | cdev->private->state = state; | 388 | cdev->private->state = state; |
389 | 389 | ||
390 | if (state == DEV_STATE_BOXED) { | 390 | switch (state) { |
391 | case DEV_STATE_BOXED: | ||
391 | CIO_MSG_EVENT(0, "Boxed device %04x on subchannel %04x\n", | 392 | CIO_MSG_EVENT(0, "Boxed device %04x on subchannel %04x\n", |
392 | cdev->private->dev_id.devno, sch->schid.sch_no); | 393 | cdev->private->dev_id.devno, sch->schid.sch_no); |
393 | if (cdev->online && !ccw_device_notify(cdev, CIO_BOXED)) | 394 | if (cdev->online && !ccw_device_notify(cdev, CIO_BOXED)) |
394 | ccw_device_schedule_sch_unregister(cdev); | 395 | ccw_device_schedule_sch_unregister(cdev); |
395 | cdev->private->flags.donotify = 0; | 396 | cdev->private->flags.donotify = 0; |
396 | } | 397 | break; |
397 | if (state == DEV_STATE_NOT_OPER) { | 398 | case DEV_STATE_NOT_OPER: |
398 | CIO_MSG_EVENT(0, "Device %04x gone on subchannel %04x\n", | 399 | CIO_MSG_EVENT(0, "Device %04x gone on subchannel %04x\n", |
399 | cdev->private->dev_id.devno, sch->schid.sch_no); | 400 | cdev->private->dev_id.devno, sch->schid.sch_no); |
400 | if (!ccw_device_notify(cdev, CIO_GONE)) | 401 | if (!ccw_device_notify(cdev, CIO_GONE)) |
401 | ccw_device_schedule_sch_unregister(cdev); | 402 | ccw_device_schedule_sch_unregister(cdev); |
403 | else | ||
404 | ccw_device_set_disconnected(cdev); | ||
402 | cdev->private->flags.donotify = 0; | 405 | cdev->private->flags.donotify = 0; |
406 | break; | ||
407 | case DEV_STATE_DISCONNECTED: | ||
408 | CIO_MSG_EVENT(0, "Disconnected device %04x on subchannel " | ||
409 | "%04x\n", cdev->private->dev_id.devno, | ||
410 | sch->schid.sch_no); | ||
411 | if (!ccw_device_notify(cdev, CIO_NO_PATH)) | ||
412 | ccw_device_schedule_sch_unregister(cdev); | ||
413 | else | ||
414 | ccw_device_set_disconnected(cdev); | ||
415 | cdev->private->flags.donotify = 0; | ||
416 | break; | ||
417 | default: | ||
418 | break; | ||
403 | } | 419 | } |
404 | 420 | ||
405 | if (cdev->private->flags.donotify) { | 421 | if (cdev->private->flags.donotify) { |
@@ -671,6 +687,10 @@ ccw_device_offline(struct ccw_device *cdev) | |||
671 | ccw_device_done(cdev, DEV_STATE_NOT_OPER); | 687 | ccw_device_done(cdev, DEV_STATE_NOT_OPER); |
672 | return 0; | 688 | return 0; |
673 | } | 689 | } |
690 | if (cdev->private->state == DEV_STATE_BOXED) { | ||
691 | ccw_device_done(cdev, DEV_STATE_BOXED); | ||
692 | return 0; | ||
693 | } | ||
674 | if (ccw_device_is_orphan(cdev)) { | 694 | if (ccw_device_is_orphan(cdev)) { |
675 | ccw_device_done(cdev, DEV_STATE_OFFLINE); | 695 | ccw_device_done(cdev, DEV_STATE_OFFLINE); |
676 | return 0; | 696 | return 0; |
@@ -730,11 +750,10 @@ ccw_device_recog_notoper(struct ccw_device *cdev, enum dev_event dev_event) | |||
730 | static void ccw_device_generic_notoper(struct ccw_device *cdev, | 750 | static void ccw_device_generic_notoper(struct ccw_device *cdev, |
731 | enum dev_event dev_event) | 751 | enum dev_event dev_event) |
732 | { | 752 | { |
733 | struct subchannel *sch; | 753 | if (!ccw_device_notify(cdev, CIO_GONE)) |
734 | 754 | ccw_device_schedule_sch_unregister(cdev); | |
735 | ccw_device_set_notoper(cdev); | 755 | else |
736 | sch = to_subchannel(cdev->dev.parent); | 756 | ccw_device_set_disconnected(cdev); |
737 | css_schedule_eval(sch->schid); | ||
738 | } | 757 | } |
739 | 758 | ||
740 | /* | 759 | /* |