aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid
diff options
context:
space:
mode:
authorSalyzyn, Mark <mark_salyzyn@adaptec.com>2007-10-30 15:50:49 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-11 19:22:39 -0500
commitf858317d894a22eb2c26edcd26c7060fc4f40a15 (patch)
tree811c79ed70d994ac25876769e53a60bcce4224d5 /drivers/scsi/aacraid
parent9e0fe44ddb9ed037188ac711af1e981ac32d3c32 (diff)
[SCSI] aacraid: forced reset override
Some of our vendors have requested that our adapters ignore the hardware reset attempts during recovery and have enforced this with changes in Adapter Firmware. Some of our customers have requested the option to be able to reset the adapter under adverse adapter failure, we even had a few defects reported here considering it a regression that the Adapter could not be reset. This patch addresses this dichotomy. The user can force the adapter to be reset if it supports the IOP_RESET_ALWAYS command, in cases where the adapter has been programmed to ignore the reset, by setting the aacraid.check_reset parameter to a value of -1. The driver will not reset an Adapter that does not support the reset command(s). This patch also fixes and cleans up some of the logic associated with resetting the adapter. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James <James.Bottomley@HansenPartnership.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/aacraid')
-rw-r--r--drivers/scsi/aacraid/aachba.c8
-rw-r--r--drivers/scsi/aacraid/commsup.c13
-rw-r--r--drivers/scsi/aacraid/linit.c7
-rw-r--r--drivers/scsi/aacraid/rx.c4
4 files changed, 19 insertions, 13 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index a77ab8d693d4..ad8912cbe6e7 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -179,7 +179,7 @@ MODULE_PARM_DESC(check_interval, "Interval in seconds between adapter health che
179 179
180int aac_check_reset = 1; 180int aac_check_reset = 1;
181module_param_named(check_reset, aac_check_reset, int, S_IRUGO|S_IWUSR); 181module_param_named(check_reset, aac_check_reset, int, S_IRUGO|S_IWUSR);
182MODULE_PARM_DESC(aac_check_reset, "If adapter fails health check, reset the adapter."); 182MODULE_PARM_DESC(aac_check_reset, "If adapter fails health check, reset the adapter. a value of -1 forces the reset to adapters programmed to ignore it.");
183 183
184int expose_physicals = -1; 184int expose_physicals = -1;
185module_param(expose_physicals, int, S_IRUGO|S_IWUSR); 185module_param(expose_physicals, int, S_IRUGO|S_IWUSR);
@@ -1305,9 +1305,9 @@ int aac_get_adapter_info(struct aac_dev* dev)
1305 (int)sizeof(dev->supplement_adapter_info.VpdInfo.Tsid), 1305 (int)sizeof(dev->supplement_adapter_info.VpdInfo.Tsid),
1306 dev->supplement_adapter_info.VpdInfo.Tsid); 1306 dev->supplement_adapter_info.VpdInfo.Tsid);
1307 } 1307 }
1308 if (!aac_check_reset || 1308 if (!aac_check_reset || ((aac_check_reset != 1) &&
1309 (dev->supplement_adapter_info.SupportedOptions2 & 1309 (dev->supplement_adapter_info.SupportedOptions2 &
1310 le32_to_cpu(AAC_OPTION_IGNORE_RESET))) { 1310 le32_to_cpu(AAC_OPTION_IGNORE_RESET)))) {
1311 printk(KERN_INFO "%s%d: Reset Adapter Ignored\n", 1311 printk(KERN_INFO "%s%d: Reset Adapter Ignored\n",
1312 dev->name, dev->id); 1312 dev->name, dev->id);
1313 } 1313 }
@@ -1798,7 +1798,7 @@ static int aac_synchronize(struct scsi_cmnd *scsicmd)
1798 if (active) 1798 if (active)
1799 return SCSI_MLQUEUE_DEVICE_BUSY; 1799 return SCSI_MLQUEUE_DEVICE_BUSY;
1800 1800
1801 aac = (struct aac_dev *)scsicmd->device->host->hostdata; 1801 aac = (struct aac_dev *)sdev->host->hostdata;
1802 if (aac->in_reset) 1802 if (aac->in_reset)
1803 return SCSI_MLQUEUE_HOST_BUSY; 1803 return SCSI_MLQUEUE_HOST_BUSY;
1804 1804
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index abce48ccc85b..cb9a92f894ab 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -1217,12 +1217,13 @@ int aac_reset_adapter(struct aac_dev * aac, int forced)
1217 } 1217 }
1218 1218
1219 /* Quiesce build, flush cache, write through mode */ 1219 /* Quiesce build, flush cache, write through mode */
1220 aac_send_shutdown(aac); 1220 if (forced < 2)
1221 aac_send_shutdown(aac);
1221 spin_lock_irqsave(host->host_lock, flagv); 1222 spin_lock_irqsave(host->host_lock, flagv);
1222 retval = _aac_reset_adapter(aac, forced); 1223 retval = _aac_reset_adapter(aac, forced ? forced : ((aac_check_reset != 0) && (aac_check_reset != 1)));
1223 spin_unlock_irqrestore(host->host_lock, flagv); 1224 spin_unlock_irqrestore(host->host_lock, flagv);
1224 1225
1225 if (retval == -ENODEV) { 1226 if ((forced < 2) && (retval == -ENODEV)) {
1226 /* Unwind aac_send_shutdown() IOP_RESET unsupported/disabled */ 1227 /* Unwind aac_send_shutdown() IOP_RESET unsupported/disabled */
1227 struct fib * fibctx = aac_fib_alloc(aac); 1228 struct fib * fibctx = aac_fib_alloc(aac);
1228 if (fibctx) { 1229 if (fibctx) {
@@ -1372,14 +1373,14 @@ int aac_check_health(struct aac_dev * aac)
1372 1373
1373 printk(KERN_ERR "%s: Host adapter BLINK LED 0x%x\n", aac->name, BlinkLED); 1374 printk(KERN_ERR "%s: Host adapter BLINK LED 0x%x\n", aac->name, BlinkLED);
1374 1375
1375 if (!aac_check_reset || 1376 if (!aac_check_reset || ((aac_check_reset != 1) &&
1376 (aac->supplement_adapter_info.SupportedOptions2 & 1377 (aac->supplement_adapter_info.SupportedOptions2 &
1377 le32_to_cpu(AAC_OPTION_IGNORE_RESET))) 1378 le32_to_cpu(AAC_OPTION_IGNORE_RESET))))
1378 goto out; 1379 goto out;
1379 host = aac->scsi_host_ptr; 1380 host = aac->scsi_host_ptr;
1380 if (aac->thread->pid != current->pid) 1381 if (aac->thread->pid != current->pid)
1381 spin_lock_irqsave(host->host_lock, flagv); 1382 spin_lock_irqsave(host->host_lock, flagv);
1382 BlinkLED = _aac_reset_adapter(aac, 0); 1383 BlinkLED = _aac_reset_adapter(aac, aac_check_reset != 1);
1383 if (aac->thread->pid != current->pid) 1384 if (aac->thread->pid != current->pid)
1384 spin_unlock_irqrestore(host->host_lock, flagv); 1385 spin_unlock_irqrestore(host->host_lock, flagv);
1385 return BlinkLED; 1386 return BlinkLED;
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 9dd331bc29b0..b4c9ff1b0859 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -584,8 +584,11 @@ static int aac_eh_reset(struct scsi_cmnd* cmd)
584 * support a register, instead of a commanded, reset. 584 * support a register, instead of a commanded, reset.
585 */ 585 */
586 if ((aac->supplement_adapter_info.SupportedOptions2 & 586 if ((aac->supplement_adapter_info.SupportedOptions2 &
587 le32_to_cpu(AAC_OPTION_MU_RESET|AAC_OPTION_IGNORE_RESET)) == 587 le32_to_cpu(AAC_OPTION_MU_RESET)) &&
588 le32_to_cpu(AAC_OPTION_MU_RESET)) 588 aac_check_reset &&
589 ((aac_check_reset != 1) ||
590 (aac->supplement_adapter_info.SupportedOptions2 &
591 le32_to_cpu(AAC_OPTION_IGNORE_RESET))))
589 aac_reset_adapter(aac, 2); /* Bypass wait for command quiesce */ 592 aac_reset_adapter(aac, 2); /* Bypass wait for command quiesce */
590 return SUCCESS; /* Cause an immediate retry of the command with a ten second delay after successful tur */ 593 return SUCCESS; /* Cause an immediate retry of the command with a ten second delay after successful tur */
591} 594}
diff --git a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c
index 73eef3dc5dc6..710a03e54ed0 100644
--- a/drivers/scsi/aacraid/rx.c
+++ b/drivers/scsi/aacraid/rx.c
@@ -549,7 +549,9 @@ int _aac_rx_init(struct aac_dev *dev)
549 dev->OIMR = status = rx_readb (dev, MUnit.OIMR); 549 dev->OIMR = status = rx_readb (dev, MUnit.OIMR);
550 if ((((status & 0x0c) != 0x0c) || aac_reset_devices || reset_devices) && 550 if ((((status & 0x0c) != 0x0c) || aac_reset_devices || reset_devices) &&
551 !aac_rx_restart_adapter(dev, 0)) 551 !aac_rx_restart_adapter(dev, 0))
552 ++restart; 552 /* Make sure the Hardware FIFO is empty */
553 while ((++restart < 512) &&
554 (rx_readl(dev, MUnit.OutboundQueue) != 0xFFFFFFFFL));
553 /* 555 /*
554 * Check to see if the board panic'd while booting. 556 * Check to see if the board panic'd while booting.
555 */ 557 */