]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/qla2xxx/qla_isr.c
Merge branch 's3c-moves2' of git://aeryn.fluff.org.uk/bjdooks/linux into devel
[linux-2.6-omap-h63xx.git] / drivers / scsi / qla2xxx / qla_isr.c
index bf41887cdd655a4dfd0ecc04a4a8a91aa67bc265..a76efd99d0070fa7d61ee43a5c8d2c539c5db3c6 100644 (file)
@@ -391,9 +391,9 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                break;
 
        case MBA_LIP_OCCURRED:          /* Loop Initialization Procedure */
-               DEBUG2(printk("scsi(%ld): LIP occured (%x).\n", ha->host_no,
+               DEBUG2(printk("scsi(%ld): LIP occurred (%x).\n", ha->host_no,
                    mb[1]));
-               qla_printk(KERN_INFO, ha, "LIP occured (%x).\n", mb[1]);
+               qla_printk(KERN_INFO, ha, "LIP occurred (%x).\n", mb[1]);
 
                if (atomic_read(&ha->loop_state) != LOOP_DOWN) {
                        atomic_set(&ha->loop_state, LOOP_DOWN);
@@ -460,7 +460,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                DEBUG2(printk("scsi(%ld): Asynchronous LIP RESET (%x).\n",
                    ha->host_no, mb[1]));
                qla_printk(KERN_INFO, ha,
-                   "LIP reset occured (%x).\n", mb[1]);
+                   "LIP reset occurred (%x).\n", mb[1]);
 
                if (atomic_read(&ha->loop_state) != LOOP_DOWN) {
                        atomic_set(&ha->loop_state, LOOP_DOWN);
@@ -543,7 +543,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
 
        case MBA_PORT_UPDATE:           /* Port database update */
                /*
-                * If PORT UPDATE is global (recieved LIP_OCCURED/LIP_RESET
+                * If PORT UPDATE is global (received LIP_OCCURRED/LIP_RESET
                 * event etc. earlier indicating loop is down) then process
                 * it.  Otherwise ignore it and Wait for RSCN to come in.
                 */
@@ -589,7 +589,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                    "scsi(%ld): RSCN database changed -- %04x %04x %04x.\n",
                    ha->host_no, mb[1], mb[2], mb[3]));
 
-               rscn_entry = (mb[1] << 16) | mb[2];
+               rscn_entry = ((mb[1] & 0xff) << 16) | mb[2];
                host_pid = (ha->d_id.b.domain << 16) | (ha->d_id.b.area << 8) |
                    ha->d_id.b.al_pa;
                if (rscn_entry == host_pid) {
@@ -600,6 +600,8 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                        break;
                }
 
+               /* Ignore reserved bits from RSCN-payload. */
+               rscn_entry = ((mb[1] & 0x3ff) << 16) | mb[2];
                rscn_queue_index = ha->rscn_in_ptr + 1;
                if (rscn_queue_index == MAX_RSCN_COUNT)
                        rscn_queue_index = 0;
@@ -1060,8 +1062,9 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt)
                resid = resid_len;
                /* Use F/W calculated residual length. */
                if (IS_FWI2_CAPABLE(ha)) {
-                       if (scsi_status & SS_RESIDUAL_UNDER &&
-                           resid != fw_resid_len) {
+                       if (!(scsi_status & SS_RESIDUAL_UNDER)) {
+                               lscsi_status = 0;
+                       } else if (resid != fw_resid_len) {
                                scsi_status &= ~SS_RESIDUAL_UNDER;
                                lscsi_status = 0;
                        }
@@ -1184,7 +1187,12 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt)
                    cp->serial_number, comp_status,
                    atomic_read(&fcport->state)));
 
-               cp->result = DID_BUS_BUSY << 16;
+               /*
+                * We are going to have the fc class block the rport
+                * while we try to recover so instruct the mid layer
+                * to requeue until the class decides how to handle this.
+                */
+               cp->result = DID_TRANSPORT_DISRUPTED << 16;
                if (atomic_read(&fcport->state) == FCS_ONLINE)
                        qla2x00_mark_device_lost(fcport->ha, fcport, 1, 1);
                break;
@@ -1211,7 +1219,12 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt)
                break;
 
        case CS_TIMEOUT:
-               cp->result = DID_BUS_BUSY << 16;
+               /*
+                * We are going to have the fc class block the rport
+                * while we try to recover so instruct the mid layer
+                * to requeue until the class decides how to handle this.
+                */
+               cp->result = DID_TRANSPORT_DISRUPTED << 16;
 
                if (IS_FWI2_CAPABLE(ha)) {
                        DEBUG2(printk(KERN_INFO