[SCSI] qla2xxx: Add host number in reset and quiescent message logs.
[pandora-kernel.git] / drivers / scsi / qla2xxx / qla_nx.c
index acd1ad3..e1138bc 100644 (file)
@@ -844,6 +844,12 @@ qla82xx_rom_lock(struct qla_hw_data *ha)
        return 0;
 }
 
+static void
+qla82xx_rom_unlock(struct qla_hw_data *ha)
+{
+       qla82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM2_UNLOCK));
+}
+
 static int
 qla82xx_wait_rom_busy(struct qla_hw_data *ha)
 {
@@ -924,7 +930,7 @@ qla82xx_rom_fast_read(struct qla_hw_data *ha, int addr, int *valp)
                return -1;
        }
        ret = qla82xx_do_rom_fast_read(ha, addr, valp);
-       qla82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM2_UNLOCK));
+       qla82xx_rom_unlock(ha);
        return ret;
 }
 
@@ -1056,7 +1062,7 @@ qla82xx_write_flash_dword(struct qla_hw_data *ha, uint32_t flashaddr,
        ret = qla82xx_flash_wait_write_finish(ha);
 
 done_write:
-       qla82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM2_UNLOCK));
+       qla82xx_rom_unlock(ha);
        return ret;
 }
 
@@ -1144,7 +1150,7 @@ qla82xx_pinit_from_rom(scsi_qla_host_t *vha)
        qla82xx_wr_32(ha, QLA82XX_CRB_QDR_NET + 0xe4, val);
        msleep(20);
 
-       qla82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM2_UNLOCK));
+       qla82xx_rom_unlock(ha);
 
        /* Read the signature value from the flash.
         * Offset 0: Contain signature (0xcafecafe)
@@ -2410,9 +2416,13 @@ qla82xx_load_fw(scsi_qla_host_t *vha)
 
        if (qla82xx_fw_load_from_flash(ha) == QLA_SUCCESS) {
                qla_printk(KERN_ERR, ha,
-                       "Firmware loaded successfully from flash\n");
+                   "Firmware loaded successfully from flash\n");
                return QLA_SUCCESS;
+       } else {
+               qla_printk(KERN_ERR, ha,
+                   "Firmware load from flash failed\n");
        }
+
 try_blob_fw:
        qla_printk(KERN_INFO, ha,
            "Attempting to load firmware from blob\n");
@@ -2563,11 +2573,11 @@ qla2xx_build_scsi_type_6_iocbs(srb_t *sp, struct cmd_type_6 *cmd_pkt,
                        dsd_seg = (uint32_t *)&cmd_pkt->fcp_data_dseg_address;
                        *dsd_seg++ = cpu_to_le32(LSD(dsd_ptr->dsd_list_dma));
                        *dsd_seg++ = cpu_to_le32(MSD(dsd_ptr->dsd_list_dma));
-                       cmd_pkt->fcp_data_dseg_len = dsd_list_len;
+                       *dsd_seg++ = cpu_to_le32(dsd_list_len);
                } else {
                        *cur_dsd++ = cpu_to_le32(LSD(dsd_ptr->dsd_list_dma));
                        *cur_dsd++ = cpu_to_le32(MSD(dsd_ptr->dsd_list_dma));
-                       *cur_dsd++ = dsd_list_len;
+                       *cur_dsd++ = cpu_to_le32(dsd_list_len);
                }
                cur_dsd = (uint32_t *)next_dsd;
                while (avail_dsds) {
@@ -3006,7 +3016,7 @@ qla82xx_unprotect_flash(struct qla_hw_data *ha)
                qla_printk(KERN_WARNING, ha, "Write disable failed\n");
 
 done_unprotect:
-       qla82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM2_UNLOCK));
+       qla82xx_rom_unlock(ha);
        return ret;
 }
 
@@ -3035,7 +3045,7 @@ qla82xx_protect_flash(struct qla_hw_data *ha)
        if (qla82xx_write_disable_flash(ha) != 0)
                qla_printk(KERN_WARNING, ha, "Write disable failed\n");
 done_protect:
-       qla82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM2_UNLOCK));
+       qla82xx_rom_unlock(ha);
        return ret;
 }
 
@@ -3063,7 +3073,7 @@ qla82xx_erase_sector(struct qla_hw_data *ha, int addr)
        }
        ret = qla82xx_flash_wait_write_finish(ha);
 done:
-       qla82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM2_UNLOCK));
+       qla82xx_rom_unlock(ha);
        return ret;
 }
 
@@ -3243,7 +3253,7 @@ void qla82xx_rom_lock_recovery(struct qla_hw_data *ha)
         * else died while holding it.
         * In either case, unlock.
         */
-       qla82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM2_UNLOCK));
+       qla82xx_rom_unlock(ha);
 }
 
 /*
@@ -3647,7 +3657,8 @@ void qla82xx_watchdog(scsi_qla_host_t *vha)
                if (dev_state == QLA82XX_DEV_NEED_RESET &&
                    !test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) {
                        qla_printk(KERN_WARNING, ha,
-                           "%s(): Adapter reset needed!\n", __func__);
+                           "scsi(%ld) %s: Adapter reset needed!\n",
+                               vha->host_no, __func__);
                        set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
                        qla2xxx_wake_dpc(vha);
                } else if (dev_state == QLA82XX_DEV_NEED_QUIESCENT &&
@@ -3694,8 +3705,9 @@ void qla82xx_watchdog(scsi_qla_host_t *vha)
                                if (ha->flags.mbox_busy) {
                                        ha->flags.mbox_int = 1;
                                        DEBUG2(qla_printk(KERN_ERR, ha,
-                                           "Due to fw hung, doing premature "
-                                           "completion of mbx command\n"));
+                                           "scsi(%ld) Due to fw hung, doing "
+                                           "premature completion of mbx "
+                                           "command\n", vha->host_no));
                                        if (test_bit(MBX_INTR_WAIT,
                                            &ha->mbx_cmd_flags))
                                                complete(&ha->mbx_intr_comp);