aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2006-12-04 09:41:01 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2006-12-04 09:41:01 -0500
commit24cb5b4846ebae5543869b5c596c2650f380df53 (patch)
treefd45cf7fab0a065c7529c5811e3258a66e877095 /drivers/s390
parent9163bb2e556f6c7879961df94540f0879db4717b (diff)
[S390] cio: Use path verification for last path gone after vary off.
If the last path to a device is gone after a chpid has been varied off, putting it on the slow queue doesn't prevent a device driver from still attempting to use it (it may stay on the slow queue for a long time). Instead, trigger a verify event which will prevent I/O attempts from the device driver immediately. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/cio/chsc.c22
-rw-r--r--drivers/s390/cio/css.h1
-rw-r--r--drivers/s390/cio/device_fsm.c11
3 files changed, 24 insertions, 10 deletions
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index 9d92540bd99e..11900de94cb3 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -744,20 +744,22 @@ __s390_subchannel_vary_chpid(struct subchannel *sch, __u8 chpid, int on)
744 device_trigger_reprobe(sch); 744 device_trigger_reprobe(sch);
745 else if (sch->driver && sch->driver->verify) 745 else if (sch->driver && sch->driver->verify)
746 sch->driver->verify(&sch->dev); 746 sch->driver->verify(&sch->dev);
747 } else { 747 break;
748 sch->opm &= ~(0x80 >> chp); 748 }
749 sch->lpm &= ~(0x80 >> chp); 749 sch->opm &= ~(0x80 >> chp);
750 if (check_for_io_on_path(sch, chp)) 750 sch->lpm &= ~(0x80 >> chp);
751 /* Path verification is done after killing. */ 751 if (check_for_io_on_path(sch, chp))
752 device_kill_io(sch); 752 /* Path verification is done after killing. */
753 else if (!sch->lpm) { 753 device_kill_io(sch);
754 else if (!sch->lpm) {
755 if (device_trigger_verify(sch) != 0) {
754 if (css_enqueue_subchannel_slow(sch->schid)) { 756 if (css_enqueue_subchannel_slow(sch->schid)) {
755 css_clear_subchannel_slow_list(); 757 css_clear_subchannel_slow_list();
756 need_rescan = 1; 758 need_rescan = 1;
757 } 759 }
758 } else if (sch->driver && sch->driver->verify) 760 }
759 sch->driver->verify(&sch->dev); 761 } else if (sch->driver && sch->driver->verify)
760 } 762 sch->driver->verify(&sch->dev);
761 break; 763 break;
762 } 764 }
763 spin_unlock_irqrestore(&sch->lock, flags); 765 spin_unlock_irqrestore(&sch->lock, flags);
diff --git a/drivers/s390/cio/css.h b/drivers/s390/cio/css.h
index 4c2ff8336288..da73453fa54b 100644
--- a/drivers/s390/cio/css.h
+++ b/drivers/s390/cio/css.h
@@ -171,6 +171,7 @@ void device_trigger_reprobe(struct subchannel *);
171/* Helper functions for vary on/off. */ 171/* Helper functions for vary on/off. */
172int device_is_online(struct subchannel *); 172int device_is_online(struct subchannel *);
173void device_kill_io(struct subchannel *); 173void device_kill_io(struct subchannel *);
174int device_trigger_verify(struct subchannel *sch);
174 175
175/* Machine check helper function. */ 176/* Machine check helper function. */
176void device_kill_pending_timer(struct subchannel *); 177void device_kill_pending_timer(struct subchannel *);
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
index de3d0857db9f..7665000e8dfe 100644
--- a/drivers/s390/cio/device_fsm.c
+++ b/drivers/s390/cio/device_fsm.c
@@ -59,6 +59,17 @@ device_set_disconnected(struct subchannel *sch)
59 cdev->private->state = DEV_STATE_DISCONNECTED; 59 cdev->private->state = DEV_STATE_DISCONNECTED;
60} 60}
61 61
62int device_trigger_verify(struct subchannel *sch)
63{
64 struct ccw_device *cdev;
65
66 cdev = sch->dev.driver_data;
67 if (!cdev || !cdev->online)
68 return -EINVAL;
69 dev_fsm_event(cdev, DEV_EVENT_VERIFY);
70 return 0;
71}
72
62/* 73/*
63 * Timeout function. It just triggers a DEV_EVENT_TIMEOUT. 74 * Timeout function. It just triggers a DEV_EVENT_TIMEOUT.
64 */ 75 */