aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_mbx.c
diff options
context:
space:
mode:
authorArun Easi <arun.easi@qlogic.com>2012-02-09 14:15:51 -0500
committerJames Bottomley <JBottomley@Parallels.com>2012-02-19 09:23:45 -0500
commit5e19ed90f95f9e3799f2c6a06f87cb043c212102 (patch)
treeef791b37da2238d3a2749a759ed986f0c8744b08 /drivers/scsi/qla2xxx/qla_mbx.c
parent557cf7857cbf396f899034f1a7a13e245ef7e914 (diff)
[SCSI] qla2xxx: Log messages to use correct vha.
Signed-off-by: Arun Easi <arun.easi@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mbx.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index bde3eb273b0d..957a4b88e482 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -46,17 +46,17 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
46 struct qla_hw_data *ha = vha->hw; 46 struct qla_hw_data *ha = vha->hw;
47 scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev); 47 scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev);
48 48
49 ql_dbg(ql_dbg_mbx, base_vha, 0x1000, "Entered %s.\n", __func__); 49 ql_dbg(ql_dbg_mbx, vha, 0x1000, "Entered %s.\n", __func__);
50 50
51 if (ha->pdev->error_state > pci_channel_io_frozen) { 51 if (ha->pdev->error_state > pci_channel_io_frozen) {
52 ql_log(ql_log_warn, base_vha, 0x1001, 52 ql_log(ql_log_warn, vha, 0x1001,
53 "error_state is greater than pci_channel_io_frozen, " 53 "error_state is greater than pci_channel_io_frozen, "
54 "exiting.\n"); 54 "exiting.\n");
55 return QLA_FUNCTION_TIMEOUT; 55 return QLA_FUNCTION_TIMEOUT;
56 } 56 }
57 57
58 if (vha->device_flags & DFLG_DEV_FAILED) { 58 if (vha->device_flags & DFLG_DEV_FAILED) {
59 ql_log(ql_log_warn, base_vha, 0x1002, 59 ql_log(ql_log_warn, vha, 0x1002,
60 "Device in failed state, exiting.\n"); 60 "Device in failed state, exiting.\n");
61 return QLA_FUNCTION_TIMEOUT; 61 return QLA_FUNCTION_TIMEOUT;
62 } 62 }
@@ -69,7 +69,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
69 69
70 70
71 if (ha->flags.pci_channel_io_perm_failure) { 71 if (ha->flags.pci_channel_io_perm_failure) {
72 ql_log(ql_log_warn, base_vha, 0x1003, 72 ql_log(ql_log_warn, vha, 0x1003,
73 "Perm failure on EEH timeout MBX, exiting.\n"); 73 "Perm failure on EEH timeout MBX, exiting.\n");
74 return QLA_FUNCTION_TIMEOUT; 74 return QLA_FUNCTION_TIMEOUT;
75 } 75 }
@@ -77,7 +77,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
77 if (ha->flags.isp82xx_fw_hung) { 77 if (ha->flags.isp82xx_fw_hung) {
78 /* Setting Link-Down error */ 78 /* Setting Link-Down error */
79 mcp->mb[0] = MBS_LINK_DOWN_ERROR; 79 mcp->mb[0] = MBS_LINK_DOWN_ERROR;
80 ql_log(ql_log_warn, base_vha, 0x1004, 80 ql_log(ql_log_warn, vha, 0x1004,
81 "FW hung = %d.\n", ha->flags.isp82xx_fw_hung); 81 "FW hung = %d.\n", ha->flags.isp82xx_fw_hung);
82 return QLA_FUNCTION_TIMEOUT; 82 return QLA_FUNCTION_TIMEOUT;
83 } 83 }
@@ -89,7 +89,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
89 */ 89 */
90 if (!wait_for_completion_timeout(&ha->mbx_cmd_comp, mcp->tov * HZ)) { 90 if (!wait_for_completion_timeout(&ha->mbx_cmd_comp, mcp->tov * HZ)) {
91 /* Timeout occurred. Return error. */ 91 /* Timeout occurred. Return error. */
92 ql_log(ql_log_warn, base_vha, 0x1005, 92 ql_log(ql_log_warn, vha, 0x1005,
93 "Cmd access timeout, cmd=0x%x, Exiting.\n", 93 "Cmd access timeout, cmd=0x%x, Exiting.\n",
94 mcp->mb[0]); 94 mcp->mb[0]);
95 return QLA_FUNCTION_TIMEOUT; 95 return QLA_FUNCTION_TIMEOUT;
@@ -99,7 +99,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
99 /* Save mailbox command for debug */ 99 /* Save mailbox command for debug */
100 ha->mcp = mcp; 100 ha->mcp = mcp;
101 101
102 ql_dbg(ql_dbg_mbx, base_vha, 0x1006, 102 ql_dbg(ql_dbg_mbx, vha, 0x1006,
103 "Prepare to issue mbox cmd=0x%x.\n", mcp->mb[0]); 103 "Prepare to issue mbox cmd=0x%x.\n", mcp->mb[0]);
104 104
105 spin_lock_irqsave(&ha->hardware_lock, flags); 105 spin_lock_irqsave(&ha->hardware_lock, flags);
@@ -128,28 +128,28 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
128 iptr++; 128 iptr++;
129 } 129 }
130 130
131 ql_dbg(ql_dbg_mbx + ql_dbg_buffer, base_vha, 0x1111, 131 ql_dbg(ql_dbg_mbx + ql_dbg_buffer, vha, 0x1111,
132 "Loaded MBX registers (displayed in bytes) =.\n"); 132 "Loaded MBX registers (displayed in bytes) =.\n");
133 ql_dump_buffer(ql_dbg_mbx + ql_dbg_buffer, base_vha, 0x1112, 133 ql_dump_buffer(ql_dbg_mbx + ql_dbg_buffer, vha, 0x1112,
134 (uint8_t *)mcp->mb, 16); 134 (uint8_t *)mcp->mb, 16);
135 ql_dbg(ql_dbg_mbx + ql_dbg_buffer, base_vha, 0x1113, 135 ql_dbg(ql_dbg_mbx + ql_dbg_buffer, vha, 0x1113,
136 ".\n"); 136 ".\n");
137 ql_dump_buffer(ql_dbg_mbx + ql_dbg_buffer, base_vha, 0x1114, 137 ql_dump_buffer(ql_dbg_mbx + ql_dbg_buffer, vha, 0x1114,
138 ((uint8_t *)mcp->mb + 0x10), 16); 138 ((uint8_t *)mcp->mb + 0x10), 16);
139 ql_dbg(ql_dbg_mbx + ql_dbg_buffer, base_vha, 0x1115, 139 ql_dbg(ql_dbg_mbx + ql_dbg_buffer, vha, 0x1115,
140 ".\n"); 140 ".\n");
141 ql_dump_buffer(ql_dbg_mbx + ql_dbg_buffer, base_vha, 0x1116, 141 ql_dump_buffer(ql_dbg_mbx + ql_dbg_buffer, vha, 0x1116,
142 ((uint8_t *)mcp->mb + 0x20), 8); 142 ((uint8_t *)mcp->mb + 0x20), 8);
143 ql_dbg(ql_dbg_mbx + ql_dbg_buffer, base_vha, 0x1117, 143 ql_dbg(ql_dbg_mbx + ql_dbg_buffer, vha, 0x1117,
144 "I/O Address = %p.\n", optr); 144 "I/O Address = %p.\n", optr);
145 ql_dump_regs(ql_dbg_mbx + ql_dbg_buffer, base_vha, 0x100e); 145 ql_dump_regs(ql_dbg_mbx + ql_dbg_buffer, vha, 0x100e);
146 146
147 /* Issue set host interrupt command to send cmd out. */ 147 /* Issue set host interrupt command to send cmd out. */
148 ha->flags.mbox_int = 0; 148 ha->flags.mbox_int = 0;
149 clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags); 149 clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
150 150
151 /* Unlock mbx registers and wait for interrupt */ 151 /* Unlock mbx registers and wait for interrupt */
152 ql_dbg(ql_dbg_mbx, base_vha, 0x100f, 152 ql_dbg(ql_dbg_mbx, vha, 0x100f,
153 "Going to unlock irq & waiting for interrupts. " 153 "Going to unlock irq & waiting for interrupts. "
154 "jiffies=%lx.\n", jiffies); 154 "jiffies=%lx.\n", jiffies);
155 155
@@ -164,7 +164,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
164 spin_unlock_irqrestore(&ha->hardware_lock, 164 spin_unlock_irqrestore(&ha->hardware_lock,
165 flags); 165 flags);
166 ha->flags.mbox_busy = 0; 166 ha->flags.mbox_busy = 0;
167 ql_dbg(ql_dbg_mbx, base_vha, 0x1010, 167 ql_dbg(ql_dbg_mbx, vha, 0x1010,
168 "Pending mailbox timeout, exiting.\n"); 168 "Pending mailbox timeout, exiting.\n");
169 rval = QLA_FUNCTION_TIMEOUT; 169 rval = QLA_FUNCTION_TIMEOUT;
170 goto premature_exit; 170 goto premature_exit;
@@ -181,7 +181,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
181 clear_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags); 181 clear_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags);
182 182
183 } else { 183 } else {
184 ql_dbg(ql_dbg_mbx, base_vha, 0x1011, 184 ql_dbg(ql_dbg_mbx, vha, 0x1011,
185 "Cmd=%x Polling Mode.\n", command); 185 "Cmd=%x Polling Mode.\n", command);
186 186
187 if (IS_QLA82XX(ha)) { 187 if (IS_QLA82XX(ha)) {
@@ -190,7 +190,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
190 spin_unlock_irqrestore(&ha->hardware_lock, 190 spin_unlock_irqrestore(&ha->hardware_lock,
191 flags); 191 flags);
192 ha->flags.mbox_busy = 0; 192 ha->flags.mbox_busy = 0;
193 ql_dbg(ql_dbg_mbx, base_vha, 0x1012, 193 ql_dbg(ql_dbg_mbx, vha, 0x1012,
194 "Pending mailbox timeout, exiting.\n"); 194 "Pending mailbox timeout, exiting.\n");
195 rval = QLA_FUNCTION_TIMEOUT; 195 rval = QLA_FUNCTION_TIMEOUT;
196 goto premature_exit; 196 goto premature_exit;
@@ -215,7 +215,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
215 command == MBC_LOAD_RISC_RAM_EXTENDED)) 215 command == MBC_LOAD_RISC_RAM_EXTENDED))
216 msleep(10); 216 msleep(10);
217 } /* while */ 217 } /* while */
218 ql_dbg(ql_dbg_mbx, base_vha, 0x1013, 218 ql_dbg(ql_dbg_mbx, vha, 0x1013,
219 "Waited %d sec.\n", 219 "Waited %d sec.\n",
220 (uint)((jiffies - (wait_time - (mcp->tov * HZ)))/HZ)); 220 (uint)((jiffies - (wait_time - (mcp->tov * HZ)))/HZ));
221 } 221 }
@@ -224,7 +224,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
224 if (ha->flags.mbox_int) { 224 if (ha->flags.mbox_int) {
225 uint16_t *iptr2; 225 uint16_t *iptr2;
226 226
227 ql_dbg(ql_dbg_mbx, base_vha, 0x1014, 227 ql_dbg(ql_dbg_mbx, vha, 0x1014,
228 "Cmd=%x completed.\n", command); 228 "Cmd=%x completed.\n", command);
229 229
230 /* Got interrupt. Clear the flag. */ 230 /* Got interrupt. Clear the flag. */
@@ -237,7 +237,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
237 mcp->mb[0] = MBS_LINK_DOWN_ERROR; 237 mcp->mb[0] = MBS_LINK_DOWN_ERROR;
238 ha->mcp = NULL; 238 ha->mcp = NULL;
239 rval = QLA_FUNCTION_FAILED; 239 rval = QLA_FUNCTION_FAILED;
240 ql_log(ql_log_warn, base_vha, 0x1015, 240 ql_log(ql_log_warn, vha, 0x1015,
241 "FW hung = %d.\n", ha->flags.isp82xx_fw_hung); 241 "FW hung = %d.\n", ha->flags.isp82xx_fw_hung);
242 goto premature_exit; 242 goto premature_exit;
243 } 243 }
@@ -269,13 +269,13 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
269 mb0 = RD_MAILBOX_REG(ha, &reg->isp, 0); 269 mb0 = RD_MAILBOX_REG(ha, &reg->isp, 0);
270 ictrl = RD_REG_WORD(&reg->isp.ictrl); 270 ictrl = RD_REG_WORD(&reg->isp.ictrl);
271 } 271 }
272 ql_dbg(ql_dbg_mbx + ql_dbg_buffer, base_vha, 0x1119, 272 ql_dbg(ql_dbg_mbx + ql_dbg_buffer, vha, 0x1119,
273 "MBX Command timeout for cmd %x.\n", command); 273 "MBX Command timeout for cmd %x.\n", command);
274 ql_dbg(ql_dbg_mbx + ql_dbg_buffer, base_vha, 0x111a, 274 ql_dbg(ql_dbg_mbx + ql_dbg_buffer, vha, 0x111a,
275 "iocontrol=%x jiffies=%lx.\n", ictrl, jiffies); 275 "iocontrol=%x jiffies=%lx.\n", ictrl, jiffies);
276 ql_dbg(ql_dbg_mbx + ql_dbg_buffer, base_vha, 0x111b, 276 ql_dbg(ql_dbg_mbx + ql_dbg_buffer, vha, 0x111b,
277 "mb[0] = 0x%x.\n", mb0); 277 "mb[0] = 0x%x.\n", mb0);
278 ql_dump_regs(ql_dbg_mbx + ql_dbg_buffer, base_vha, 0x1019); 278 ql_dump_regs(ql_dbg_mbx + ql_dbg_buffer, vha, 0x1019);
279 279
280 rval = QLA_FUNCTION_TIMEOUT; 280 rval = QLA_FUNCTION_TIMEOUT;
281 } 281 }
@@ -286,7 +286,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
286 ha->mcp = NULL; 286 ha->mcp = NULL;
287 287
288 if ((abort_active || !io_lock_on) && !IS_NOPOLLING_TYPE(ha)) { 288 if ((abort_active || !io_lock_on) && !IS_NOPOLLING_TYPE(ha)) {
289 ql_dbg(ql_dbg_mbx, base_vha, 0x101a, 289 ql_dbg(ql_dbg_mbx, vha, 0x101a,
290 "Checking for additional resp interrupt.\n"); 290 "Checking for additional resp interrupt.\n");
291 291
292 /* polling mode for non isp_abort commands. */ 292 /* polling mode for non isp_abort commands. */
@@ -298,7 +298,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
298 if (!io_lock_on || (mcp->flags & IOCTL_CMD) || 298 if (!io_lock_on || (mcp->flags & IOCTL_CMD) ||
299 ha->flags.eeh_busy) { 299 ha->flags.eeh_busy) {
300 /* not in dpc. schedule it for dpc to take over. */ 300 /* not in dpc. schedule it for dpc to take over. */
301 ql_dbg(ql_dbg_mbx, base_vha, 0x101b, 301 ql_dbg(ql_dbg_mbx, vha, 0x101b,
302 "Timeout, schedule isp_abort_needed.\n"); 302 "Timeout, schedule isp_abort_needed.\n");
303 303
304 if (!test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) && 304 if (!test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) &&
@@ -323,7 +323,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
323 } 323 }
324 } else if (!abort_active) { 324 } else if (!abort_active) {
325 /* call abort directly since we are in the DPC thread */ 325 /* call abort directly since we are in the DPC thread */
326 ql_dbg(ql_dbg_mbx, base_vha, 0x101d, 326 ql_dbg(ql_dbg_mbx, vha, 0x101d,
327 "Timeout, calling abort_isp.\n"); 327 "Timeout, calling abort_isp.\n");
328 328
329 if (!test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) && 329 if (!test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) &&
@@ -352,7 +352,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
352 &vha->dpc_flags); 352 &vha->dpc_flags);
353 } 353 }
354 clear_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags); 354 clear_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags);
355 ql_dbg(ql_dbg_mbx, base_vha, 0x101f, 355 ql_dbg(ql_dbg_mbx, vha, 0x101f,
356 "Finished abort_isp.\n"); 356 "Finished abort_isp.\n");
357 goto mbx_done; 357 goto mbx_done;
358 } 358 }