]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[SCSI] qla2xxx: Display the lock owner on lock acquire failure.
authorSaurav Kashyap <saurav.kashyap@qlogic.com>
Fri, 8 Feb 2013 06:57:53 +0000 (01:57 -0500)
committerJames Bottomley <JBottomley@Parallels.com>
Fri, 22 Feb 2013 12:43:05 +0000 (12:43 +0000)
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/qla2xxx/qla_dbg.c
drivers/scsi/qla2xxx/qla_nx.c
drivers/scsi/qla2xxx/qla_os.c

index 65e95bdce704ff792876e7e46b2b66e7da6ab88c..29101fed8355f0d36d46809a8d744d4fcf965897 100644 (file)
@@ -36,7 +36,7 @@
  * |                              |                    | 0x800b,0x8039  |
  * | AER/EEH                      |       0x9011       |               |
  * | Virtual Port                 |       0xa007       |               |
- * | ISP82XX Specific             |       0xb084       | 0xb002,0xb024  |
+ * | ISP82XX Specific             |       0xb086       | 0xb002,0xb024  |
  * | MultiQ                       |       0xc00c       |               |
  * | Misc                         |       0xd010       |               |
  * | Target Mode                 |       0xe070       |                |
index 042368b9a2e7d1d677dfe0877110a5f0f08a605b..dc4be5b78bb93589a6ed20b2eb39e8974a97a854 100644 (file)
@@ -847,14 +847,21 @@ static int
 qla82xx_rom_lock(struct qla_hw_data *ha)
 {
        int done = 0, timeout = 0;
+       uint32_t lock_owner = 0;
+       scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
 
        while (!done) {
                /* acquire semaphore2 from PCI HW block */
                done = qla82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM2_LOCK));
                if (done == 1)
                        break;
-               if (timeout >= qla82xx_rom_lock_timeout)
+               if (timeout >= qla82xx_rom_lock_timeout) {
+                       lock_owner = qla82xx_rd_32(ha, QLA82XX_ROM_LOCK_ID);
+                       ql_dbg(ql_dbg_p3p, vha, 0xb085,
+                           "Failed to acquire rom lock, acquired by %d.\n",
+                           lock_owner);
                        return -1;
+               }
                timeout++;
        }
        qla82xx_wr_32(ha, QLA82XX_ROM_LOCK_ID, ROM_LOCK_DRIVER);
index 33fb2178eb4d4c32770962244281f2b286b2f22c..a947f70405b63beb82fabf14149b2d23d4384f7b 100644 (file)
@@ -4065,6 +4065,8 @@ qla83xx_force_lock_recovery(scsi_qla_host_t *base_vha)
        uint32_t idc_lck_rcvry_stage_mask = 0x3;
        uint32_t idc_lck_rcvry_owner_mask = 0x3c;
        struct qla_hw_data *ha = base_vha->hw;
+       ql_dbg(ql_dbg_p3p, base_vha, 0xb086,
+           "Trying force recovery of the IDC lock.\n");
 
        rval = qla83xx_rd_reg(base_vha, QLA83XX_IDC_LOCK_RECOVERY, &data);
        if (rval)
@@ -4156,6 +4158,7 @@ qla83xx_idc_lock(scsi_qla_host_t *base_vha, uint16_t requester_id)
 {
        uint16_t options = (requester_id << 15) | BIT_6;
        uint32_t data;
+       uint32_t lock_owner;
        struct qla_hw_data *ha = base_vha->hw;
 
        /* IDC-lock implementation using driver-lock/lock-id remote registers */
@@ -4167,8 +4170,11 @@ retry_lock:
                        qla83xx_wr_reg(base_vha, QLA83XX_DRIVER_LOCKID,
                            ha->portnum);
                } else {
+                       qla83xx_rd_reg(base_vha, QLA83XX_DRIVER_LOCKID,
+                           &lock_owner);
                        ql_dbg(ql_dbg_p3p, base_vha, 0xb063,
-                           "Failed to acquire IDC lock. retrying...\n");
+                           "Failed to acquire IDC lock, acquired by %d, "
+                           "retrying...\n", lock_owner);
 
                        /* Retry/Perform IDC-Lock recovery */
                        if (qla83xx_idc_lock_recovery(base_vha)