]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/aic94xx/aic94xx_scb.c
[SCSI] aic94xx: fix REQ_TASK_ABORT and REQ_DEVICE_RESET
[linux-2.6-omap-h63xx.git] / drivers / scsi / aic94xx / aic94xx_scb.c
index 8f43ff772f2378290d99af151a409b7dd19d6792..ab350504ca5a21b366d288d9b04fc6f55b3fc85e 100644 (file)
@@ -24,7 +24,6 @@
  *
  */
 
-#include <linux/pci.h>
 #include <scsi/scsi_host.h>
 
 #include "aic94xx.h"
@@ -459,13 +458,19 @@ static void escb_tasklet_complete(struct asd_ascb *ascb,
                tc_abort = le16_to_cpu(tc_abort);
 
                list_for_each_entry_safe(a, b, &asd_ha->seq.pend_q, list) {
-                       struct sas_task *task = ascb->uldd_task;
+                       struct sas_task *task = a->uldd_task;
+
+                       if (a->tc_index != tc_abort)
+                               continue;
 
-                       if (task && a->tc_index == tc_abort) {
+                       if (task) {
                                failed_dev = task->dev;
                                sas_task_abort(task);
-                               break;
+                       } else {
+                               ASD_DPRINTK("R_T_A for non TASK scb 0x%x\n",
+                                           a->scb->header.opcode);
                        }
+                       break;
                }
 
                if (!failed_dev) {
@@ -479,7 +484,7 @@ static void escb_tasklet_complete(struct asd_ascb *ascb,
                 * that the EH will wake up and do something.
                 */
                list_for_each_entry_safe(a, b, &asd_ha->seq.pend_q, list) {
-                       struct sas_task *task = ascb->uldd_task;
+                       struct sas_task *task = a->uldd_task;
 
                        if (task &&
                            task->dev == failed_dev &&
@@ -789,12 +794,12 @@ void asd_build_control_phy(struct asd_ascb *ascb, int phy_id, u8 subfunc)
 
                /* initiator port settings are in the hi nibble */
                if (phy->sas_phy.role == PHY_ROLE_INITIATOR)
-                       control_phy->port_type = SAS_PROTO_ALL << 4;
+                       control_phy->port_type = SAS_PROTOCOL_ALL << 4;
                else if (phy->sas_phy.role == PHY_ROLE_TARGET)
-                       control_phy->port_type = SAS_PROTO_ALL;
+                       control_phy->port_type = SAS_PROTOCOL_ALL;
                else
                        control_phy->port_type =
-                               (SAS_PROTO_ALL << 4) | SAS_PROTO_ALL;
+                               (SAS_PROTOCOL_ALL << 4) | SAS_PROTOCOL_ALL;
 
                /* link reset retries, this should be nominal */
                control_phy->link_reset_retries = 10;