scsi: qla2xxx: fix error message on <qla2400
authorMeelis Roos <mroos@linux.ee>
Thu, 8 Mar 2018 13:44:07 +0000 (15:44 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 21 Mar 2018 22:59:31 +0000 (18:59 -0400)
This patch fixes IO traps caught by hardware when mailbox command fails
on qla2200. The error handler assumes newer firmware that is available
on 2400 and newer HBA-s.

This causes ugly crashes on sparc64.

Fix it with separate debug prints on different firmware generations like
most other places do.

[mkp: updated based on feedback from Himanshu]

Signed-off-by: Meelis Roos <mroos@linux.ee>
Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_dbg.c
drivers/scsi/qla2xxx/qla_mbx.c

index 3e9dc54b89a32f1704e4d68569d667ee673d34e4..d52ee990707d3e8de898812b0cf56bee646c206b 100644 (file)
@@ -14,7 +14,7 @@
  * | Module Init and Probe        |       0x0193       | 0x0146         |
  * |                              |                    | 0x015b-0x0160 |
  * |                              |                    | 0x016e                |
- * | Mailbox commands             |       0x1205       | 0x11a2-0x11ff |
+ * | Mailbox commands             |       0x1206       | 0x11a2-0x11ff |
  * | Device Discovery             |       0x2134       | 0x210e-0x2116  |
  * |                             |                    | 0x211a         |
  * |                              |                    | 0x211c-0x2128  |
index 7397aeddd96cb9ca783b9b9b5dffc1f6d423f954..9a97f2ceffbab1e7a55402719efda19be7b264c7 100644 (file)
@@ -503,11 +503,19 @@ mbx_done:
                                }
                        pr_warn(" cmd=%x ****\n", command);
                }
-               ql_dbg(ql_dbg_mbx, vha, 0x1198,
-                   "host_status=%#x intr_ctrl=%#x intr_status=%#x\n",
-                   RD_REG_DWORD(&reg->isp24.host_status),
-                   RD_REG_DWORD(&reg->isp24.ictrl),
-                   RD_REG_DWORD(&reg->isp24.istatus));
+               if (IS_FWI2_CAPABLE(ha) && !(IS_P3P_TYPE(ha))) {
+                       ql_dbg(ql_dbg_mbx, vha, 0x1198,
+                           "host_status=%#x intr_ctrl=%#x intr_status=%#x\n",
+                           RD_REG_DWORD(&reg->isp24.host_status),
+                           RD_REG_DWORD(&reg->isp24.ictrl),
+                           RD_REG_DWORD(&reg->isp24.istatus));
+               } else {
+                       ql_dbg(ql_dbg_mbx, vha, 0x1206,
+                           "ctrl_status=%#x ictrl=%#x istatus=%#x\n",
+                           RD_REG_WORD(&reg->isp.ctrl_status),
+                           RD_REG_WORD(&reg->isp.ictrl),
+                           RD_REG_WORD(&reg->isp.istatus));
+               }
        } else {
                ql_dbg(ql_dbg_mbx, base_vha, 0x1021, "Done %s.\n", __func__);
        }