diff options
author | Giridhar Malavali <giridhar.malavali@qlogic.com> | 2011-08-16 14:31:44 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-08-29 03:12:26 -0400 |
commit | 08de2844c626511cfd1db9c36e5e7d126707f780 (patch) | |
tree | 0acfe3150cc5d0eb28c4c242c040c45cec5758af /drivers/scsi/qla2xxx/qla_attr.c | |
parent | 86a9668a8d29ea711613e1cb37efa68e7c4db564 (diff) |
[SCSI] qla2xxx: Add support for ISP82xx to capture dump (minidump) on failure.
Minidump allows us to catpure a snapshot of the firmware/hardware states at the
time of failure for further analysis.
[jejb: added missing #include <linux/vmalloc.h>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> ]
Signed-off-by: Giridhar Malavali <giridhar.malavali@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_attr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 50 |
1 files changed, 42 insertions, 8 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index a31e05f3bfd4..df0002f78805 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -23,11 +23,23 @@ qla2x00_sysfs_read_fw_dump(struct file *filp, struct kobject *kobj, | |||
23 | struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, | 23 | struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, |
24 | struct device, kobj))); | 24 | struct device, kobj))); |
25 | struct qla_hw_data *ha = vha->hw; | 25 | struct qla_hw_data *ha = vha->hw; |
26 | int rval = 0; | ||
26 | 27 | ||
27 | if (ha->fw_dump_reading == 0) | 28 | if (ha->fw_dump_reading == 0) |
28 | return 0; | 29 | return 0; |
29 | 30 | ||
30 | return memory_read_from_buffer(buf, count, &off, ha->fw_dump, | 31 | if (IS_QLA82XX(ha)) { |
32 | if (off < ha->md_template_size) { | ||
33 | rval = memory_read_from_buffer(buf, count, | ||
34 | &off, ha->md_tmplt_hdr, ha->md_template_size); | ||
35 | return rval; | ||
36 | } | ||
37 | off -= ha->md_template_size; | ||
38 | rval = memory_read_from_buffer(buf, count, | ||
39 | &off, ha->md_dump, ha->md_dump_size); | ||
40 | return rval; | ||
41 | } else | ||
42 | return memory_read_from_buffer(buf, count, &off, ha->fw_dump, | ||
31 | ha->fw_dump_len); | 43 | ha->fw_dump_len); |
32 | } | 44 | } |
33 | 45 | ||
@@ -41,12 +53,6 @@ qla2x00_sysfs_write_fw_dump(struct file *filp, struct kobject *kobj, | |||
41 | struct qla_hw_data *ha = vha->hw; | 53 | struct qla_hw_data *ha = vha->hw; |
42 | int reading; | 54 | int reading; |
43 | 55 | ||
44 | if (IS_QLA82XX(ha)) { | ||
45 | ql_dbg(ql_dbg_user, vha, 0x705b, | ||
46 | "Firmware dump not supported for ISP82xx\n"); | ||
47 | return count; | ||
48 | } | ||
49 | |||
50 | if (off != 0) | 56 | if (off != 0) |
51 | return (0); | 57 | return (0); |
52 | 58 | ||
@@ -59,6 +65,10 @@ qla2x00_sysfs_write_fw_dump(struct file *filp, struct kobject *kobj, | |||
59 | ql_log(ql_log_info, vha, 0x705d, | 65 | ql_log(ql_log_info, vha, 0x705d, |
60 | "Firmware dump cleared on (%ld).\n", vha->host_no); | 66 | "Firmware dump cleared on (%ld).\n", vha->host_no); |
61 | 67 | ||
68 | if (IS_QLA82XX(vha->hw)) { | ||
69 | qla82xx_md_free(vha); | ||
70 | qla82xx_md_prep(vha); | ||
71 | } | ||
62 | ha->fw_dump_reading = 0; | 72 | ha->fw_dump_reading = 0; |
63 | ha->fw_dumped = 0; | 73 | ha->fw_dumped = 0; |
64 | break; | 74 | break; |
@@ -75,7 +85,26 @@ qla2x00_sysfs_write_fw_dump(struct file *filp, struct kobject *kobj, | |||
75 | qla2x00_alloc_fw_dump(vha); | 85 | qla2x00_alloc_fw_dump(vha); |
76 | break; | 86 | break; |
77 | case 3: | 87 | case 3: |
78 | qla2x00_system_error(vha); | 88 | if (IS_QLA82XX(ha)) { |
89 | qla82xx_idc_lock(ha); | ||
90 | qla82xx_set_reset_owner(vha); | ||
91 | qla82xx_idc_unlock(ha); | ||
92 | } else | ||
93 | qla2x00_system_error(vha); | ||
94 | break; | ||
95 | case 4: | ||
96 | if (IS_QLA82XX(ha)) { | ||
97 | if (ha->md_tmplt_hdr) | ||
98 | ql_dbg(ql_dbg_user, vha, 0x705b, | ||
99 | "MiniDump supported with this firmware.\n"); | ||
100 | else | ||
101 | ql_dbg(ql_dbg_user, vha, 0x709d, | ||
102 | "MiniDump not supported with this firmware.\n"); | ||
103 | } | ||
104 | break; | ||
105 | case 5: | ||
106 | if (IS_QLA82XX(ha)) | ||
107 | set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); | ||
79 | break; | 108 | break; |
80 | } | 109 | } |
81 | return (count); | 110 | return (count); |
@@ -546,6 +575,11 @@ qla2x00_sysfs_write_reset(struct file *filp, struct kobject *kobj, | |||
546 | 575 | ||
547 | scsi_block_requests(vha->host); | 576 | scsi_block_requests(vha->host); |
548 | set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); | 577 | set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); |
578 | if (IS_QLA82XX(ha)) { | ||
579 | qla82xx_idc_lock(ha); | ||
580 | qla82xx_set_reset_owner(vha); | ||
581 | qla82xx_idc_unlock(ha); | ||
582 | } | ||
549 | qla2xxx_wake_dpc(vha); | 583 | qla2xxx_wake_dpc(vha); |
550 | qla2x00_wait_for_chip_reset(vha); | 584 | qla2x00_wait_for_chip_reset(vha); |
551 | scsi_unblock_requests(vha->host); | 585 | scsi_unblock_requests(vha->host); |