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 06/14] qla2xxx: Add D-Port Diagnostic reason explanation logs
Date: Tue, 17 Dec 2019 14:06:09 -0800	[thread overview]
Message-ID: <20191217220617.28084-7-hmadhani@marvell.com> (raw)
In-Reply-To: <20191217220617.28084-1-hmadhani@marvell.com>

From: Joe Carnuccio <joe.carnuccio@cavium.com>

This patch adds more details when D-Port diag async event
is generated by the firmware.

Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
---
 drivers/scsi/qla2xxx/qla_isr.c | 32 +++++++++++++++++++++++++++-----
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index f60fb9c19c26..8fadc8673f11 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -1252,11 +1252,33 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
 
 	case MBA_DPORT_DIAGNOSTICS:
 		ql_dbg(ql_dbg_async, vha, 0x5052,
-		    "D-Port Diagnostics: %04x result=%s\n",
-		    mb[0],
-		    mb[1] == 0 ? "start" :
-		    mb[1] == 1 ? "done (pass)" :
-		    mb[1] == 2 ? "done (error)" : "other");
+		    "D-Port Diagnostics: %04x %04x %04x %04x\n",
+		    mb[0], mb[1], mb[2], mb[3]);
+		if (IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha)) {
+			static char *results[] = {
+			    "start", "done(pass)", "done(error)", "undefined" };
+			static char *types[] = {
+			    "none", "dynamic", "static", "other" };
+			uint result = mb[1] >> 0 & 0x3;
+			uint type = mb[1] >> 6 & 0x3;
+			uint sw = mb[1] >> 15 & 0x1;
+			ql_dbg(ql_dbg_async, vha, 0x5052,
+			    "D-Port Diagnostics: result=%s type=%s [sw=%u]\n",
+			    results[result], types[type], sw);
+			if (result == 2) {
+				static char *reasons[] = {
+				    "reserved", "unexpected reject",
+				    "unexpected phase", "retry exceeded",
+				    "timed out", "not supported",
+				    "user stopped" };
+				uint reason = mb[2] >> 0 & 0xf;
+				uint phase = mb[2] >> 12 & 0xf;
+				ql_dbg(ql_dbg_async, vha, 0x5052,
+				    "D-Port Diagnostics: reason=%s phase=%u \n",
+				    reason < 7 ? reasons[reason] : "other",
+				    phase >> 1);
+			}
+		}
 		break;
 
 	case MBA_TEMPERATURE_ALERT:
-- 
2.12.0


  parent reply	other threads:[~2019-12-17 22:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-17 22:06 [PATCH 00/14] qla2xxx: Fixes for the driver Himanshu Madhani
2019-12-17 22:06 ` [PATCH 01/14] qla2xxx: Remove defer flag to indicate immeadiate port loss Himanshu Madhani
2019-12-17 22:06 ` [PATCH 02/14] qla2xxx: Fix fabric scan hang Himanshu Madhani
2019-12-17 22:06 ` [PATCH 03/14] qla2xxx: Add a shadow variable to hold disc_state history of fcport Himanshu Madhani
2019-12-17 22:06 ` [PATCH 04/14] qla2xxx: Cleanup unused async_logout_done Himanshu Madhani
2019-12-17 22:06 ` [PATCH 05/14] qla2xxx: Fix update_fcport for current_topology Himanshu Madhani
2019-12-17 22:06 ` Himanshu Madhani [this message]
2019-12-17 22:06 ` [PATCH 07/14] qla2xxx: Use common routine to free fcport struct Himanshu Madhani
2019-12-17 22:06 ` [PATCH 08/14] qla2xxx: Fix stuck login session using prli_pend_timer Himanshu Madhani
2019-12-17 22:06 ` [PATCH 09/14] qla2xxx: Correct fcport flags handling Himanshu Madhani
2019-12-17 22:06 ` [PATCH 10/14] qla2xxx: Consolidate fabric scan Himanshu Madhani
2019-12-17 22:06 ` [PATCH 11/14] qla2xxx: Fix RIDA Format-2 Himanshu Madhani
2019-12-17 22:06 ` [PATCH 12/14] qla2xxx: Fix stuck session in GNL Himanshu Madhani
2019-12-17 22:06 ` [PATCH 13/14] qla2xxx: Fix mtcp dump collection failure Himanshu Madhani
2019-12-17 22:06 ` [PATCH 14/14] qla2xxx: Update driver version to 10.01.00.22-k Himanshu Madhani
2019-12-20  3:36 ` [PATCH 00/14] qla2xxx: 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=20191217220617.28084-7-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).