From patchwork Thu Dec 28 20:33:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10135889 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 53A8260318 for ; Thu, 28 Dec 2017 20:34:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4627A2B1F6 for ; Thu, 28 Dec 2017 20:34:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B2C02C0FA; Thu, 28 Dec 2017 20:34:40 +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 1B3342B1F6 for ; Thu, 28 Dec 2017 20:34:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754907AbdL1Ueh (ORCPT ); Thu, 28 Dec 2017 15:34:37 -0500 Received: from mail-bl2nam02on0042.outbound.protection.outlook.com ([104.47.38.42]:9816 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754134AbdL1UeU (ORCPT ); Thu, 28 Dec 2017 15:34:20 -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=Nrl8EbvzmPKrZ3rgPH3tlggtCz1LBWs4FUltZ7+tH/U=; b=M/pGP95z4UpLAd65GRNT5c5fjUqLrKhD59PCWwXeSA0hVahJV/2GgoVhFQKrA1EYlE6zlWxF34BmEtb491QaC+DjhrTj3UVjwQnk0tZZbxRkHVVJMYJ5Y72XMXCfwtH8o3F3lAOHqx9fxEgvZAhLEOaKDE5ZxVWn0mlkD7BzS6g= Received: from BY2PR07CA0086.namprd07.prod.outlook.com (2a01:111:e400:7bff::39) by DM5PR0701MB3814.namprd07.prod.outlook.com (2603:10b6:4:7f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.14; Thu, 28 Dec 2017 20:34:19 +0000 Received: from BN1BFFO11FD008.protection.gbl (2a01:111:f400:7c10::1:159) by BY2PR07CA0086.outlook.office365.com (2a01:111:e400:7bff::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.366.8 via Frontend Transport; Thu, 28 Dec 2017 20:34:18 +0000 Authentication-Results: spf=permerror (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=cavium.com; 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 BN1BFFO11FD008.mail.protection.outlook.com (10.58.144.71) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.345.12 via Frontend Transport; Thu, 28 Dec 2017 20:33:57 +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; Thu, 28 Dec 2017 12:33: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 vBSKXoMa002930; Thu, 28 Dec 2017 12:33:50 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id vBSKXouV002929; Thu, 28 Dec 2017 12:33:50 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 26/37] qla2xxx: Properly extract ADISC error codes Date: Thu, 28 Dec 2017 12:33:34 -0800 Message-ID: <20171228203345.2702-27-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171228203345.2702-1-himanshu.madhani@cavium.com> References: <20171228203345.2702-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)(376002)(396003)(39860400002)(39380400002)(346002)(2980300002)(448002)(199004)(189003)(356003)(87636003)(316002)(69596002)(80596001)(72206003)(1076002)(51416003)(4326008)(16586007)(110136005)(54906003)(8936002)(86362001)(6666003)(76176011)(2906002)(48376002)(42186006)(85326001)(50466002)(36756003)(50226002)(2950100002)(8676002)(305945005)(81166006)(81156014)(5660300001)(106466001)(478600001)(47776003)(59450400001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR0701MB3814; H:CAEXCH02.caveonetworks.com; FPR:; SPF:PermError; PTR:50-232-66-26-static.hfc.comcastbusiness.net; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD008; 1:pWHSYOBgXAkSJyllm/XNQfuybT5K6Fd0fzWHG5PxKz/l6Z4LXVBCMuTDb0MAdSylM3t4mMgD4EK2p0PkxdwrZu/5EJa5F0Ir7n9lr+cKYWpSiGXPvwuTnvySKUsa8+sC X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 23821d22-e30d-4eed-6c48-08d54e325275 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:DM5PR0701MB3814; X-Microsoft-Exchange-Diagnostics: 1; DM5PR0701MB3814; 3:n9Cow3vluGfg/FpjjPcgrFxOHL//jOajJLFTzfZpw+7LUtlHRNxfR+d8BUjtta76po/SHophvhji89Icbvy52ff/oyM/W4BiHlOLPE0q2+X2N1Na1RHtQqT0MceAyvh+KqN2EQTwMM3ODvM/HIhTsai7iB2zsUqooVmHR0AFDPjqn2vErq8nWymgLyAZdRaSlxlcon+fp/VjR0Bwa96VAFdMpTRpR5Ev+Qj2RcZQOXCeFvGbO2LocxBU8jXI+syQguiAQgXaUWODh+x2HSuEvxL9CKUYZJylY2cWrcmcDSsjZ3lU7UWX7METzlSjtHxu8JaJDWDCDsNqtK3VRlDapg==; 25:3fNcqUWhYtGFbAwrHLGfTpnUKKaaPDAKdbKmmDjB04GVLq5YWUxLoJ6CxUe8RbLYZCWLsDKCwdPpfab8M+qQiiT+0ipnUCNa9PUmnB1H2z4U0m72n1/IExZ3xqA+qj0GObVwqDNjY/74FKpqGKJxzxaK75ySG5tRibh9D5I9Z/twGtty5BAUbe5feCIzkbHR+G2LjPKzhimfNGbfsVnMT1x7bvd4xRJB52zK4ygg7Azc9ALBGdPClXGDaw96EUb5bXDvU67c0GZwlH2SYvlslJmQsStk3AgSIr841DAyuNLtFE/+6BnXs9n2aT7FhzwkgjjbWLL8N6nfRoBeMfoM3A==; 31:LVcEXSjJ3H9OONjXEi8O1fGaML6kVhFNMr9wMpzoogPQhoY7VScRRpy4UiJkD9i9a8PUUyMwrWmEu/S09zlONz4yHIC8m+lyyJY7dA80vySpHLwJQlxKMlMHXYyCYD9iSTh/WUQdsHoZxme7B83uEd7WRCnNTMfEdi//cFwcs1X+Wjd2ATvGCmiqiZ+0dVEbuuD4FAqWTKI8bloB2g2MtvmgvnFpINnJTT+7c9x/Z74= X-MS-TrafficTypeDiagnostic: DM5PR0701MB3814: X-Microsoft-Exchange-Diagnostics: 1; DM5PR0701MB3814; 20:0Qo7rET1hTCU1ICVxEffAxU5sAJGHqleHwQIHFRW9GnC7SdpEvms+C0NhAAavoz/8XZt9S5FMX9GlSY51YUF+weuCr3+TGQexVZZpEM5ovakbdlchXMuRA2FVPrdF5q3K94WBtrRMwW5q+T7Pye6LBLpDjAfIFO4xJ6cW+ks5bL/Im/xqcWjoMjNsma3r2DTaprjbqlTlHZXTGZqwyYThlP0Ah5dMlTK5aL5obRADk1ye3ND9b9MVXFuEn4ptBWn3Bth4V2WniOkPdEGJ+OTjM42p95UGFNSlJNPK0M+zPdS/uqwNXbMi5x7w8/I5zXmgVQ8OJnMkEA4EYQ/IFHx6KvT4x3JQs3JSDgcGWY1LJUlaSB/AMP6CR5Znw6K7fnN5oOYwkpBANVEV3LA+79rDwd/sKgEzrlOKhvugF0bJ4a1ZyFRTlIex0usSVZeHpqF2C4uhU7M4RvTXsrviArZHPFkOLnuOYp8yP51eOqT97QdYZJkFwIwC+dV0faFXTqK; 4:3AjHugqHndHruhyJVs8Py81c9TX5ytFIUgdh9j6wGTGKmRt0ylbQBTmIT3q7pADqoMHtU6CSnkRmNtMw+1ZqL7uzVBxvQFa/K3nO+b7p1OMfJ/t2V1Bj6t1iGEfqpWGKJIgCQklEZ0YqCUZ+SGS0zTflxYOhSyguBKn3HFA5Bx/AxQDCLaTd36wZC09uG5B7WR40UYHfrrFeD8V53XXFOVEYkWdqpOlM8jb8fKfmIY2qq+lgqksFoM7BnKRItJFjGKABUJ76gC/ZQ8XRYzlgXg== 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)(944501075)(6041268)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM5PR0701MB3814; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR0701MB3814; X-Forefront-PRVS: 05352A48BE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR0701MB3814; 23:DaACeiUVhcyG0cKW9gdqEWf9Fwlybs3Kufq7l/m?= =?us-ascii?Q?yfhowMpfoqATzufEuNylQo4TyeFvCbBNSDpeVz0FVGat320qFgc4YZj2eF+z?= =?us-ascii?Q?Rn5QwQyr05IRAoVVKcqN/8i+UxHmz3TVLZhTatcNtuTOOP0ia+6eZjKMzrkz?= =?us-ascii?Q?cprwKiYiIB1al2IMcbLnjAgov+X1No62T1JfPikchktHHrV/omZvepdOR3Ls?= =?us-ascii?Q?ro9eoLovortT36CfwuMqWM4Hr3jAd7GblW/wskpktbMldSj478z4xXLNk5YP?= =?us-ascii?Q?40hiwj+17+vs/haHsYt0HA5iqp+5m8JMdEi4OECpsELVymwLX+b6NubaDMVb?= =?us-ascii?Q?gk/NlrfRjrwfsnoiziwnBuc+PrFzfHU/uduRjIvOu9HUVGG/0dGXySJ+VNoM?= =?us-ascii?Q?cHkCFqVorXgy29XAb9lrL0HcNOV6mXTmEyjuN7IK0KsVsCkRS/oMcfs8QTAP?= =?us-ascii?Q?5ddv/ODSnABubNQrQ2C36NhuPEj8qROKQ/AEzz9eQ8eOdU36LzVogRocwkr1?= =?us-ascii?Q?BuI+IgNQl+OXi1AJs63nTYzMN7gMmnBOdM5TE+yRm+Bl8L1kp3+kY5Ocwhuc?= =?us-ascii?Q?W3lQ8KQ8pXcxfMziQYb64n/QidduwzBSXhcuddaYT/OxHjzcrnnc4atwkTmf?= =?us-ascii?Q?qEz75322nwJuOYSjITKT+252BR9GaWq0yKfqO+TlQyE+GlftGX38kAXbbRw7?= =?us-ascii?Q?CWIHgZLp9LZQoQBcGl4RWEjDv6rIk99MF7UIvM9c7myDqV9msK0O8SrlsDr/?= =?us-ascii?Q?+uQIn2XLHlPp5ei0MClHw9V1ejNqXtaGq9T7qN8mAkQOzCVSMyQ/UHIg6bmQ?= =?us-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R9Jy4rkAOJo41yDfDbp1c6ZdnrtHGYe9g8L8ywnBOgK/Y7+YIF2pEPLSYzpoySteDxiP3o0Zc73ICQ0Vd7h7SZghnJnGKmEgzdMxxlG64oxzK6nX6yZLOAyGx9lf8jZHNhgvhYhJitxzC SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2017 20:33:57.7807 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 23821d22-e30d-4eed-6c48-08d54e325275 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: DM5PR0701MB3814 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 0ea948db910f..75dc76587f43 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -339,16 +339,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; @@ -356,10 +361,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", @@ -377,6 +380,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", @@ -385,6 +389,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;