aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiridhar Malavali <giridhar.malavali@qlogic.com>2010-09-03 17:57:05 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-09-05 14:22:53 -0400
commit1bd58b89e84b15283aaa3148fee4969abe19af8d (patch)
treec5ee87f4c08c6716a582c3e8b896a037f2891db0
parent0374f55ed882a46cd4825dde16ca2392d4c367f6 (diff)
[SCSI] qla2xxx: Check for empty slot in request queue before posting Command type 6 request.
For ISP82xx, the check for empty slot in request queue before posting command type 6 request was missing. This could lead to request queue entry corruptions causing IO timeouts. Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--drivers/scsi/qla2xxx/qla_nx.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
index ad290dc9ba35..0a71cc71eab2 100644
--- a/drivers/scsi/qla2xxx/qla_nx.c
+++ b/drivers/scsi/qla2xxx/qla_nx.c
@@ -2672,6 +2672,19 @@ qla82xx_start_scsi(srb_t *sp)
2672sufficient_dsds: 2672sufficient_dsds:
2673 req_cnt = 1; 2673 req_cnt = 1;
2674 2674
2675 if (req->cnt < (req_cnt + 2)) {
2676 cnt = (uint16_t)RD_REG_DWORD_RELAXED(
2677 &reg->req_q_out[0]);
2678 if (req->ring_index < cnt)
2679 req->cnt = cnt - req->ring_index;
2680 else
2681 req->cnt = req->length -
2682 (req->ring_index - cnt);
2683 }
2684
2685 if (req->cnt < (req_cnt + 2))
2686 goto queuing_error;
2687
2675 ctx = sp->ctx = mempool_alloc(ha->ctx_mempool, GFP_ATOMIC); 2688 ctx = sp->ctx = mempool_alloc(ha->ctx_mempool, GFP_ATOMIC);
2676 if (!sp->ctx) { 2689 if (!sp->ctx) {
2677 DEBUG(printk(KERN_INFO 2690 DEBUG(printk(KERN_INFO