aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2008-02-19 09:29:30 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-02-19 09:29:34 -0500
commitb32ecdb7257821e5e42d9b9b2a427b02c89f85e7 (patch)
tree6f4e7362078b1560f8cc780fec54742d89a81928 /drivers/s390
parent591bb4f637e48950d35e2ca01e6b962c519d96e5 (diff)
[S390] qdio: fix qdio_activate timeout handling.
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>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/cio/qdio.c10
-rw-r--r--drivers/s390/cio/qdio.h2
2 files changed, 3 insertions, 9 deletions
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c
index 097fc0967e9d..cd9cfc1326d2 100644
--- a/drivers/s390/cio/qdio.c
+++ b/drivers/s390/cio/qdio.c
@@ -32,7 +32,7 @@
32 32
33#include <linux/module.h> 33#include <linux/module.h>
34#include <linux/init.h> 34#include <linux/init.h>
35 35#include <linux/delay.h>
36#include <linux/slab.h> 36#include <linux/slab.h>
37#include <linux/kernel.h> 37#include <linux/kernel.h>
38#include <linux/proc_fs.h> 38#include <linux/proc_fs.h>
@@ -3332,13 +3332,7 @@ qdio_activate(struct ccw_device *cdev, int flags)
3332 } 3332 }
3333 } 3333 }
3334 3334
3335 wait_event_interruptible_timeout(cdev->private->wait_q, 3335 msleep(QDIO_ACTIVATE_TIMEOUT);
3336 ((irq_ptr->state ==
3337 QDIO_IRQ_STATE_STOPPED) ||
3338 (irq_ptr->state ==
3339 QDIO_IRQ_STATE_ERR)),
3340 QDIO_ACTIVATE_TIMEOUT);
3341
3342 switch (irq_ptr->state) { 3336 switch (irq_ptr->state) {
3343 case QDIO_IRQ_STATE_STOPPED: 3337 case QDIO_IRQ_STATE_STOPPED:
3344 case QDIO_IRQ_STATE_ERR: 3338 case QDIO_IRQ_STATE_ERR:
diff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h
index 37870e4e938e..da8a272fd75b 100644
--- a/drivers/s390/cio/qdio.h
+++ b/drivers/s390/cio/qdio.h
@@ -57,10 +57,10 @@
57 of the queue to 0 */ 57 of the queue to 0 */
58 58
59#define QDIO_ESTABLISH_TIMEOUT (1*HZ) 59#define QDIO_ESTABLISH_TIMEOUT (1*HZ)
60#define QDIO_ACTIVATE_TIMEOUT (5*HZ)
61#define QDIO_CLEANUP_CLEAR_TIMEOUT (20*HZ) 60#define QDIO_CLEANUP_CLEAR_TIMEOUT (20*HZ)
62#define QDIO_CLEANUP_HALT_TIMEOUT (10*HZ) 61#define QDIO_CLEANUP_HALT_TIMEOUT (10*HZ)
63#define QDIO_FORCE_CHECK_TIMEOUT (10*HZ) 62#define QDIO_FORCE_CHECK_TIMEOUT (10*HZ)
63#define QDIO_ACTIVATE_TIMEOUT (5) /* 5 ms */
64 64
65enum qdio_irq_states { 65enum qdio_irq_states {
66 QDIO_IRQ_STATE_INACTIVE, 66 QDIO_IRQ_STATE_INACTIVE,