s390/cio: fix IO subchannel event race
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Wed, 5 Sep 2012 12:19:42 +0000 (14:19 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 6 Sep 2012 08:40:39 +0000 (10:40 +0200)
If the subchannel event function is called from IRQ context and we
observe that the subchannel in question is gone we flag the attached
device as not operational and schedule the event function to be called
again from process context where the subchannel gets deregistered.
However if the subchannel reappeared at the time the event function
gets called from process context we would do nothing and leave the
device in not operational state. Recognize this case in sch_get_action
and trigger reexamination of the subchannel/device.

Acked-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/device.c

index ed25c8740a9ce4b0bb8e8334a32b72abc08655ae..e8e1a108cdf8e08ca7543517d609ab0d380c9fea 100644 (file)
@@ -1426,6 +1426,8 @@ static enum io_sch_action sch_get_action(struct subchannel *sch)
                return IO_SCH_REPROBE;
        if (cdev->online)
                return IO_SCH_VERIFY;
+       if (cdev->private->state == DEV_STATE_NOT_OPER)
+               return IO_SCH_UNREG_ATTACH;
        return IO_SCH_NOP;
 }
 
This page took 0.036165 seconds and 5 git commands to generate.