From patchwork Tue Dec 17 22:06:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 11298791 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D2C1C14D5 for ; Tue, 17 Dec 2019 22:06:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B184E21775 for ; Tue, 17 Dec 2019 22:06:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="AoxNY6Aw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725946AbfLQWGs (ORCPT ); Tue, 17 Dec 2019 17:06:48 -0500 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:27720 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725870AbfLQWGs (ORCPT ); Tue, 17 Dec 2019 17:06:48 -0500 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xBHM57Tt027771; Tue, 17 Dec 2019 14:06:47 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0818; bh=cWRdsdD8teclkJqCLNR/C4AKCpk6+BGjSQbcEfUKPbc=; b=AoxNY6AwP/6v7HDRYjApdo7pA/xB2Ywg71STpBEOReblb1jbd2ueZPHZJUi49Uwpjq+W XwHNoiG1AavRcWy3Ax0FuM+tsBz24H2suiEAMjtWO9pDxrY4GqGFfA0744mwFsXVPbE6 nNRJt6SfXyv+nGNCMvvxBB95qWjAHUnVcbbAJhx7O9E8KpBOQsr/C4CrAIGMDH5DQQRb WP51b4qwRCCzjzSBjBSTK/MTceW4p3RIYjR/jf6XxLzxt1NrpM0YHYhwLU0N2BApF0BA 3rSTPs1EjL0mZXnABUDR1fz9AFY5R6GPrliq4lwo5s6zcfjq3UjwPL+7N9aQwYTA/LIH EQ== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2wxneav08d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 17 Dec 2019 14:06:46 -0800 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 17 Dec 2019 14:06:34 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 17 Dec 2019 14:06:34 -0800 Received: from dut1171.mv.qlogic.com (unknown [10.112.88.18]) by maili.marvell.com (Postfix) with ESMTP id 95C3E3F7043; Tue, 17 Dec 2019 14:06:34 -0800 (PST) Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id xBHM6YDr028151; Tue, 17 Dec 2019 14:06:34 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id xBHM6Yak028150; Tue, 17 Dec 2019 14:06:34 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 06/14] qla2xxx: Add D-Port Diagnostic reason explanation logs Date: Tue, 17 Dec 2019 14:06:09 -0800 Message-ID: <20191217220617.28084-7-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20191217220617.28084-1-hmadhani@marvell.com> References: <20191217220617.28084-1-hmadhani@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-17_04:2019-12-17,2019-12-17 signatures=0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Joe Carnuccio This patch adds more details when D-Port diag async event is generated by the firmware. Signed-off-by: Joe Carnuccio Signed-off-by: Himanshu Madhani --- 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: