--- /dev/null
+From: Gerald Schaefer <geraldsc@de.ibm.com>
+Subject: cio: ccw devices are not removed when last path is varied offline
+References: bnc#518291,LTC#54951
+
+Symptom: When the last CHPID to an offline CCW device is varied offline,
+ that device remains registered even though it is no longer
+ accessible.
+Problem: The vary command triggers an internal path verification event
+ which is not handled for devices in the offline state.
+Solution: Install a handler for the path verification event in offline state
+ which will remove the device if it is no longer accessible.
+
+Acked-by: John Jolly <jjolly@suse.de>
+---
+ drivers/s390/cio/device_fsm.c | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+Index: linux-sles11/drivers/s390/cio/device_fsm.c
+===================================================================
+--- linux-sles11.orig/drivers/s390/cio/device_fsm.c
++++ linux-sles11/drivers/s390/cio/device_fsm.c
+@@ -739,6 +739,17 @@ static void ccw_device_generic_notoper(s
+ }
+
+ /*
++ * Handle path verification event in offline state.
++ */
++static void ccw_device_offline_verify(struct ccw_device *cdev,
++ enum dev_event dev_event)
++{
++ struct subchannel *sch = to_subchannel(cdev->dev.parent);
++
++ css_schedule_eval(sch->schid);
++}
++
++/*
+ * Handle path verification event.
+ */
+ static void
+@@ -1155,7 +1166,7 @@ fsm_func_t *dev_jumptable[NR_DEV_STATES]
+ [DEV_EVENT_NOTOPER] = ccw_device_generic_notoper,
+ [DEV_EVENT_INTERRUPT] = ccw_device_offline_irq,
+ [DEV_EVENT_TIMEOUT] = ccw_device_nop,
+- [DEV_EVENT_VERIFY] = ccw_device_nop,
++ [DEV_EVENT_VERIFY] = ccw_device_offline_verify,
+ },
+ [DEV_STATE_VERIFY] = {
+ [DEV_EVENT_NOTOPER] = ccw_device_generic_notoper,