diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_dbg.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_dbg.c | 78 |
1 files changed, 23 insertions, 55 deletions
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index cca8e4ab0372..cb2eca4c26d8 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c | |||
@@ -377,6 +377,24 @@ qla25xx_copy_mq(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain) | |||
377 | return ptr + sizeof(struct qla2xxx_mq_chain); | 377 | return ptr + sizeof(struct qla2xxx_mq_chain); |
378 | } | 378 | } |
379 | 379 | ||
380 | static void | ||
381 | qla2xxx_dump_post_process(scsi_qla_host_t *vha, int rval) | ||
382 | { | ||
383 | struct qla_hw_data *ha = vha->hw; | ||
384 | |||
385 | if (rval != QLA_SUCCESS) { | ||
386 | qla_printk(KERN_WARNING, ha, | ||
387 | "Failed to dump firmware (%x)!!!\n", rval); | ||
388 | ha->fw_dumped = 0; | ||
389 | } else { | ||
390 | qla_printk(KERN_INFO, ha, | ||
391 | "Firmware dump saved to temp buffer (%ld/%p).\n", | ||
392 | vha->host_no, ha->fw_dump); | ||
393 | ha->fw_dumped = 1; | ||
394 | qla2x00_post_uevent_work(vha, QLA_UEVENT_CODE_FW_DUMP); | ||
395 | } | ||
396 | } | ||
397 | |||
380 | /** | 398 | /** |
381 | * qla2300_fw_dump() - Dumps binary data from the 2300 firmware. | 399 | * qla2300_fw_dump() - Dumps binary data from the 2300 firmware. |
382 | * @ha: HA context | 400 | * @ha: HA context |
@@ -530,17 +548,7 @@ qla2300_fw_dump(scsi_qla_host_t *vha, int hardware_locked) | |||
530 | if (rval == QLA_SUCCESS) | 548 | if (rval == QLA_SUCCESS) |
531 | qla2xxx_copy_queues(ha, nxt); | 549 | qla2xxx_copy_queues(ha, nxt); |
532 | 550 | ||
533 | if (rval != QLA_SUCCESS) { | 551 | qla2xxx_dump_post_process(base_vha, rval); |
534 | qla_printk(KERN_WARNING, ha, | ||
535 | "Failed to dump firmware (%x)!!!\n", rval); | ||
536 | ha->fw_dumped = 0; | ||
537 | |||
538 | } else { | ||
539 | qla_printk(KERN_INFO, ha, | ||
540 | "Firmware dump saved to temp buffer (%ld/%p).\n", | ||
541 | base_vha->host_no, ha->fw_dump); | ||
542 | ha->fw_dumped = 1; | ||
543 | } | ||
544 | 552 | ||
545 | qla2300_fw_dump_failed: | 553 | qla2300_fw_dump_failed: |
546 | if (!hardware_locked) | 554 | if (!hardware_locked) |
@@ -737,17 +745,7 @@ qla2100_fw_dump(scsi_qla_host_t *vha, int hardware_locked) | |||
737 | if (rval == QLA_SUCCESS) | 745 | if (rval == QLA_SUCCESS) |
738 | qla2xxx_copy_queues(ha, &fw->risc_ram[cnt]); | 746 | qla2xxx_copy_queues(ha, &fw->risc_ram[cnt]); |
739 | 747 | ||
740 | if (rval != QLA_SUCCESS) { | 748 | qla2xxx_dump_post_process(base_vha, rval); |
741 | qla_printk(KERN_WARNING, ha, | ||
742 | "Failed to dump firmware (%x)!!!\n", rval); | ||
743 | ha->fw_dumped = 0; | ||
744 | |||
745 | } else { | ||
746 | qla_printk(KERN_INFO, ha, | ||
747 | "Firmware dump saved to temp buffer (%ld/%p).\n", | ||
748 | base_vha->host_no, ha->fw_dump); | ||
749 | ha->fw_dumped = 1; | ||
750 | } | ||
751 | 749 | ||
752 | qla2100_fw_dump_failed: | 750 | qla2100_fw_dump_failed: |
753 | if (!hardware_locked) | 751 | if (!hardware_locked) |
@@ -984,17 +982,7 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) | |||
984 | qla24xx_copy_eft(ha, nxt); | 982 | qla24xx_copy_eft(ha, nxt); |
985 | 983 | ||
986 | qla24xx_fw_dump_failed_0: | 984 | qla24xx_fw_dump_failed_0: |
987 | if (rval != QLA_SUCCESS) { | 985 | qla2xxx_dump_post_process(base_vha, rval); |
988 | qla_printk(KERN_WARNING, ha, | ||
989 | "Failed to dump firmware (%x)!!!\n", rval); | ||
990 | ha->fw_dumped = 0; | ||
991 | |||
992 | } else { | ||
993 | qla_printk(KERN_INFO, ha, | ||
994 | "Firmware dump saved to temp buffer (%ld/%p).\n", | ||
995 | base_vha->host_no, ha->fw_dump); | ||
996 | ha->fw_dumped = 1; | ||
997 | } | ||
998 | 986 | ||
999 | qla24xx_fw_dump_failed: | 987 | qla24xx_fw_dump_failed: |
1000 | if (!hardware_locked) | 988 | if (!hardware_locked) |
@@ -1305,17 +1293,7 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) | |||
1305 | } | 1293 | } |
1306 | 1294 | ||
1307 | qla25xx_fw_dump_failed_0: | 1295 | qla25xx_fw_dump_failed_0: |
1308 | if (rval != QLA_SUCCESS) { | 1296 | qla2xxx_dump_post_process(base_vha, rval); |
1309 | qla_printk(KERN_WARNING, ha, | ||
1310 | "Failed to dump firmware (%x)!!!\n", rval); | ||
1311 | ha->fw_dumped = 0; | ||
1312 | |||
1313 | } else { | ||
1314 | qla_printk(KERN_INFO, ha, | ||
1315 | "Firmware dump saved to temp buffer (%ld/%p).\n", | ||
1316 | base_vha->host_no, ha->fw_dump); | ||
1317 | ha->fw_dumped = 1; | ||
1318 | } | ||
1319 | 1297 | ||
1320 | qla25xx_fw_dump_failed: | 1298 | qla25xx_fw_dump_failed: |
1321 | if (!hardware_locked) | 1299 | if (!hardware_locked) |
@@ -1628,17 +1606,7 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) | |||
1628 | } | 1606 | } |
1629 | 1607 | ||
1630 | qla81xx_fw_dump_failed_0: | 1608 | qla81xx_fw_dump_failed_0: |
1631 | if (rval != QLA_SUCCESS) { | 1609 | qla2xxx_dump_post_process(base_vha, rval); |
1632 | qla_printk(KERN_WARNING, ha, | ||
1633 | "Failed to dump firmware (%x)!!!\n", rval); | ||
1634 | ha->fw_dumped = 0; | ||
1635 | |||
1636 | } else { | ||
1637 | qla_printk(KERN_INFO, ha, | ||
1638 | "Firmware dump saved to temp buffer (%ld/%p).\n", | ||
1639 | base_vha->host_no, ha->fw_dump); | ||
1640 | ha->fw_dumped = 1; | ||
1641 | } | ||
1642 | 1610 | ||
1643 | qla81xx_fw_dump_failed: | 1611 | qla81xx_fw_dump_failed: |
1644 | if (!hardware_locked) | 1612 | if (!hardware_locked) |