[SCSI] qla2xxx: Cleanup any outstanding SRB resources during shutdown.
authorAndrew Vasquez <andrew.vasquez@qlogic.com>
Thu, 31 Jan 2008 20:33:46 +0000 (12:33 -0800)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Fri, 8 Feb 2008 00:02:38 +0000 (18:02 -0600)
Refactor SRB-failure completion codes in the process.  Also,
signal the DPC routine to complete sooner as backend processing
at shutdown-time is superflous.

[jejb: resolve conflicts with pci_enable_device_bars removal]

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/qla2xxx/qla_gbl.h
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_os.c

index ba35fc2..193f688 100644 (file)
@@ -66,6 +66,7 @@ extern int ql2xqfullrampup;
 extern int num_hosts;
 
 extern int qla2x00_loop_reset(scsi_qla_host_t *);
+extern void qla2x00_abort_all_cmds(scsi_qla_host_t *, int);
 
 /*
  * Global Functions in qla_mid.c source file.
index d0633ca..2e51fa8 100644 (file)
@@ -3213,9 +3213,6 @@ int
 qla2x00_abort_isp(scsi_qla_host_t *ha)
 {
        int rval;
-       unsigned long flags = 0;
-       uint16_t       cnt;
-       srb_t          *sp;
        uint8_t        status = 0;
 
        if (ha->flags.online) {
@@ -3236,19 +3233,8 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
                                    LOOP_DOWN_TIME);
                }
 
-               spin_lock_irqsave(&ha->hardware_lock, flags);
                /* Requeue all commands in outstanding command list. */
-               for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
-                       sp = ha->outstanding_cmds[cnt];
-                       if (sp) {
-                               ha->outstanding_cmds[cnt] = NULL;
-                               sp->flags = 0;
-                               sp->cmd->result = DID_RESET << 16;
-                               sp->cmd->host_scribble = (unsigned char *)NULL;
-                               qla2x00_sp_compl(ha, sp);
-                       }
-               }
-               spin_unlock_irqrestore(&ha->hardware_lock, flags);
+               qla2x00_abort_all_cmds(ha, DID_RESET << 16);
 
                ha->isp_ops->get_flash_version(ha, ha->request_ring);
 
Simple merge