aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla4xxx
diff options
context:
space:
mode:
authorNilesh Javali <nilesh.javali@qlogic.com>2013-01-20 23:50:58 -0500
committerJames Bottomley <JBottomley@Parallels.com>2013-01-29 21:40:23 -0500
commit026fbd3aaae796d2457898497374b68f3477ee2f (patch)
tree5455f7c1ba85c1a67c94a0f1b0a1763a8ad89b35 /drivers/scsi/qla4xxx
parent9cb33f184e5d57054caf24c2bd657517e557367c (diff)
[SCSI] qla4xxx: Quiesce driver activities while loopback
Quiesce all different activities performed by driver upon the link events while loopback diagnostics is in progress. Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla4xxx')
-rw-r--r--drivers/scsi/qla4xxx/ql4_def.h4
-rw-r--r--drivers/scsi/qla4xxx/ql4_fw.h4
-rw-r--r--drivers/scsi/qla4xxx/ql4_isr.c36
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c4
4 files changed, 45 insertions, 3 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index c71a371c452b..8f4193766663 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -501,6 +501,7 @@ struct scsi_qla_host {
501#define AF_INTERRUPTS_ON 6 /* 0x00000040 */ 501#define AF_INTERRUPTS_ON 6 /* 0x00000040 */
502#define AF_GET_CRASH_RECORD 7 /* 0x00000080 */ 502#define AF_GET_CRASH_RECORD 7 /* 0x00000080 */
503#define AF_LINK_UP 8 /* 0x00000100 */ 503#define AF_LINK_UP 8 /* 0x00000100 */
504#define AF_LOOPBACK 9 /* 0x00000200 */
504#define AF_IRQ_ATTACHED 10 /* 0x00000400 */ 505#define AF_IRQ_ATTACHED 10 /* 0x00000400 */
505#define AF_DISABLE_ACB_COMPLETE 11 /* 0x00000800 */ 506#define AF_DISABLE_ACB_COMPLETE 11 /* 0x00000800 */
506#define AF_HA_REMOVAL 12 /* 0x00001000 */ 507#define AF_HA_REMOVAL 12 /* 0x00001000 */
@@ -840,7 +841,8 @@ static inline int is_aer_supported(struct scsi_qla_host *ha)
840static inline int adapter_up(struct scsi_qla_host *ha) 841static inline int adapter_up(struct scsi_qla_host *ha)
841{ 842{
842 return (test_bit(AF_ONLINE, &ha->flags) != 0) && 843 return (test_bit(AF_ONLINE, &ha->flags) != 0) &&
843 (test_bit(AF_LINK_UP, &ha->flags) != 0); 844 (test_bit(AF_LINK_UP, &ha->flags) != 0) &&
845 (!test_bit(AF_LOOPBACK, &ha->flags));
844} 846}
845 847
846static inline struct scsi_qla_host* to_qla_host(struct Scsi_Host *shost) 848static inline struct scsi_qla_host* to_qla_host(struct Scsi_Host *shost)
diff --git a/drivers/scsi/qla4xxx/ql4_fw.h b/drivers/scsi/qla4xxx/ql4_fw.h
index 6ee18a947d55..ad9d2e2d370f 100644
--- a/drivers/scsi/qla4xxx/ql4_fw.h
+++ b/drivers/scsi/qla4xxx/ql4_fw.h
@@ -522,6 +522,10 @@ struct qla_flt_region {
522#define FLASH_OPT_COMMIT 2 522#define FLASH_OPT_COMMIT 2
523#define FLASH_OPT_RMW_COMMIT 3 523#define FLASH_OPT_RMW_COMMIT 3
524 524
525/* Loopback type */
526#define ENABLE_INTERNAL_LOOPBACK 0x04
527#define ENABLE_EXTERNAL_LOOPBACK 0x08
528
525/*************************************************************************/ 529/*************************************************************************/
526 530
527/* Host Adapter Initialization Control Block (from host) */ 531/* Host Adapter Initialization Control Block (from host) */
diff --git a/drivers/scsi/qla4xxx/ql4_isr.c b/drivers/scsi/qla4xxx/ql4_isr.c
index 81909d949905..1b83dc283d2e 100644
--- a/drivers/scsi/qla4xxx/ql4_isr.c
+++ b/drivers/scsi/qla4xxx/ql4_isr.c
@@ -582,6 +582,33 @@ exit_prq_error:
582} 582}
583 583
584/** 584/**
585 * qla4_83xx_loopback_in_progress: Is loopback in progress?
586 * @ha: Pointer to host adapter structure.
587 * @ret: 1 = loopback in progress, 0 = loopback not in progress
588 **/
589static int qla4_83xx_loopback_in_progress(struct scsi_qla_host *ha)
590{
591 int rval = 1;
592
593 if (is_qla8032(ha)) {
594 if ((ha->idc_info.info2 & ENABLE_INTERNAL_LOOPBACK) ||
595 (ha->idc_info.info2 & ENABLE_EXTERNAL_LOOPBACK)) {
596 DEBUG2(ql4_printk(KERN_INFO, ha,
597 "%s: Loopback diagnostics in progress\n",
598 __func__));
599 rval = 1;
600 } else {
601 DEBUG2(ql4_printk(KERN_INFO, ha,
602 "%s: Loopback diagnostics not in progress\n",
603 __func__));
604 rval = 0;
605 }
606 }
607
608 return rval;
609}
610
611/**
585 * qla4xxx_isr_decode_mailbox - decodes mailbox status 612 * qla4xxx_isr_decode_mailbox - decodes mailbox status
586 * @ha: Pointer to host adapter structure. 613 * @ha: Pointer to host adapter structure.
587 * @mailbox_status: Mailbox status. 614 * @mailbox_status: Mailbox status.
@@ -676,8 +703,10 @@ static void qla4xxx_isr_decode_mailbox(struct scsi_qla_host * ha,
676 703
677 case MBOX_ASTS_LINK_DOWN: 704 case MBOX_ASTS_LINK_DOWN:
678 clear_bit(AF_LINK_UP, &ha->flags); 705 clear_bit(AF_LINK_UP, &ha->flags);
679 if (test_bit(AF_INIT_DONE, &ha->flags)) 706 if (test_bit(AF_INIT_DONE, &ha->flags)) {
680 set_bit(DPC_LINK_CHANGED, &ha->dpc_flags); 707 set_bit(DPC_LINK_CHANGED, &ha->dpc_flags);
708 qla4xxx_wake_dpc(ha);
709 }
681 710
682 ql4_printk(KERN_INFO, ha, "%s: LINK DOWN\n", __func__); 711 ql4_printk(KERN_INFO, ha, "%s: LINK DOWN\n", __func__);
683 qla4xxx_post_aen_work(ha, ISCSI_EVENT_LINKDOWN, 712 qla4xxx_post_aen_work(ha, ISCSI_EVENT_LINKDOWN,
@@ -840,6 +869,11 @@ static void qla4xxx_isr_decode_mailbox(struct scsi_qla_host * ha,
840 DEBUG2(ql4_printk(KERN_INFO, ha, 869 DEBUG2(ql4_printk(KERN_INFO, ha,
841 "scsi:%ld: AEN %04x IDC Complete notification\n", 870 "scsi:%ld: AEN %04x IDC Complete notification\n",
842 ha->host_no, mbox_sts[0])); 871 ha->host_no, mbox_sts[0]));
872
873 if (qla4_83xx_loopback_in_progress(ha))
874 set_bit(AF_LOOPBACK, &ha->flags);
875 else
876 clear_bit(AF_LOOPBACK, &ha->flags);
843 } 877 }
844 break; 878 break;
845 879
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 60526bb469d3..1df13872ef9d 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -2242,6 +2242,7 @@ static int qla4xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
2242 test_bit(DPC_HA_NEED_QUIESCENT, &ha->dpc_flags) || 2242 test_bit(DPC_HA_NEED_QUIESCENT, &ha->dpc_flags) ||
2243 !test_bit(AF_ONLINE, &ha->flags) || 2243 !test_bit(AF_ONLINE, &ha->flags) ||
2244 !test_bit(AF_LINK_UP, &ha->flags) || 2244 !test_bit(AF_LINK_UP, &ha->flags) ||
2245 test_bit(AF_LOOPBACK, &ha->flags) ||
2245 test_bit(DPC_RESET_HA_FW_CONTEXT, &ha->dpc_flags)) 2246 test_bit(DPC_RESET_HA_FW_CONTEXT, &ha->dpc_flags))
2246 goto qc_host_busy; 2247 goto qc_host_busy;
2247 2248
@@ -3480,7 +3481,8 @@ dpc_post_reset_ha:
3480 } 3481 }
3481 3482
3482 /* ---- link change? --- */ 3483 /* ---- link change? --- */
3483 if (test_and_clear_bit(DPC_LINK_CHANGED, &ha->dpc_flags)) { 3484 if (!test_bit(AF_LOOPBACK, &ha->flags) &&
3485 test_and_clear_bit(DPC_LINK_CHANGED, &ha->dpc_flags)) {
3484 if (!test_bit(AF_LINK_UP, &ha->flags)) { 3486 if (!test_bit(AF_LINK_UP, &ha->flags)) {
3485 /* ---- link down? --- */ 3487 /* ---- link down? --- */
3486 qla4xxx_mark_all_devices_missing(ha); 3488 qla4xxx_mark_all_devices_missing(ha);