aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/device_fsm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/cio/device_fsm.c')
-rw-r--r--drivers/s390/cio/device_fsm.c68
1 files changed, 7 insertions, 61 deletions
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
index 392eb33f3a9c..44e4a53c5981 100644
--- a/drivers/s390/cio/device_fsm.c
+++ b/drivers/s390/cio/device_fsm.c
@@ -59,18 +59,6 @@ device_set_disconnected(struct subchannel *sch)
59 cdev->private->state = DEV_STATE_DISCONNECTED; 59 cdev->private->state = DEV_STATE_DISCONNECTED;
60} 60}
61 61
62void
63device_set_waiting(struct subchannel *sch)
64{
65 struct ccw_device *cdev;
66
67 if (!sch->dev.driver_data)
68 return;
69 cdev = sch->dev.driver_data;
70 ccw_device_set_timeout(cdev, 10*HZ);
71 cdev->private->state = DEV_STATE_WAIT4IO;
72}
73
74/* 62/*
75 * Timeout function. It just triggers a DEV_EVENT_TIMEOUT. 63 * Timeout function. It just triggers a DEV_EVENT_TIMEOUT.
76 */ 64 */
@@ -947,7 +935,7 @@ ccw_device_killing_irq(struct ccw_device *cdev, enum dev_event dev_event)
947 cdev->private->state = DEV_STATE_ONLINE; 935 cdev->private->state = DEV_STATE_ONLINE;
948 if (cdev->handler) 936 if (cdev->handler)
949 cdev->handler(cdev, cdev->private->intparm, 937 cdev->handler(cdev, cdev->private->intparm,
950 ERR_PTR(-ETIMEDOUT)); 938 ERR_PTR(-EIO));
951 if (!sch->lpm) { 939 if (!sch->lpm) {
952 PREPARE_WORK(&cdev->private->kick_work, 940 PREPARE_WORK(&cdev->private->kick_work,
953 ccw_device_nopath_notify, (void *)cdev); 941 ccw_device_nopath_notify, (void *)cdev);
@@ -984,51 +972,15 @@ ccw_device_killing_timeout(struct ccw_device *cdev, enum dev_event dev_event)
984 cdev->private->state = DEV_STATE_ONLINE; 972 cdev->private->state = DEV_STATE_ONLINE;
985 if (cdev->handler) 973 if (cdev->handler)
986 cdev->handler(cdev, cdev->private->intparm, 974 cdev->handler(cdev, cdev->private->intparm,
987 ERR_PTR(-ETIMEDOUT)); 975 ERR_PTR(-EIO));
988} 976}
989 977
990static void 978void device_kill_io(struct subchannel *sch)
991ccw_device_wait4io_irq(struct ccw_device *cdev, enum dev_event dev_event)
992{
993 struct irb *irb;
994 struct subchannel *sch;
995
996 irb = (struct irb *) __LC_IRB;
997 /*
998 * Accumulate status and find out if a basic sense is needed.
999 * This is fine since we have already adapted the lpm.
1000 */
1001 ccw_device_accumulate_irb(cdev, irb);
1002 if (cdev->private->flags.dosense) {
1003 if (ccw_device_do_sense(cdev, irb) == 0) {
1004 cdev->private->state = DEV_STATE_W4SENSE;
1005 }
1006 return;
1007 }
1008
1009 /* Iff device is idle, reset timeout. */
1010 sch = to_subchannel(cdev->dev.parent);
1011 if (!stsch(sch->schid, &sch->schib))
1012 if (sch->schib.scsw.actl == 0)
1013 ccw_device_set_timeout(cdev, 0);
1014 /* Call the handler. */
1015 ccw_device_call_handler(cdev);
1016 if (!sch->lpm) {
1017 PREPARE_WORK(&cdev->private->kick_work,
1018 ccw_device_nopath_notify, (void *)cdev);
1019 queue_work(ccw_device_notify_work, &cdev->private->kick_work);
1020 } else if (cdev->private->flags.doverify)
1021 ccw_device_online_verify(cdev, 0);
1022}
1023
1024static void
1025ccw_device_wait4io_timeout(struct ccw_device *cdev, enum dev_event dev_event)
1026{ 979{
1027 int ret; 980 int ret;
1028 struct subchannel *sch; 981 struct ccw_device *cdev;
1029 982
1030 sch = to_subchannel(cdev->dev.parent); 983 cdev = sch->dev.driver_data;
1031 ccw_device_set_timeout(cdev, 0);
1032 ret = ccw_device_cancel_halt_clear(cdev); 984 ret = ccw_device_cancel_halt_clear(cdev);
1033 if (ret == -EBUSY) { 985 if (ret == -EBUSY) {
1034 ccw_device_set_timeout(cdev, 3*HZ); 986 ccw_device_set_timeout(cdev, 3*HZ);
@@ -1047,12 +999,12 @@ ccw_device_wait4io_timeout(struct ccw_device *cdev, enum dev_event dev_event)
1047 } 999 }
1048 if (cdev->handler) 1000 if (cdev->handler)
1049 cdev->handler(cdev, cdev->private->intparm, 1001 cdev->handler(cdev, cdev->private->intparm,
1050 ERR_PTR(-ETIMEDOUT)); 1002 ERR_PTR(-EIO));
1051 if (!sch->lpm) { 1003 if (!sch->lpm) {
1052 PREPARE_WORK(&cdev->private->kick_work, 1004 PREPARE_WORK(&cdev->private->kick_work,
1053 ccw_device_nopath_notify, (void *)cdev); 1005 ccw_device_nopath_notify, (void *)cdev);
1054 queue_work(ccw_device_notify_work, &cdev->private->kick_work); 1006 queue_work(ccw_device_notify_work, &cdev->private->kick_work);
1055 } else if (cdev->private->flags.doverify) 1007 } else
1056 /* Start delayed path verification. */ 1008 /* Start delayed path verification. */
1057 ccw_device_online_verify(cdev, 0); 1009 ccw_device_online_verify(cdev, 0);
1058} 1010}
@@ -1289,12 +1241,6 @@ fsm_func_t *dev_jumptable[NR_DEV_STATES][NR_DEV_EVENTS] = {
1289 [DEV_EVENT_TIMEOUT] = ccw_device_killing_timeout, 1241 [DEV_EVENT_TIMEOUT] = ccw_device_killing_timeout,
1290 [DEV_EVENT_VERIFY] = ccw_device_nop, //FIXME 1242 [DEV_EVENT_VERIFY] = ccw_device_nop, //FIXME
1291 }, 1243 },
1292 [DEV_STATE_WAIT4IO] = {
1293 [DEV_EVENT_NOTOPER] = ccw_device_online_notoper,
1294 [DEV_EVENT_INTERRUPT] = ccw_device_wait4io_irq,
1295 [DEV_EVENT_TIMEOUT] = ccw_device_wait4io_timeout,
1296 [DEV_EVENT_VERIFY] = ccw_device_delay_verify,
1297 },
1298 [DEV_STATE_QUIESCE] = { 1244 [DEV_STATE_QUIESCE] = {
1299 [DEV_EVENT_NOTOPER] = ccw_device_quiesce_done, 1245 [DEV_EVENT_NOTOPER] = ccw_device_quiesce_done,
1300 [DEV_EVENT_INTERRUPT] = ccw_device_quiesce_done, 1246 [DEV_EVENT_INTERRUPT] = ccw_device_quiesce_done,