linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Himanshu Madhani <hmadhani@marvell.com>
To: <James.Bottomley@HansenPartnership.com>, <martin.petersen@oracle.com>
Cc: <hmadhani@marvell.com>, <linux-scsi@vger.kernel.org>
Subject: [PATCH v2 12/14] qla2xxx: Capture FW dump on MPI heartbeat stop event
Date: Thu, 12 Sep 2019 11:09:16 -0700	[thread overview]
Message-ID: <20190912180918.6436-13-hmadhani@marvell.com> (raw)
In-Reply-To: <20190912180918.6436-1-hmadhani@marvell.com>

From: Quinn Tran <qutran@marvell.com>

For MPI heartbeat stop Async Event, this patch would capture
MPI FW dump and chip reset. FW will tell which function to
capture FW dump for.

Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
---
 drivers/scsi/qla2xxx/qla_attr.c |  4 +++-
 drivers/scsi/qla2xxx/qla_isr.c  | 31 ++++++++++++++++++++++++++-----
 drivers/scsi/qla2xxx/qla_tmpl.c |  4 +++-
 3 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 8b3015361428..d6b585d303b7 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -102,8 +102,10 @@ qla2x00_sysfs_write_fw_dump(struct file *filp, struct kobject *kobj,
 			qla8044_idc_lock(ha);
 			qla82xx_set_reset_owner(vha);
 			qla8044_idc_unlock(ha);
-		} else
+		} else {
+			ha->fw_dump_mpi = 1;
 			qla2x00_system_error(vha);
+		}
 		break;
 	case 4:
 		if (IS_P3P_TYPE(ha)) {
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 4c26630c1c3e..30fd2d355f3a 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -1227,11 +1227,32 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
 		break;
 
 	case MBA_IDC_AEN:
-		mb[4] = RD_REG_WORD(&reg24->mailbox4);
-		mb[5] = RD_REG_WORD(&reg24->mailbox5);
-		mb[6] = RD_REG_WORD(&reg24->mailbox6);
-		mb[7] = RD_REG_WORD(&reg24->mailbox7);
-		qla83xx_handle_8200_aen(vha, mb);
+		if (IS_QLA27XX(ha) || IS_QLA28XX(ha)) {
+			ha->flags.fw_init_done = 0;
+			ql_log(ql_log_warn, vha, 0xffff,
+			    "MPI Heartbeat stop. Chip reset needed. MB0[%xh] MB1[%xh] MB2[%xh] MB3[%xh]\n",
+			    mb[0], mb[1], mb[2], mb[3]);
+
+			if ((mb[1] & BIT_8) ||
+			    (mb[2] & BIT_8)) {
+				ql_log(ql_log_warn, vha, 0xd013,
+				    "MPI Heartbeat stop. FW dump needed\n");
+				ha->fw_dump_mpi = 1;
+				ha->isp_ops->fw_dump(vha, 1);
+			}
+			set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
+			qla2xxx_wake_dpc(vha);
+		} else if (IS_QLA83XX(ha)) {
+			mb[4] = RD_REG_WORD(&reg24->mailbox4);
+			mb[5] = RD_REG_WORD(&reg24->mailbox5);
+			mb[6] = RD_REG_WORD(&reg24->mailbox6);
+			mb[7] = RD_REG_WORD(&reg24->mailbox7);
+			qla83xx_handle_8200_aen(vha, mb);
+		} else {
+			ql_dbg(ql_dbg_async, vha, 0x5052,
+			    "skip Heartbeat processing mb0-3=[0x%04x] [0x%04x] [0x%04x] [0x%04x]\n",
+			    mb[0], mb[1], mb[2], mb[3]);
+		}
 		break;
 
 	case MBA_DPORT_DIAGNOSTICS:
diff --git a/drivers/scsi/qla2xxx/qla_tmpl.c b/drivers/scsi/qla2xxx/qla_tmpl.c
index b948d94c8b3c..5b0c057def2b 100644
--- a/drivers/scsi/qla2xxx/qla_tmpl.c
+++ b/drivers/scsi/qla2xxx/qla_tmpl.c
@@ -1017,8 +1017,9 @@ qla27xx_fwdump(scsi_qla_host_t *vha, int hardware_locked)
 		uint j;
 		ulong len;
 		void *buf = vha->hw->fw_dump;
+		uint count = vha->hw->fw_dump_mpi ? 2 : 1;
 
-		for (j = 0; j < 2; j++, fwdt++, buf += len) {
+		for (j = 0; j < count; j++, fwdt++, buf += len) {
 			ql_log(ql_log_warn, vha, 0xd011,
 			    "-> fwdt%u running...\n", j);
 			if (!fwdt->template) {
@@ -1046,6 +1047,7 @@ qla27xx_fwdump(scsi_qla_host_t *vha, int hardware_locked)
 	}
 
 bailout:
+	vha->hw->fw_dump_mpi = 0;
 #ifndef __CHECKER__
 	if (!hardware_locked)
 		spin_unlock_irqrestore(&vha->hw->hardware_lock, flags);
-- 
2.12.0


  parent reply	other threads:[~2019-09-12 18:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12 18:09 [PATCH v2 00/14] qla2xxx: Bug fixes for the driver Himanshu Madhani
2019-09-12 18:09 ` [PATCH v2 01/14] qla2xxx: Silence fwdump template message Himanshu Madhani
2019-09-12 18:09 ` [PATCH v2 02/14] qla2xxx: Fix unbound sleep in fcport delete path Himanshu Madhani
2019-09-30 15:54   ` Bart Van Assche
2019-09-12 18:09 ` [PATCH v2 03/14] qla2xxx: Fix stale mem access on driver unload Himanshu Madhani
2019-09-12 18:09 ` [PATCH v2 04/14] qla2xxx: Optimize NPIV tear down process Himanshu Madhani
2019-09-26 10:52   ` Martin Wilck
2019-09-26 16:56     ` [EXT] " Quinn Tran
2019-09-27  6:33       ` Martin Wilck
2019-09-12 18:09 ` [PATCH v2 05/14] qla2xxx: Fix N2N link reset Himanshu Madhani
2019-09-12 18:09 ` [PATCH v2 06/14] qla2xxx: Fix N2N link up fail Himanshu Madhani
2019-09-12 18:09 ` [PATCH v2 07/14] qla2xxx: Fix Nport ID display value Himanshu Madhani
2019-09-13 22:32   ` Roman Bolshakov
2019-09-12 18:09 ` [PATCH v2 08/14] qla2xxx: Dual FCP-NVMe target port support Himanshu Madhani
2019-10-10  2:27   ` Martin K. Petersen
2019-09-12 18:09 ` [PATCH v2 09/14] qla2xxx: Add error handling for PLOGI ELS passthrough Himanshu Madhani
2019-09-12 18:09 ` [PATCH v2 10/14] qla2xxx: Set remove flag for all VP Himanshu Madhani
2019-09-12 18:09 ` [PATCH v2 11/14] qla2xxx: Check for MB timeout while capturing ISP27/28xx FW dump Himanshu Madhani
2019-09-12 20:22   ` Laurence Oberman
2019-09-12 18:09 ` Himanshu Madhani [this message]
2019-09-12 20:22   ` [PATCH v2 12/14] qla2xxx: Capture FW dump on MPI heartbeat stop event Laurence Oberman
2019-09-12 18:09 ` [PATCH v2 13/14] qla2xxx: Improve logging for scan thread Himanshu Madhani
2019-09-12 18:09 ` [PATCH v2 14/14] qla2xxx: Update driver version to 10.01.00.20-k Himanshu Madhani
2019-09-24  3:13 ` [PATCH v2 00/14] qla2xxx: Bug fixes for the driver Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190912180918.6436-13-hmadhani@marvell.com \
    --to=hmadhani@marvell.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).