aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorJan Glauber <jang@linux.vnet.ibm.com>2011-08-03 10:44:17 -0400
committerHeiko Carstens <heiko.carstens@de.ibm.com>2011-08-03 10:44:19 -0400
commitbe8d97a540cec5d272b1e08e27741a3c3aa38f66 (patch)
tree39fc55cde3cdf81aea341dd1de1d2957988b97b1 /drivers/s390
parented8f37370d83e695c0a4fa5d5fc7a83ecb947526 (diff)
[S390] qdio: 2nd stage retry on SIGA-W busy conditions
The SIGA-W may return with the busy bit set which means the device was blocked. The busy loop which retries the SIGA-W for 100us may not be long enough when running under a heavily loaded hypervisor. Extend the retry mechanism by adding a longer second stage which retries the SIGA-W for up to 10s. In difference to the first retry loop the second stage is using mdelay to stop the cpu between the retries and thereby avoid additional preassure in on the hypervisor. If the second stage retry is successfull a device reset is avoided. Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/cio/qdio.h2
-rw-r--r--drivers/s390/cio/qdio_main.c21
2 files changed, 20 insertions, 3 deletions
diff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h
index 7bc643f3f5ab..e5c966462c5a 100644
--- a/drivers/s390/cio/qdio.h
+++ b/drivers/s390/cio/qdio.h
@@ -14,6 +14,8 @@
14#include "chsc.h" 14#include "chsc.h"
15 15
16#define QDIO_BUSY_BIT_PATIENCE (100 << 12) /* 100 microseconds */ 16#define QDIO_BUSY_BIT_PATIENCE (100 << 12) /* 100 microseconds */
17#define QDIO_BUSY_BIT_RETRY_DELAY 10 /* 10 milliseconds */
18#define QDIO_BUSY_BIT_RETRIES 1000 /* = 10s retry time */
17#define QDIO_INPUT_THRESHOLD (500 << 12) /* 500 microseconds */ 19#define QDIO_INPUT_THRESHOLD (500 << 12) /* 500 microseconds */
18 20
19/* 21/*
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c
index e58169c32474..288c9140290e 100644
--- a/drivers/s390/cio/qdio_main.c
+++ b/drivers/s390/cio/qdio_main.c
@@ -313,7 +313,7 @@ static int qdio_siga_output(struct qdio_q *q, unsigned int *busy_bit)
313 unsigned long schid = *((u32 *) &q->irq_ptr->schid); 313 unsigned long schid = *((u32 *) &q->irq_ptr->schid);
314 unsigned int fc = QDIO_SIGA_WRITE; 314 unsigned int fc = QDIO_SIGA_WRITE;
315 u64 start_time = 0; 315 u64 start_time = 0;
316 int cc; 316 int retries = 0, cc;
317 317
318 if (is_qebsm(q)) { 318 if (is_qebsm(q)) {
319 schid = q->irq_ptr->sch_token; 319 schid = q->irq_ptr->sch_token;
@@ -325,6 +325,7 @@ again:
325 /* hipersocket busy condition */ 325 /* hipersocket busy condition */
326 if (unlikely(*busy_bit)) { 326 if (unlikely(*busy_bit)) {
327 WARN_ON(queue_type(q) != QDIO_IQDIO_QFMT || cc != 2); 327 WARN_ON(queue_type(q) != QDIO_IQDIO_QFMT || cc != 2);
328 retries++;
328 329
329 if (!start_time) { 330 if (!start_time) {
330 start_time = get_clock(); 331 start_time = get_clock();
@@ -333,6 +334,11 @@ again:
333 if ((get_clock() - start_time) < QDIO_BUSY_BIT_PATIENCE) 334 if ((get_clock() - start_time) < QDIO_BUSY_BIT_PATIENCE)
334 goto again; 335 goto again;
335 } 336 }
337 if (retries) {
338 DBF_DEV_EVENT(DBF_WARN, q->irq_ptr,
339 "%4x cc2 BB1:%1d", SCH_NO(q), q->nr);
340 DBF_DEV_EVENT(DBF_WARN, q->irq_ptr, "count:%u", retries);
341 }
336 return cc; 342 return cc;
337} 343}
338 344
@@ -728,13 +734,14 @@ static inline int qdio_outbound_q_moved(struct qdio_q *q)
728 734
729static int qdio_kick_outbound_q(struct qdio_q *q) 735static int qdio_kick_outbound_q(struct qdio_q *q)
730{ 736{
737 int retries = 0, cc;
731 unsigned int busy_bit; 738 unsigned int busy_bit;
732 int cc;
733 739
734 if (!need_siga_out(q)) 740 if (!need_siga_out(q))
735 return 0; 741 return 0;
736 742
737 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "siga-w:%1d", q->nr); 743 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "siga-w:%1d", q->nr);
744retry:
738 qperf_inc(q, siga_write); 745 qperf_inc(q, siga_write);
739 746
740 cc = qdio_siga_output(q, &busy_bit); 747 cc = qdio_siga_output(q, &busy_bit);
@@ -743,7 +750,11 @@ static int qdio_kick_outbound_q(struct qdio_q *q)
743 break; 750 break;
744 case 2: 751 case 2:
745 if (busy_bit) { 752 if (busy_bit) {
746 DBF_ERROR("%4x cc2 REP:%1d", SCH_NO(q), q->nr); 753 while (++retries < QDIO_BUSY_BIT_RETRIES) {
754 mdelay(QDIO_BUSY_BIT_RETRY_DELAY);
755 goto retry;
756 }
757 DBF_ERROR("%4x cc2 BBC:%1d", SCH_NO(q), q->nr);
747 cc |= QDIO_ERROR_SIGA_BUSY; 758 cc |= QDIO_ERROR_SIGA_BUSY;
748 } else 759 } else
749 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "siga-w cc2:%1d", q->nr); 760 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "siga-w cc2:%1d", q->nr);
@@ -753,6 +764,10 @@ static int qdio_kick_outbound_q(struct qdio_q *q)
753 DBF_ERROR("%4x SIGA-W:%1d", SCH_NO(q), cc); 764 DBF_ERROR("%4x SIGA-W:%1d", SCH_NO(q), cc);
754 break; 765 break;
755 } 766 }
767 if (retries) {
768 DBF_ERROR("%4x cc2 BB2:%1d", SCH_NO(q), q->nr);
769 DBF_ERROR("count:%u", retries);
770 }
756 return cc; 771 return cc;
757} 772}
758 773