[S390] qdio: fix qdio_activate timeout handling.
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Tue, 19 Feb 2008 14:29:30 +0000 (15:29 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 19 Feb 2008 14:29:34 +0000 (15:29 +0100)
Current code in qdio_activate waits for at least 5 seconds
until it returns. It may return earlier if an error occurs,
but not if everything is ok. This large timeout value
became visible with commit dfa77f611ff295598e218aa0eb6efa73a5cf26d0
"qdio: set QDIO_ACTIVATE_TIMEOUT to 5s", which intended to
fix the timeout value which was zero. In turn setting an
FCP adapter online took 5 seconds.

In practice waiting for 5ms before continuing is sufficient
as pointed out by Utz Bacher and Cornelia Huck.

Cc: Utz Bacher <utz.bacher@de.ibm.com>
Cc: Jan Glauber <jan.glauber@de.ibm.com>
Cc: Ursula Braun <braunu@de.ibm.com>
Cc: Martin Peschke <mp3@de.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/qdio.c
drivers/s390/cio/qdio.h

index 097fc0967e9d2925594d4062c308dc7274be48b4..cd9cfc1326d205157aeea0edc5582266a738b075 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
-
+#include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/kernel.h>
 #include <linux/proc_fs.h>
@@ -3332,13 +3332,7 @@ qdio_activate(struct ccw_device *cdev, int flags)
                }
        }
 
-       wait_event_interruptible_timeout(cdev->private->wait_q,
-                                        ((irq_ptr->state ==
-                                         QDIO_IRQ_STATE_STOPPED) ||
-                                         (irq_ptr->state ==
-                                          QDIO_IRQ_STATE_ERR)),
-                                        QDIO_ACTIVATE_TIMEOUT);
-
+       msleep(QDIO_ACTIVATE_TIMEOUT);
        switch (irq_ptr->state) {
        case QDIO_IRQ_STATE_STOPPED:
        case QDIO_IRQ_STATE_ERR:
index 37870e4e938ed9d771d91af65f0b606b8fa61da2..da8a272fd75b678d5c622eca50d3e5e056bc06c5 100644 (file)
                                            of the queue to 0 */
 
 #define QDIO_ESTABLISH_TIMEOUT (1*HZ)
-#define QDIO_ACTIVATE_TIMEOUT (5*HZ)
 #define QDIO_CLEANUP_CLEAR_TIMEOUT (20*HZ)
 #define QDIO_CLEANUP_HALT_TIMEOUT (10*HZ)
 #define QDIO_FORCE_CHECK_TIMEOUT (10*HZ)
+#define QDIO_ACTIVATE_TIMEOUT (5) /* 5 ms */
 
 enum qdio_irq_states {
        QDIO_IRQ_STATE_INACTIVE,