From patchwork Wed Dec 20 06:56:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10125101 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0973E6057F for ; Wed, 20 Dec 2017 06:57:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 013FE29649 for ; Wed, 20 Dec 2017 06:57:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA5822964F; Wed, 20 Dec 2017 06:57:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 745032964E for ; Wed, 20 Dec 2017 06:57:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932537AbdLTG5t (ORCPT ); Wed, 20 Dec 2017 01:57:49 -0500 Received: from mail-bn3nam01on0048.outbound.protection.outlook.com ([104.47.33.48]:26719 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932386AbdLTG5W (ORCPT ); Wed, 20 Dec 2017 01:57:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=qeAQDHm/wlKGvQYA4I/EQDThwOKDUmHbkNAGQFDE/nE=; b=kxloUsBSPDd9d+ibohlmukJ84rdLaSu9sTPOBmUpKc1YdRsNCjD4fa6BthKRkc76fgyfUqCESz0+44PleQPcr4Meq9ewMLq7V7xPM//KAP3liS0bGE754D4tnxVO3s8X030HlrNXUr6i6AyZ+1qECogovJsHRUKg2aI9p7t4a/Y= Received: from CO2PR07CA0067.namprd07.prod.outlook.com (10.174.192.35) by CY1PR0701MB1945.namprd07.prod.outlook.com (10.163.141.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.14; Wed, 20 Dec 2017 06:57:20 +0000 Received: from BN1AFFO11FD043.protection.gbl (2a01:111:f400:7c10::176) by CO2PR07CA0067.outlook.office365.com (2603:10b6:100::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.323.15 via Frontend Transport; Wed, 20 Dec 2017 06:57:20 +0000 Received-SPF: PermError (protection.outlook.com: domain of cavium.com used an invalid SPF mechanism) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1AFFO11FD043.mail.protection.outlook.com (10.58.52.190) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.302.6 via Frontend Transport; Wed, 20 Dec 2017 06:57:07 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 19 Dec 2017 22:56:50 -0800 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 vBK6upfG021666; Tue, 19 Dec 2017 22:56:51 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id vBK6uppX021665; Tue, 19 Dec 2017 22:56:51 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 30/43] qla2xxx: Properly extract ADISC error codes Date: Tue, 19 Dec 2017 22:56:31 -0800 Message-ID: <20171220065644.21511-31-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171220065644.21511-1-himanshu.madhani@cavium.com> References: <20171220065644.21511-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(376002)(396003)(39860400002)(346002)(39380400002)(2980300002)(448002)(189003)(199004)(42186006)(16586007)(81156014)(72206003)(81166006)(110136005)(54906003)(8676002)(356003)(316002)(87636003)(2906002)(51416003)(48376002)(5660300001)(76176011)(50466002)(2950100002)(6666003)(1076002)(50226002)(8936002)(106466001)(4326008)(80596001)(69596002)(478600001)(85326001)(36756003)(305945005)(86362001)(575784001)(59450400001)(47776003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1945; H:CAEXCH02.caveonetworks.com; FPR:; SPF:PermError; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD043; 1:kxFoY6Qn69bxnhd+Wvs5HxWX5738n1+y9MR61WhJryhmSf0kqZUXrOfG8T/fx79kimDvJhGj/Tkz3X0d1qCJ2zZzJfVIr72eke44YBBYIwMaRnv43W7ANH18vPEi9/ca X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 05a859f3-7af3-4040-c9ca-08d54776e275 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307)(7153060); SRVR:CY1PR0701MB1945; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1945; 3:qUnR95XteSrSrYbEcjRUcqWZYcp/dQhDLPifYLioFrKPzxroyMKNlmt4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SDc67+T8n2QImwSHto7CK6nkLF/tDMVoL/KUWCMuc5IzzbUFK+b0Oy80YpL5SxcYFq5OZUPE11+aikaPXeO97Kf75ndIgL84yDJM5JhKsH2bsm4OKHiV6Q73ZN9R1bE2Cz1dz9UbalFv7Ttj783R9nEvzzs0DsOpp1wSQQNfPrcBy3LjDIMoSBXpRhHAnB+EGInYRmOq9B9mNjBZosYyIvchbCBWWqtxUeBjJMjJbVCHTgoEFd2ARlQpZs4AjtATgv/vEiBWXVmc8wjQAeqfuK0nVsfhUzdqqlps+vBDMpq4iv8n/c3MC49BXFiAMye9VxnYdY+6/kJxZWfUzgFWart4NUi3CeX771OYE9LenkDo0F6IeDPf2veKqJVwQ2SsNoKp2Z+4vypUxfjVe X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231023)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:CY1PR0701MB1945; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY1PR0701MB1945; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1945; 4:FpS3wk7Y3nw9s22i/cZO7T+QsRzUR16Frnegl3ECjhObMdlyeTHUQiyXJQmyRIGoNp2W/uO3gv1X9TFz6LSbT18nRC9qEaJzlcpWHZgY1AqQZ7qKSr5VWBkQgs1FM4I8YQRfxpjriyDQ4M1NGjSYZuro8bjDNlNw2eqtGSgB3TxD6IcsdoKeUFWdl2vC73kpgW49MOy3M+nEBS/aCv9zflYyvscdwlRn9Nd9tf5HwoMjG+u8H+BI/rG36haH0ClY6hPPUVz800iMMCWsaypbAg== X-Forefront-PRVS: 0527DFA348 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1945; 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HnHZvu5mrHkPaWEY70irQJmg0ZJYfSKN4o7EGW9u4YB46CTJ7prEzLC2goDZ+WZoPe7NbPX+OLJayiIuUhOXKHrHHM3tpd3YvIriRIGKGadhxchErH14Z/08eIFmay/Xg1rXhtuX5bjMz7QTAxGCNK+bNdsssWavLBP+lL/ppEyWIImpJ42e2ufvdJLQtUXkI0x7MPGTKJoojBgpiCqgPDTxiTPVNP0g SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2017 06:57:07.0444 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 05a859f3-7af3-4040-c9ca-08d54776e275 X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1945 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Quinn Tran This patch fixes issue with extraction of ADISC error codes for decoding the error returned Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index e58faa1e984c..bd28a0e6a95c 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -338,16 +338,21 @@ qla2x00_async_prlo(struct scsi_qla_host *vha, fc_port_t *fcport) static void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea) { - if (ea->rc) { + struct fc_port *fcport = ea->fcport; + + ql_dbg(ql_dbg_disc, vha, 0x20d2, + "%s %8phC DS %d LS %d rc %d login %d|%d rscn %d|%d lid %d\n", + __func__, fcport->port_name, fcport->disc_state, + fcport->fw_login_state, ea->rc, fcport->login_gen, ea->sp->gen2, + fcport->rscn_gen, ea->sp->gen1, fcport->loop_id); + + if (ea->data[0] != MBS_COMMAND_COMPLETE) { ql_dbg(ql_dbg_disc, vha, 0x2066, "%s %8phC: adisc fail: post delete\n", __func__, ea->fcport->port_name); qlt_schedule_sess_for_deletion(ea->fcport, 1); return; } - ql_dbg(ql_dbg_disc, vha, 0x20d2, - "%s %8phC DS %d LS %d\n", __func__, ea->fcport->port_name, - ea->fcport->disc_state, ea->fcport->fw_login_state); if (ea->fcport->disc_state == DSC_DELETE_PEND) return; @@ -355,10 +360,8 @@ void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea) if (ea->sp->gen2 != ea->fcport->login_gen) { /* target side must have changed it. */ ql_dbg(ql_dbg_disc, vha, 0x20d3, - "%s %8phC generation changed rscn %d|%d login %d|%d\n", - __func__, ea->fcport->port_name, ea->fcport->last_rscn_gen, - ea->fcport->rscn_gen, ea->fcport->last_login_gen, - ea->fcport->login_gen); + "%s %8phC generation changed\n", + __func__, ea->fcport->port_name); return; } else if (ea->sp->gen1 != ea->fcport->rscn_gen) { ql_dbg(ql_dbg_disc, vha, 0x20d4, "%s %d %8phC post gidpn\n", @@ -376,6 +379,7 @@ qla2x00_async_adisc_sp_done(void *ptr, int res) srb_t *sp = ptr; struct scsi_qla_host *vha = sp->vha; struct event_arg ea; + struct srb_iocb *lio = &sp->u.iocb_cmd; ql_dbg(ql_dbg_disc, vha, 0x2066, "Async done-%s res %x %8phC\n", @@ -384,6 +388,10 @@ qla2x00_async_adisc_sp_done(void *ptr, int res) memset(&ea, 0, sizeof(ea)); ea.event = FCME_ADISC_DONE; ea.rc = res; + ea.data[0] = lio->u.logio.data[0]; + ea.data[1] = lio->u.logio.data[1]; + ea.iop[0] = lio->u.logio.iop[0]; + ea.iop[1] = lio->u.logio.iop[1]; ea.fcport = sp->fcport; ea.sp = sp;