aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_init.c
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2005-10-27 14:09:48 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-10-28 12:52:11 -0400
commit4fdfefe52944f5c4132a372ed5c208962a73c3f2 (patch)
tree23e4c9cb3f899d82e07fcfc55d75744b919415e5 /drivers/scsi/qla2xxx/qla_init.c
parent0eedfcf0cdac30b14d1e6c99abc6604347ef0af8 (diff)
[SCSI] qla2xxx: Add support to dynamically enable/disable ZIO.
ISP23xx and ISP24xx chips have support for an adaptive method of posting SCSI command completions for multiple SCSI commands during a single system interrupt. SCSI commands are placed on the system response queue without interrupting the host until 1) a delay timer expires; or 2) a SCSI command completes with an error. As long as the host software (qla2xxx) services the response queue for completions (this polling is done during queuecommand()) within the 'delay timer' period, the firmware will not generate system interrupt. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c53
1 files changed, 40 insertions, 13 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 6fc8bbae939..9e36fbd9245 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1372,7 +1372,6 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
1372 nvram_t *nv = (nvram_t *)ha->request_ring; 1372 nvram_t *nv = (nvram_t *)ha->request_ring;
1373 uint8_t *ptr = (uint8_t *)ha->request_ring; 1373 uint8_t *ptr = (uint8_t *)ha->request_ring;
1374 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; 1374 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
1375 uint8_t timer_mode;
1376 1375
1377 rval = QLA_SUCCESS; 1376 rval = QLA_SUCCESS;
1378 1377
@@ -1650,22 +1649,26 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
1650 1649
1651 ha->flags.process_response_queue = 1; 1650 ha->flags.process_response_queue = 1;
1652 } else { 1651 } else {
1653 /* Enable ZIO -- Support mode 5 only. */ 1652 /* Enable ZIO. */
1654 timer_mode = icb->add_firmware_options[0] & 1653 if (!ha->flags.init_done) {
1655 (BIT_3 | BIT_2 | BIT_1 | BIT_0); 1654 ha->zio_mode = icb->add_firmware_options[0] &
1655 (BIT_3 | BIT_2 | BIT_1 | BIT_0);
1656 ha->zio_timer = icb->interrupt_delay_timer ?
1657 icb->interrupt_delay_timer: 2;
1658 }
1656 icb->add_firmware_options[0] &= 1659 icb->add_firmware_options[0] &=
1657 ~(BIT_3 | BIT_2 | BIT_1 | BIT_0); 1660 ~(BIT_3 | BIT_2 | BIT_1 | BIT_0);
1658 if (ql2xenablezio) 1661 ha->flags.process_response_queue = 0;
1659 timer_mode = BIT_2 | BIT_0; 1662 if (ha->zio_mode != QLA_ZIO_DISABLED) {
1660 if (timer_mode == (BIT_2 | BIT_0)) { 1663 DEBUG2(printk("scsi(%ld): ZIO mode %d enabled; timer "
1661 DEBUG2(printk("scsi(%ld): ZIO enabled; timer delay " 1664 "delay (%d us).\n", ha->host_no, ha->zio_mode,
1662 "(%d).\n", ha->host_no, ql2xintrdelaytimer)); 1665 ha->zio_timer * 100));
1663 qla_printk(KERN_INFO, ha, 1666 qla_printk(KERN_INFO, ha,
1664 "ZIO enabled; timer delay (%d).\n", 1667 "ZIO mode %d enabled; timer delay (%d us).\n",
1665 ql2xintrdelaytimer); 1668 ha->zio_mode, ha->zio_timer * 100);
1666 1669
1667 icb->add_firmware_options[0] |= timer_mode; 1670 icb->add_firmware_options[0] |= (uint8_t)ha->zio_mode;
1668 icb->interrupt_delay_timer = ql2xintrdelaytimer; 1671 icb->interrupt_delay_timer = (uint8_t)ha->zio_timer;
1669 ha->flags.process_response_queue = 1; 1672 ha->flags.process_response_queue = 1;
1670 } 1673 }
1671 } 1674 }
@@ -3442,6 +3445,30 @@ qla24xx_nvram_config(scsi_qla_host_t *ha)
3442 if (ql2xloginretrycount) 3445 if (ql2xloginretrycount)
3443 ha->login_retry_count = ql2xloginretrycount; 3446 ha->login_retry_count = ql2xloginretrycount;
3444 3447
3448 /* Enable ZIO. */
3449 if (!ha->flags.init_done) {
3450 ha->zio_mode = le32_to_cpu(icb->firmware_options_2) &
3451 (BIT_3 | BIT_2 | BIT_1 | BIT_0);
3452 ha->zio_timer = le16_to_cpu(icb->interrupt_delay_timer) ?
3453 le16_to_cpu(icb->interrupt_delay_timer): 2;
3454 }
3455 icb->firmware_options_2 &= __constant_cpu_to_le32(
3456 ~(BIT_3 | BIT_2 | BIT_1 | BIT_0));
3457 ha->flags.process_response_queue = 0;
3458 if (ha->zio_mode != QLA_ZIO_DISABLED) {
3459 DEBUG2(printk("scsi(%ld): ZIO mode %d enabled; timer delay "
3460 "(%d us).\n", ha->host_no, ha->zio_mode,
3461 ha->zio_timer * 100));
3462 qla_printk(KERN_INFO, ha,
3463 "ZIO mode %d enabled; timer delay (%d us).\n",
3464 ha->zio_mode, ha->zio_timer * 100);
3465
3466 icb->firmware_options_2 |= cpu_to_le32(
3467 (uint32_t)ha->zio_mode);
3468 icb->interrupt_delay_timer = cpu_to_le16(ha->zio_timer);
3469 ha->flags.process_response_queue = 1;
3470 }
3471
3445 if (rval) { 3472 if (rval) {
3446 DEBUG2_3(printk(KERN_WARNING 3473 DEBUG2_3(printk(KERN_WARNING
3447 "scsi(%ld): NVRAM configuration failed!\n", ha->host_no)); 3474 "scsi(%ld): NVRAM configuration failed!\n", ha->host_no));