diff options
author | Karen Higgins <karen.higgins@qlogic.com> | 2010-10-07 01:50:21 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-10-25 15:52:03 -0400 |
commit | 91a772a4b1840fea39f0377c2cbca4cfc5be05f9 (patch) | |
tree | 6da2edca3f1578c9f2e5c62e98dd9cfe219d6344 | |
parent | 6434080b127088606e03d2ecfe5ffdd797e38d63 (diff) |
[SCSI] qla4xxx: dump mailbox registers on System Error
Signed-off-by: Karen Higgins <karen.higgins@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_dbg.c | 101 | ||||
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_glbl.h | 1 | ||||
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_isr.c | 2 |
3 files changed, 104 insertions, 0 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_dbg.c b/drivers/scsi/qla4xxx/ql4_dbg.c index cbceb0ebabf7..edcf048215dd 100644 --- a/drivers/scsi/qla4xxx/ql4_dbg.c +++ b/drivers/scsi/qla4xxx/ql4_dbg.c | |||
@@ -30,3 +30,104 @@ void qla4xxx_dump_buffer(void *b, uint32_t size) | |||
30 | printk(KERN_INFO "\n"); | 30 | printk(KERN_INFO "\n"); |
31 | } | 31 | } |
32 | 32 | ||
33 | void qla4xxx_dump_registers(struct scsi_qla_host *ha) | ||
34 | { | ||
35 | uint8_t i; | ||
36 | |||
37 | if (is_qla8022(ha)) { | ||
38 | for (i = 1; i < MBOX_REG_COUNT; i++) | ||
39 | printk(KERN_INFO "mailbox[%d] = 0x%08X\n", | ||
40 | i, readl(&ha->qla4_8xxx_reg->mailbox_in[i])); | ||
41 | return; | ||
42 | } | ||
43 | |||
44 | for (i = 0; i < MBOX_REG_COUNT; i++) { | ||
45 | printk(KERN_INFO "0x%02X mailbox[%d] = 0x%08X\n", | ||
46 | (uint8_t) offsetof(struct isp_reg, mailbox[i]), i, | ||
47 | readw(&ha->reg->mailbox[i])); | ||
48 | } | ||
49 | |||
50 | printk(KERN_INFO "0x%02X flash_address = 0x%08X\n", | ||
51 | (uint8_t) offsetof(struct isp_reg, flash_address), | ||
52 | readw(&ha->reg->flash_address)); | ||
53 | printk(KERN_INFO "0x%02X flash_data = 0x%08X\n", | ||
54 | (uint8_t) offsetof(struct isp_reg, flash_data), | ||
55 | readw(&ha->reg->flash_data)); | ||
56 | printk(KERN_INFO "0x%02X ctrl_status = 0x%08X\n", | ||
57 | (uint8_t) offsetof(struct isp_reg, ctrl_status), | ||
58 | readw(&ha->reg->ctrl_status)); | ||
59 | |||
60 | if (is_qla4010(ha)) { | ||
61 | printk(KERN_INFO "0x%02X nvram = 0x%08X\n", | ||
62 | (uint8_t) offsetof(struct isp_reg, u1.isp4010.nvram), | ||
63 | readw(&ha->reg->u1.isp4010.nvram)); | ||
64 | } else if (is_qla4022(ha) | is_qla4032(ha)) { | ||
65 | printk(KERN_INFO "0x%02X intr_mask = 0x%08X\n", | ||
66 | (uint8_t) offsetof(struct isp_reg, u1.isp4022.intr_mask), | ||
67 | readw(&ha->reg->u1.isp4022.intr_mask)); | ||
68 | printk(KERN_INFO "0x%02X nvram = 0x%08X\n", | ||
69 | (uint8_t) offsetof(struct isp_reg, u1.isp4022.nvram), | ||
70 | readw(&ha->reg->u1.isp4022.nvram)); | ||
71 | printk(KERN_INFO "0x%02X semaphore = 0x%08X\n", | ||
72 | (uint8_t) offsetof(struct isp_reg, u1.isp4022.semaphore), | ||
73 | readw(&ha->reg->u1.isp4022.semaphore)); | ||
74 | } | ||
75 | printk(KERN_INFO "0x%02X req_q_in = 0x%08X\n", | ||
76 | (uint8_t) offsetof(struct isp_reg, req_q_in), | ||
77 | readw(&ha->reg->req_q_in)); | ||
78 | printk(KERN_INFO "0x%02X rsp_q_out = 0x%08X\n", | ||
79 | (uint8_t) offsetof(struct isp_reg, rsp_q_out), | ||
80 | readw(&ha->reg->rsp_q_out)); | ||
81 | |||
82 | if (is_qla4010(ha)) { | ||
83 | printk(KERN_INFO "0x%02X ext_hw_conf = 0x%08X\n", | ||
84 | (uint8_t) offsetof(struct isp_reg, u2.isp4010.ext_hw_conf), | ||
85 | readw(&ha->reg->u2.isp4010.ext_hw_conf)); | ||
86 | printk(KERN_INFO "0x%02X port_ctrl = 0x%08X\n", | ||
87 | (uint8_t) offsetof(struct isp_reg, u2.isp4010.port_ctrl), | ||
88 | readw(&ha->reg->u2.isp4010.port_ctrl)); | ||
89 | printk(KERN_INFO "0x%02X port_status = 0x%08X\n", | ||
90 | (uint8_t) offsetof(struct isp_reg, u2.isp4010.port_status), | ||
91 | readw(&ha->reg->u2.isp4010.port_status)); | ||
92 | printk(KERN_INFO "0x%02X req_q_out = 0x%08X\n", | ||
93 | (uint8_t) offsetof(struct isp_reg, u2.isp4010.req_q_out), | ||
94 | readw(&ha->reg->u2.isp4010.req_q_out)); | ||
95 | printk(KERN_INFO "0x%02X gp_out = 0x%08X\n", | ||
96 | (uint8_t) offsetof(struct isp_reg, u2.isp4010.gp_out), | ||
97 | readw(&ha->reg->u2.isp4010.gp_out)); | ||
98 | printk(KERN_INFO "0x%02X gp_in = 0x%08X\n", | ||
99 | (uint8_t) offsetof(struct isp_reg, u2.isp4010.gp_in), | ||
100 | readw(&ha->reg->u2.isp4010.gp_in)); | ||
101 | printk(KERN_INFO "0x%02X port_err_status = 0x%08X\n", (uint8_t) | ||
102 | offsetof(struct isp_reg, u2.isp4010.port_err_status), | ||
103 | readw(&ha->reg->u2.isp4010.port_err_status)); | ||
104 | } else if (is_qla4022(ha) | is_qla4032(ha)) { | ||
105 | printk(KERN_INFO "Page 0 Registers:\n"); | ||
106 | printk(KERN_INFO "0x%02X ext_hw_conf = 0x%08X\n", (uint8_t) | ||
107 | offsetof(struct isp_reg, u2.isp4022.p0.ext_hw_conf), | ||
108 | readw(&ha->reg->u2.isp4022.p0.ext_hw_conf)); | ||
109 | printk(KERN_INFO "0x%02X port_ctrl = 0x%08X\n", (uint8_t) | ||
110 | offsetof(struct isp_reg, u2.isp4022.p0.port_ctrl), | ||
111 | readw(&ha->reg->u2.isp4022.p0.port_ctrl)); | ||
112 | printk(KERN_INFO "0x%02X port_status = 0x%08X\n", (uint8_t) | ||
113 | offsetof(struct isp_reg, u2.isp4022.p0.port_status), | ||
114 | readw(&ha->reg->u2.isp4022.p0.port_status)); | ||
115 | printk(KERN_INFO "0x%02X gp_out = 0x%08X\n", | ||
116 | (uint8_t) offsetof(struct isp_reg, u2.isp4022.p0.gp_out), | ||
117 | readw(&ha->reg->u2.isp4022.p0.gp_out)); | ||
118 | printk(KERN_INFO "0x%02X gp_in = 0x%08X\n", | ||
119 | (uint8_t) offsetof(struct isp_reg, u2.isp4022.p0.gp_in), | ||
120 | readw(&ha->reg->u2.isp4022.p0.gp_in)); | ||
121 | printk(KERN_INFO "0x%02X port_err_status = 0x%08X\n", (uint8_t) | ||
122 | offsetof(struct isp_reg, u2.isp4022.p0.port_err_status), | ||
123 | readw(&ha->reg->u2.isp4022.p0.port_err_status)); | ||
124 | printk(KERN_INFO "Page 1 Registers:\n"); | ||
125 | writel(HOST_MEM_CFG_PAGE & set_rmask(CSR_SCSI_PAGE_SELECT), | ||
126 | &ha->reg->ctrl_status); | ||
127 | printk(KERN_INFO "0x%02X req_q_out = 0x%08X\n", | ||
128 | (uint8_t) offsetof(struct isp_reg, u2.isp4022.p1.req_q_out), | ||
129 | readw(&ha->reg->u2.isp4022.p1.req_q_out)); | ||
130 | writel(PORT_CTRL_STAT_PAGE & set_rmask(CSR_SCSI_PAGE_SELECT), | ||
131 | &ha->reg->ctrl_status); | ||
132 | } | ||
133 | } | ||
diff --git a/drivers/scsi/qla4xxx/ql4_glbl.h b/drivers/scsi/qla4xxx/ql4_glbl.h index 95a26fb1626c..6575a47501e5 100644 --- a/drivers/scsi/qla4xxx/ql4_glbl.h +++ b/drivers/scsi/qla4xxx/ql4_glbl.h | |||
@@ -94,6 +94,7 @@ void qla4xxx_process_response_queue(struct scsi_qla_host *ha); | |||
94 | void qla4xxx_wake_dpc(struct scsi_qla_host *ha); | 94 | void qla4xxx_wake_dpc(struct scsi_qla_host *ha); |
95 | void qla4xxx_get_conn_event_log(struct scsi_qla_host *ha); | 95 | void qla4xxx_get_conn_event_log(struct scsi_qla_host *ha); |
96 | void qla4xxx_mailbox_premature_completion(struct scsi_qla_host *ha); | 96 | void qla4xxx_mailbox_premature_completion(struct scsi_qla_host *ha); |
97 | void qla4xxx_dump_registers(struct scsi_qla_host *ha); | ||
97 | 98 | ||
98 | void qla4_8xxx_pci_config(struct scsi_qla_host *); | 99 | void qla4_8xxx_pci_config(struct scsi_qla_host *); |
99 | int qla4_8xxx_iospace_config(struct scsi_qla_host *ha); | 100 | int qla4_8xxx_iospace_config(struct scsi_qla_host *ha); |
diff --git a/drivers/scsi/qla4xxx/ql4_isr.c b/drivers/scsi/qla4xxx/ql4_isr.c index a5fa65562303..7c33fd5943d5 100644 --- a/drivers/scsi/qla4xxx/ql4_isr.c +++ b/drivers/scsi/qla4xxx/ql4_isr.c | |||
@@ -487,6 +487,8 @@ static void qla4xxx_isr_decode_mailbox(struct scsi_qla_host * ha, | |||
487 | case MBOX_ASTS_SYSTEM_ERROR: | 487 | case MBOX_ASTS_SYSTEM_ERROR: |
488 | /* Log Mailbox registers */ | 488 | /* Log Mailbox registers */ |
489 | ql4_printk(KERN_INFO, ha, "%s: System Err\n", __func__); | 489 | ql4_printk(KERN_INFO, ha, "%s: System Err\n", __func__); |
490 | qla4xxx_dump_registers(ha); | ||
491 | |||
490 | if (ql4xdontresethba) { | 492 | if (ql4xdontresethba) { |
491 | DEBUG2(printk("scsi%ld: %s:Don't Reset HBA\n", | 493 | DEBUG2(printk("scsi%ld: %s:Don't Reset HBA\n", |
492 | ha->host_no, __func__)); | 494 | ha->host_no, __func__)); |