aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla4xxx/ql4_mbx.c
diff options
context:
space:
mode:
authorKaren Higgins <karen.higgins@qlogic.com>2013-01-20 23:51:00 -0500
committerJames Bottomley <JBottomley@Parallels.com>2013-01-29 21:47:16 -0500
commit5b1c1bff07d579f8a7b672d4e5262d52eba5ef01 (patch)
tree83b802ffe3e95af2c8e2ecfc1fc907143149f274 /drivers/scsi/qla4xxx/ql4_mbx.c
parentff4108dce9e82acbde8e8b1899aaa4d91bf504b7 (diff)
[SCSI] qla4xxx: Throttle active IOCBs to firmware limits
Problem: QLA4xxx firmware may assert if given more IOCBs than it can handle. Solution: The driver was updated to throttle the number of active IOCBs based on the total number of IOCB buffers received from get_firmware_status mbx_sts[2]. Signed-off-by: Karen Higgins <karen.higgins@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla4xxx/ql4_mbx.c')
-rw-r--r--drivers/scsi/qla4xxx/ql4_mbx.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index 1c57c227c808..81e738d61ec0 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -697,8 +697,24 @@ int qla4xxx_get_firmware_status(struct scsi_qla_host * ha)
697 return QLA_ERROR; 697 return QLA_ERROR;
698 } 698 }
699 699
700 ql4_printk(KERN_INFO, ha, "%ld firmware IOCBs available (%d).\n", 700 /* High-water mark of IOCBs */
701 ha->host_no, mbox_sts[2]); 701 ha->iocb_hiwat = mbox_sts[2];
702 DEBUG2(ql4_printk(KERN_INFO, ha,
703 "%s: firmware IOCBs available = %d\n", __func__,
704 ha->iocb_hiwat));
705
706 if (ha->iocb_hiwat > IOCB_HIWAT_CUSHION)
707 ha->iocb_hiwat -= IOCB_HIWAT_CUSHION;
708
709 /* Ideally, we should not enter this code, as the # of firmware
710 * IOCBs is hard-coded in the firmware. We set a default
711 * iocb_hiwat here just in case */
712 if (ha->iocb_hiwat == 0) {
713 ha->iocb_hiwat = REQUEST_QUEUE_DEPTH / 4;
714 DEBUG2(ql4_printk(KERN_WARNING, ha,
715 "%s: Setting IOCB's to = %d\n", __func__,
716 ha->iocb_hiwat));
717 }
702 718
703 return QLA_SUCCESS; 719 return QLA_SUCCESS;
704} 720}