aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSaurav Kashyap <saurav.kashyap@qlogic.com>2013-02-08 01:57:53 -0500
committerJames Bottomley <JBottomley@Parallels.com>2013-02-22 07:43:05 -0500
commit6c315553285533d6785ec313e437c3b3ab89ad47 (patch)
treef47f2da423b88e3ba30d1e941df80740c5f8740d /drivers
parent992357c6514398ab874198f5059c5e5024480f8c (diff)
[SCSI] qla2xxx: Display the lock owner on lock acquire failure.
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/qla2xxx/qla_dbg.c2
-rw-r--r--drivers/scsi/qla2xxx/qla_nx.c9
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c8
3 files changed, 16 insertions, 3 deletions
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index 65e95bdce704..29101fed8355 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -36,7 +36,7 @@
36 * | | | 0x800b,0x8039 | 36 * | | | 0x800b,0x8039 |
37 * | AER/EEH | 0x9011 | | 37 * | AER/EEH | 0x9011 | |
38 * | Virtual Port | 0xa007 | | 38 * | Virtual Port | 0xa007 | |
39 * | ISP82XX Specific | 0xb084 | 0xb002,0xb024 | 39 * | ISP82XX Specific | 0xb086 | 0xb002,0xb024 |
40 * | MultiQ | 0xc00c | | 40 * | MultiQ | 0xc00c | |
41 * | Misc | 0xd010 | | 41 * | Misc | 0xd010 | |
42 * | Target Mode | 0xe070 | | 42 * | Target Mode | 0xe070 | |
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
index 042368b9a2e7..dc4be5b78bb9 100644
--- a/drivers/scsi/qla2xxx/qla_nx.c
+++ b/drivers/scsi/qla2xxx/qla_nx.c
@@ -847,14 +847,21 @@ static int
847qla82xx_rom_lock(struct qla_hw_data *ha) 847qla82xx_rom_lock(struct qla_hw_data *ha)
848{ 848{
849 int done = 0, timeout = 0; 849 int done = 0, timeout = 0;
850 uint32_t lock_owner = 0;
851 scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
850 852
851 while (!done) { 853 while (!done) {
852 /* acquire semaphore2 from PCI HW block */ 854 /* acquire semaphore2 from PCI HW block */
853 done = qla82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM2_LOCK)); 855 done = qla82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM2_LOCK));
854 if (done == 1) 856 if (done == 1)
855 break; 857 break;
856 if (timeout >= qla82xx_rom_lock_timeout) 858 if (timeout >= qla82xx_rom_lock_timeout) {
859 lock_owner = qla82xx_rd_32(ha, QLA82XX_ROM_LOCK_ID);
860 ql_dbg(ql_dbg_p3p, vha, 0xb085,
861 "Failed to acquire rom lock, acquired by %d.\n",
862 lock_owner);
857 return -1; 863 return -1;
864 }
858 timeout++; 865 timeout++;
859 } 866 }
860 qla82xx_wr_32(ha, QLA82XX_ROM_LOCK_ID, ROM_LOCK_DRIVER); 867 qla82xx_wr_32(ha, QLA82XX_ROM_LOCK_ID, ROM_LOCK_DRIVER);
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 33fb2178eb4d..a947f70405b6 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -4065,6 +4065,8 @@ qla83xx_force_lock_recovery(scsi_qla_host_t *base_vha)
4065 uint32_t idc_lck_rcvry_stage_mask = 0x3; 4065 uint32_t idc_lck_rcvry_stage_mask = 0x3;
4066 uint32_t idc_lck_rcvry_owner_mask = 0x3c; 4066 uint32_t idc_lck_rcvry_owner_mask = 0x3c;
4067 struct qla_hw_data *ha = base_vha->hw; 4067 struct qla_hw_data *ha = base_vha->hw;
4068 ql_dbg(ql_dbg_p3p, base_vha, 0xb086,
4069 "Trying force recovery of the IDC lock.\n");
4068 4070
4069 rval = qla83xx_rd_reg(base_vha, QLA83XX_IDC_LOCK_RECOVERY, &data); 4071 rval = qla83xx_rd_reg(base_vha, QLA83XX_IDC_LOCK_RECOVERY, &data);
4070 if (rval) 4072 if (rval)
@@ -4156,6 +4158,7 @@ qla83xx_idc_lock(scsi_qla_host_t *base_vha, uint16_t requester_id)
4156{ 4158{
4157 uint16_t options = (requester_id << 15) | BIT_6; 4159 uint16_t options = (requester_id << 15) | BIT_6;
4158 uint32_t data; 4160 uint32_t data;
4161 uint32_t lock_owner;
4159 struct qla_hw_data *ha = base_vha->hw; 4162 struct qla_hw_data *ha = base_vha->hw;
4160 4163
4161 /* IDC-lock implementation using driver-lock/lock-id remote registers */ 4164 /* IDC-lock implementation using driver-lock/lock-id remote registers */
@@ -4167,8 +4170,11 @@ retry_lock:
4167 qla83xx_wr_reg(base_vha, QLA83XX_DRIVER_LOCKID, 4170 qla83xx_wr_reg(base_vha, QLA83XX_DRIVER_LOCKID,
4168 ha->portnum); 4171 ha->portnum);
4169 } else { 4172 } else {
4173 qla83xx_rd_reg(base_vha, QLA83XX_DRIVER_LOCKID,
4174 &lock_owner);
4170 ql_dbg(ql_dbg_p3p, base_vha, 0xb063, 4175 ql_dbg(ql_dbg_p3p, base_vha, 0xb063,
4171 "Failed to acquire IDC lock. retrying...\n"); 4176 "Failed to acquire IDC lock, acquired by %d, "
4177 "retrying...\n", lock_owner);
4172 4178
4173 /* Retry/Perform IDC-Lock recovery */ 4179 /* Retry/Perform IDC-Lock recovery */
4174 if (qla83xx_idc_lock_recovery(base_vha) 4180 if (qla83xx_idc_lock_recovery(base_vha)