diff options
author | Peter Oberparleiter <peter.oberparleiter@de.ibm.com> | 2009-10-06 04:34:02 -0400 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2009-10-06 04:35:07 -0400 |
commit | 6afcc775d9d66fe550fad6c579f78b3c3da895b8 (patch) | |
tree | fcbd29835c31ed0174025bc6991309fd6b6a0e76 /drivers | |
parent | 9a332116948955bd25d122efd91feed103f0e3e4 (diff) |
[S390] cio: make not operational handling consistent
When a ccw device appears not operational, inform the associated
device driver and act according to the response: if the driver
wants to keep the device, put it into the disconnected state.
If not, or if there is no driver or if the device is not online,
unregister it. This approach is consistent with no-path event
handling.
Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/cio/device.c | 4 | ||||
-rw-r--r-- | drivers/s390/cio/device.h | 1 | ||||
-rw-r--r-- | drivers/s390/cio/device_fsm.c | 11 |
3 files changed, 9 insertions, 7 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index f780bdd3a04e..2ee093ec86e4 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
@@ -1609,7 +1609,7 @@ int ccw_purge_blacklisted(void) | |||
1609 | return 0; | 1609 | return 0; |
1610 | } | 1610 | } |
1611 | 1611 | ||
1612 | static void device_set_disconnected(struct ccw_device *cdev) | 1612 | void ccw_device_set_disconnected(struct ccw_device *cdev) |
1613 | { | 1613 | { |
1614 | if (!cdev) | 1614 | if (!cdev) |
1615 | return; | 1615 | return; |
@@ -1705,7 +1705,7 @@ static int io_subchannel_sch_event(struct subchannel *sch, int slow) | |||
1705 | ccw_device_trigger_reprobe(cdev); | 1705 | ccw_device_trigger_reprobe(cdev); |
1706 | break; | 1706 | break; |
1707 | case DISC: | 1707 | case DISC: |
1708 | device_set_disconnected(cdev); | 1708 | ccw_device_set_disconnected(cdev); |
1709 | break; | 1709 | break; |
1710 | default: | 1710 | default: |
1711 | break; | 1711 | break; |
diff --git a/drivers/s390/cio/device.h b/drivers/s390/cio/device.h index ed39a2caaf47..246c6482842c 100644 --- a/drivers/s390/cio/device.h +++ b/drivers/s390/cio/device.h | |||
@@ -125,6 +125,7 @@ int ccw_device_stlck(struct ccw_device *); | |||
125 | void ccw_device_trigger_reprobe(struct ccw_device *); | 125 | void ccw_device_trigger_reprobe(struct ccw_device *); |
126 | void ccw_device_kill_io(struct ccw_device *); | 126 | void ccw_device_kill_io(struct ccw_device *); |
127 | int ccw_device_notify(struct ccw_device *, int); | 127 | int ccw_device_notify(struct ccw_device *, int); |
128 | void ccw_device_set_disconnected(struct ccw_device *cdev); | ||
128 | void ccw_device_set_notoper(struct ccw_device *cdev); | 129 | void ccw_device_set_notoper(struct ccw_device *cdev); |
129 | 130 | ||
130 | /* qdio needs this. */ | 131 | /* qdio needs this. */ |
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c index 3db3847ee137..3b0f408a896c 100644 --- a/drivers/s390/cio/device_fsm.c +++ b/drivers/s390/cio/device_fsm.c | |||
@@ -400,6 +400,8 @@ ccw_device_done(struct ccw_device *cdev, int state) | |||
400 | cdev->private->dev_id.devno, sch->schid.sch_no); | 400 | cdev->private->dev_id.devno, sch->schid.sch_no); |
401 | if (!ccw_device_notify(cdev, CIO_GONE)) | 401 | if (!ccw_device_notify(cdev, CIO_GONE)) |
402 | ccw_device_schedule_sch_unregister(cdev); | 402 | ccw_device_schedule_sch_unregister(cdev); |
403 | else | ||
404 | ccw_device_set_disconnected(cdev); | ||
403 | cdev->private->flags.donotify = 0; | 405 | cdev->private->flags.donotify = 0; |
404 | break; | 406 | break; |
405 | case DEV_STATE_DISCONNECTED: | 407 | case DEV_STATE_DISCONNECTED: |
@@ -744,11 +746,10 @@ ccw_device_recog_notoper(struct ccw_device *cdev, enum dev_event dev_event) | |||
744 | static void ccw_device_generic_notoper(struct ccw_device *cdev, | 746 | static void ccw_device_generic_notoper(struct ccw_device *cdev, |
745 | enum dev_event dev_event) | 747 | enum dev_event dev_event) |
746 | { | 748 | { |
747 | struct subchannel *sch; | 749 | if (!ccw_device_notify(cdev, CIO_GONE)) |
748 | 750 | ccw_device_schedule_sch_unregister(cdev); | |
749 | ccw_device_set_notoper(cdev); | 751 | else |
750 | sch = to_subchannel(cdev->dev.parent); | 752 | ccw_device_set_disconnected(cdev); |
751 | css_schedule_eval(sch->schid); | ||
752 | } | 753 | } |
753 | 754 | ||
754 | /* | 755 | /* |