]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
[SCSI] aacraid: forced reset override
authorSalyzyn, Mark <mark_salyzyn@adaptec.com>
Tue, 30 Oct 2007 19:50:49 +0000 (15:50 -0400)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Sat, 12 Jan 2008 00:22:39 +0000 (18:22 -0600)
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>
drivers/scsi/aacraid/aachba.c
drivers/scsi/aacraid/commsup.c
drivers/scsi/aacraid/linit.c
drivers/scsi/aacraid/rx.c

index a77ab8d693d416f48a53c7efd147a3508def7ec4..ad8912cbe6e77dfb60e73f51dc9fc66e265ffd80 100644 (file)
@@ -179,7 +179,7 @@ MODULE_PARM_DESC(check_interval, "Interval in seconds between adapter health che
 
 int aac_check_reset = 1;
 module_param_named(check_reset, aac_check_reset, int, S_IRUGO|S_IWUSR);
-MODULE_PARM_DESC(aac_check_reset, "If adapter fails health check, reset the adapter.");
+MODULE_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.");
 
 int expose_physicals = -1;
 module_param(expose_physicals, int, S_IRUGO|S_IWUSR);
@@ -1305,9 +1305,9 @@ int aac_get_adapter_info(struct aac_dev* dev)
                          (int)sizeof(dev->supplement_adapter_info.VpdInfo.Tsid),
                          dev->supplement_adapter_info.VpdInfo.Tsid);
                }
-               if (!aac_check_reset ||
+               if (!aac_check_reset || ((aac_check_reset != 1) &&
                  (dev->supplement_adapter_info.SupportedOptions2 &
-                 le32_to_cpu(AAC_OPTION_IGNORE_RESET))) {
+                 le32_to_cpu(AAC_OPTION_IGNORE_RESET)))) {
                        printk(KERN_INFO "%s%d: Reset Adapter Ignored\n",
                          dev->name, dev->id);
                }
@@ -1798,7 +1798,7 @@ static int aac_synchronize(struct scsi_cmnd *scsicmd)
        if (active)
                return SCSI_MLQUEUE_DEVICE_BUSY;
 
-       aac = (struct aac_dev *)scsicmd->device->host->hostdata;
+       aac = (struct aac_dev *)sdev->host->hostdata;
        if (aac->in_reset)
                return SCSI_MLQUEUE_HOST_BUSY;
 
index abce48ccc85b620f92f5779f37c23aa487d37a4a..cb9a92f894ab0b3004eb6ede382ac627823759dc 100644 (file)
@@ -1217,12 +1217,13 @@ int aac_reset_adapter(struct aac_dev * aac, int forced)
        }
 
        /* Quiesce build, flush cache, write through mode */
-       aac_send_shutdown(aac);
+       if (forced < 2)
+               aac_send_shutdown(aac);
        spin_lock_irqsave(host->host_lock, flagv);
-       retval = _aac_reset_adapter(aac, forced);
+       retval = _aac_reset_adapter(aac, forced ? forced : ((aac_check_reset != 0) && (aac_check_reset != 1)));
        spin_unlock_irqrestore(host->host_lock, flagv);
 
-       if (retval == -ENODEV) {
+       if ((forced < 2) && (retval == -ENODEV)) {
                /* Unwind aac_send_shutdown() IOP_RESET unsupported/disabled */
                struct fib * fibctx = aac_fib_alloc(aac);
                if (fibctx) {
@@ -1372,14 +1373,14 @@ int aac_check_health(struct aac_dev * aac)
 
        printk(KERN_ERR "%s: Host adapter BLINK LED 0x%x\n", aac->name, BlinkLED);
 
-       if (!aac_check_reset ||
+       if (!aac_check_reset || ((aac_check_reset != 1) &&
                (aac->supplement_adapter_info.SupportedOptions2 &
-                       le32_to_cpu(AAC_OPTION_IGNORE_RESET)))
+                       le32_to_cpu(AAC_OPTION_IGNORE_RESET))))
                goto out;
        host = aac->scsi_host_ptr;
        if (aac->thread->pid != current->pid)
                spin_lock_irqsave(host->host_lock, flagv);
-       BlinkLED = _aac_reset_adapter(aac, 0);
+       BlinkLED = _aac_reset_adapter(aac, aac_check_reset != 1);
        if (aac->thread->pid != current->pid)
                spin_unlock_irqrestore(host->host_lock, flagv);
        return BlinkLED;
index 9dd331bc29b01386f89532e4c057d5a126f516e0..b4c9ff1b08591d508547c0063b39944c34436360 100644 (file)
@@ -584,8 +584,11 @@ static int aac_eh_reset(struct scsi_cmnd* cmd)
         * support a register, instead of a commanded, reset.
         */
        if ((aac->supplement_adapter_info.SupportedOptions2 &
-         le32_to_cpu(AAC_OPTION_MU_RESET|AAC_OPTION_IGNORE_RESET)) ==
-         le32_to_cpu(AAC_OPTION_MU_RESET))
+          le32_to_cpu(AAC_OPTION_MU_RESET)) &&
+         aac_check_reset &&
+         ((aac_check_reset != 1) ||
+          (aac->supplement_adapter_info.SupportedOptions2 &
+           le32_to_cpu(AAC_OPTION_IGNORE_RESET))))
                aac_reset_adapter(aac, 2); /* Bypass wait for command quiesce */
        return SUCCESS; /* Cause an immediate retry of the command with a ten second delay after successful tur */
 }
index 73eef3dc5dc629d0056a1e8ba2178a1205bc9f4e..710a03e54ed067bd51e2843189147fb0ccaba9f7 100644 (file)
@@ -549,7 +549,9 @@ int _aac_rx_init(struct aac_dev *dev)
        dev->OIMR = status = rx_readb (dev, MUnit.OIMR);
        if ((((status & 0x0c) != 0x0c) || aac_reset_devices || reset_devices) &&
          !aac_rx_restart_adapter(dev, 0))
-               ++restart;
+               /* Make sure the Hardware FIFO is empty */
+               while ((++restart < 512) &&
+                 (rx_readl(dev, MUnit.OutboundQueue) != 0xFFFFFFFFL));
        /*
         *      Check to see if the board panic'd while booting.
         */