From patchwork Tue Feb 12 23:40:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10808935 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4F2A21390 for ; Tue, 12 Feb 2019 23:41:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CA912C080 for ; Tue, 12 Feb 2019 23:41:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E4862C083; Tue, 12 Feb 2019 23:41:59 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 BE0BE2C080 for ; Tue, 12 Feb 2019 23:41:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730743AbfBLXl6 (ORCPT ); Tue, 12 Feb 2019 18:41:58 -0500 Received: from mail-eopbgr710044.outbound.protection.outlook.com ([40.107.71.44]:18880 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728579AbfBLXl5 (ORCPT ); Tue, 12 Feb 2019 18:41:57 -0500 Received: from DM6PR07CA0044.namprd07.prod.outlook.com (2603:10b6:5:74::21) by BY1PR0701MB1925.namprd07.prod.outlook.com (2a01:111:e400:51ab::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.19; Tue, 12 Feb 2019 23:41:56 +0000 Received: from CO1NAM05FT054.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::202) by DM6PR07CA0044.outlook.office365.com (2603:10b6:5:74::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Tue, 12 Feb 2019 23:41:55 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by CO1NAM05FT054.mail.protection.outlook.com (10.152.96.170) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Tue, 12 Feb 2019 23:41:55 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Tue, 12 Feb 2019 15:40: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 x1CNeoxm029857; Tue, 12 Feb 2019 15:40:50 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1CNeo4L029848; Tue, 12 Feb 2019 15:40:50 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 01/12] qla2xxx: Fix LUN discovery if loop id is not assigned yet by firmware Date: Tue, 12 Feb 2019 15:40:35 -0800 Message-ID: <20190212234046.29809-2-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190212234046.29809-1-hmadhani@marvell.com> References: <20190212234046.29809-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131944885158441199;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(376002)(346002)(136003)(396003)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(53936002)(76176011)(105606002)(1076003)(110136005)(16586007)(42186006)(4326008)(106466001)(51416003)(86362001)(126002)(6666004)(87636003)(498600001)(54906003)(2616005)(11346002)(356004)(26826003)(69596002)(80596001)(446003)(476003)(336012)(486006)(97736004)(2906002)(85426001)(68736007)(50466002)(305945005)(48376002)(8936002)(36906005)(316002)(50226002)(26005)(36756003)(81156014)(81166006)(47776003)(8676002);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR0701MB1925;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT054;1:6sBgK3O/VU3ZQ2l3AELCtBmn0dropbdQCWco/PSuWl0MDuEoG+9V8UCafql8Qr/SjPdJ7vWn3Mw/i1XSFIPNEh+denDS7ZUeMZC8p5jdQI+weio2Zuk7sEx6mAh6StnnRiUBeyrTosBFHTQvO5g/pd4ZGkfgYgxakZw4r/NPa9Y= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 88cb1f54-3485-4e01-b001-08d69143ac2c X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:BY1PR0701MB1925; X-MS-TrafficTypeDiagnostic: BY1PR0701MB1925: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0946DC87A1 X-Microsoft-Exchange-Diagnostics: 1;BY1PR0701MB1925;23:tywA70Auj2V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HOcqDS7kp/B+e2wgJgsvPiJKISwnRX98R1LX12yJok/x4/ZpEeWUB46AhWbLQuuijxC6Fu/Zqp0ktBrdfkOn4NkNhxTwwo5fK9YyFejv3AUjz6H5F5 X-Microsoft-Antispam-Message-Info: HSxh2XqN9rdPfXi9oqslkXDh8cBhmy/cGUeFmvK+UsSG2YQKFKkn8OfoUAthyyJ7tJivWrEQgAfrZnKTh7ZXo+Db8EBxse+Bal/wQIht2LdlobZah9uEZv5xvBubG4n8DHh8jf3g77QxOI+Ju54JTtcH2xlzWl9VUyUZiVIjzSd46XYpiy5/gGddBv9jQ0SHhJYidV4e/YrYEOEoK+cMDgm+OjjqRLSs4j5BvVAUEDiE7aQkgFnbttlIAJ3IQeaaZfayC7D9uH1lEpsy0nELkKDHrVKjYteApbWjPa7wMVhYQYxIihXHE45EVLeDj/8fCjyMwv2DRm1wB04bRrss6IKDylFGsftA2/KKyMLfuQHuNisOPZTZbkuvysRvGNd3HehRgARy8yx08REWvYYm9nxBIJqMdwBSFE9R52KuY14= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2019 23:41:55.4047 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 88cb1f54-3485-4e01-b001-08d69143ac2c X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1925 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 This patch fixes LUN discovery when loop ID is not yet assigned by the firmware during driver load/sg_reset operations. Driver will now search for new loop id before retrying login. Fixes: 48acad099074 ("scsi: qla2xxx: Fix N2N link re-connect") Cc: stable@vger.kernel.org #4.19 Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 8307eac796a2..cdf57eb643b3 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -644,11 +644,14 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, break; case DSC_LS_PORT_UNAVAIL: default: - if (fcport->loop_id != FC_NO_LOOP_ID) - qla2x00_clear_loop_id(fcport); - - fcport->loop_id = loop_id; - fcport->fw_login_state = DSC_LS_PORT_UNAVAIL; + if (fcport->loop_id == FC_NO_LOOP_ID) { + qla2x00_find_new_loop_id(vha, fcport); + fcport->fw_login_state = + DSC_LS_PORT_UNAVAIL; + } + ql_dbg(ql_dbg_disc, vha, 0x20e5, + "%s %d %8phC\n", __func__, __LINE__, + fcport->port_name); qla24xx_fcport_handle_login(vha, fcport); break; } From patchwork Tue Feb 12 23:40:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10808943 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9F1591390 for ; Tue, 12 Feb 2019 23:42:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C5FF2C083 for ; Tue, 12 Feb 2019 23:42:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 808DE2C0AD; Tue, 12 Feb 2019 23:42:18 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 B49412C082 for ; Tue, 12 Feb 2019 23:42:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732160AbfBLXmR (ORCPT ); Tue, 12 Feb 2019 18:42:17 -0500 Received: from mail-eopbgr710078.outbound.protection.outlook.com ([40.107.71.78]:28643 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728924AbfBLXmQ (ORCPT ); Tue, 12 Feb 2019 18:42:16 -0500 Received: from BYAPR07CA0004.namprd07.prod.outlook.com (2603:10b6:a02:bc::17) by BY1PR0701MB1925.namprd07.prod.outlook.com (2a01:111:e400:51ab::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.19; Tue, 12 Feb 2019 23:42:02 +0000 Received: from CO1NAM05FT060.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::205) by BYAPR07CA0004.outlook.office365.com (2603:10b6:a02:bc::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Tue, 12 Feb 2019 23:42:02 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by CO1NAM05FT060.mail.protection.outlook.com (10.152.96.178) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Tue, 12 Feb 2019 23:42:01 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Tue, 12 Feb 2019 15:40:53 -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 x1CNerdW029861; Tue, 12 Feb 2019 15:40:53 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1CNerIu029860; Tue, 12 Feb 2019 15:40:53 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 02/12] qla2xxx: Add First Burst support for FC-NVMe devices Date: Tue, 12 Feb 2019 15:40:36 -0800 Message-ID: <20190212234046.29809-3-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190212234046.29809-1-hmadhani@marvell.com> References: <20190212234046.29809-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131944885220995469;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(376002)(346002)(136003)(396003)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(53936002)(76176011)(105606002)(1076003)(110136005)(16586007)(42186006)(4326008)(106466001)(51416003)(86362001)(126002)(6666004)(87636003)(498600001)(54906003)(2616005)(11346002)(356004)(26826003)(69596002)(80596001)(446003)(476003)(336012)(486006)(97736004)(2906002)(85426001)(68736007)(50466002)(14444005)(305945005)(48376002)(8936002)(36906005)(316002)(50226002)(26005)(36756003)(81156014)(81166006)(47776003)(8676002);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR0701MB1925;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT060;1:5rlp9/Ue+M47qBHyPl/7NNovhr3GR+G5lx61tc5Okv6CLrjbTco0oN/SDnllKOr7xlEnvpI8dR6DvAMnEUsep9LS1wMgDPrHsobzS9HMpZZvct/ygcYzX+mGMOVKbzJFTDhK/ECTjriMMCzKwS03JKcdeJN7EJaF8HX+82iISkI= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c870b156-ecf6-4331-7c79-08d69143affd X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:BY1PR0701MB1925; X-MS-TrafficTypeDiagnostic: BY1PR0701MB1925: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0946DC87A1 X-Microsoft-Exchange-Diagnostics: 1;BY1PR0701MB1925;23:2RB44NrSDeNRu46wngDRUemYZgqw/Uj2LmImnda59Vsx9y+/NkK//AZk4f9xxrONkCQ0zlLFlVe0jhaiB4w7T94kR706HzioohKZtvgxtWQjHUje+tsCX51A+3BSRXoa9xKzxJyqAN5/NdB5rgqo2jXupmGQpj+JDpoGXO6xWbOc+X8N+VrKYtmpxiucG87qBTSri1RH/HePvNewhn8D9JGawCGuUUrEvT01vqNvRg/2yTOMFKYDmFx1ZwByiner6HaBZ14yFSHEyE3OWLxU6fDVO+SgtxLG58K5dQmaQunXHf1RWi2qFl1NJLfs33s2smYDQawqIm7Bl1/9sUxdUMEsGjchmITeFt9ZXnA6DzYytSS3rfqgHsIvgFrsNIucFDKfIQBGIyEfthvVZ9sIPIxzb+H1bTVV17CtCIQjCgOnjqjllF7HJiKgHs8cZkRkWxhEyu9zaP6qCodV0ivHBKJnP2zzoktKYd9mnHrJGg87wIlkye8wcA3mxyD7pu1CWpv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bqHZoQF7Dhy9641MqpNm/tB8cfEHTf18bSXbC/V2KI3RW67uRWw9/P7+W5yqtbmfGqGlxycJ9bxSBTqcJE0mSOGwjwO15jMw= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2019 23:42:01.8003 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c870b156-ecf6-4331-7c79-08d69143affd X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1925 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: Darren Trapp Add Support for First Burst for FC-NVMe protocol. This feature requires First Burst support in the firmware. Signed-off-by: Darren Trapp Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 4 ++++ drivers/scsi/qla2xxx/qla_init.c | 6 ++++++ drivers/scsi/qla2xxx/qla_iocb.c | 5 ++++- drivers/scsi/qla2xxx/qla_isr.c | 9 +++++++++ drivers/scsi/qla2xxx/qla_mbx.c | 5 +++-- drivers/scsi/qla2xxx/qla_nvme.c | 15 ++++++++++++--- drivers/scsi/qla2xxx/qla_nvme.h | 2 +- 7 files changed, 39 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 80acf30fd8a5..c256ba7fba84 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2367,7 +2367,9 @@ typedef struct fc_port { #define NVME_PRLI_SP_INITIATOR BIT_5 #define NVME_PRLI_SP_TARGET BIT_4 #define NVME_PRLI_SP_DISCOVERY BIT_3 +#define NVME_PRLI_SP_FIRST_BURST BIT_0 uint8_t nvme_flag; + uint32_t nvme_first_burst_size; #define NVME_FLAG_REGISTERED 4 #define NVME_FLAG_DELETING 2 #define NVME_FLAG_RESETTING 1 @@ -3966,6 +3968,7 @@ struct qla_hw_data { uint16_t fw_subminor_version; uint16_t fw_attributes; uint16_t fw_attributes_h; +#define FW_ATTR_H_NVME_FBURST BIT_1 #define FW_ATTR_H_NVME BIT_10 #define FW_ATTR_H_NVME_UPDATED BIT_14 @@ -4260,6 +4263,7 @@ typedef struct scsi_qla_host { uint32_t qpairs_req_created:1; uint32_t qpairs_rsp_created:1; uint32_t nvme_enabled:1; + uint32_t nvme_first_burst:1; } flags; atomic_t loop_state; diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index cdf57eb643b3..2d9336a87e42 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1829,6 +1829,12 @@ qla24xx_handle_prli_done_event(struct scsi_qla_host *vha, struct event_arg *ea) ea->fcport->chip_reset = vha->hw->base_qpair->chip_reset; ea->fcport->logout_on_delete = 1; + ea->fcport->nvme_prli_service_param = ea->iop[0]; + if (ea->iop[0] & NVME_PRLI_SP_FIRST_BURST) + ea->fcport->nvme_first_burst_size = + (ea->iop[1] & 0xffff) * 512; + else + ea->fcport->nvme_first_burst_size = 0; qla24xx_post_gpdb_work(vha, ea->fcport, 0); break; default: diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 2c27ae1924c5..cdac282b5bd3 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -2419,8 +2419,11 @@ qla24xx_prli_iocb(srb_t *sp, struct logio_entry_24xx *logio) logio->entry_type = LOGINOUT_PORT_IOCB_TYPE; logio->control_flags = cpu_to_le16(LCF_COMMAND_PRLI); - if (lio->u.logio.flags & SRB_LOGIN_NVME_PRLI) + if (lio->u.logio.flags & SRB_LOGIN_NVME_PRLI) { logio->control_flags |= LCF_NVME_PRLI; + if (sp->vha->flags.nvme_first_burst) + logio->io_parameter[0] = NVME_PRLI_SP_FIRST_BURST; + } logio->nport_handle = cpu_to_le16(sp->fcport->loop_id); logio->port_id[0] = sp->fcport->d_id.b.al_pa; diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index bde9940ea7d1..b5ae76869d5b 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -1715,6 +1715,15 @@ qla24xx_logio_entry(scsi_qla_host_t *vha, struct req_que *req, vha->hw->exch_starvation = 0; data[0] = MBS_COMMAND_COMPLETE; + + if (sp->type == SRB_PRLI_CMD) { + lio->u.logio.iop[0] = + le32_to_cpu(logio->io_parameter[0]); + lio->u.logio.iop[1] = + le32_to_cpu(logio->io_parameter[1]); + goto logio_done; + } + if (sp->type != SRB_LOGIN_CMD) goto logio_done; diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index f4adf6baee69..6c911f2e4cdb 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -1112,6 +1112,9 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha) if ((ha->fw_attributes_h & (FW_ATTR_H_NVME | FW_ATTR_H_NVME_UPDATED)) && ql2xnvmeenable) { + if (ha->fw_attributes_h & FW_ATTR_H_NVME_FBURST) + vha->flags.nvme_first_burst = 1; + vha->flags.nvme_enabled = 1; ql_log(ql_log_info, vha, 0xd302, "%s: FC-NVMe is Enabled (0x%x)\n", @@ -6267,8 +6270,6 @@ int __qla24xx_parse_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport, fcport->d_id.b.rsvd_1 = 0; if (fcport->fc4f_nvme) { - fcport->nvme_prli_service_param = - pd->prli_nvme_svc_param_word_3; fcport->port_type = FCT_NVME; } else { /* If not target must be initiator or unknown type. */ diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index 39d892bbd219..efc23761de1c 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -359,16 +359,25 @@ static inline int qla2x00_start_nvme_mq(srb_t *sp) /* No data transfer how do we check buffer len == 0?? */ if (fd->io_dir == NVMEFC_FCP_READ) { cmd_pkt->control_flags = - cpu_to_le16(CF_READ_DATA | CF_NVME_ENABLE); + cpu_to_le16(CF_READ_DATA); vha->qla_stats.input_bytes += fd->payload_length; vha->qla_stats.input_requests++; } else if (fd->io_dir == NVMEFC_FCP_WRITE) { cmd_pkt->control_flags = - cpu_to_le16(CF_WRITE_DATA | CF_NVME_ENABLE); + cpu_to_le16(CF_WRITE_DATA); + if ((vha->flags.nvme_first_burst) && + (sp->fcport->nvme_prli_service_param & + NVME_PRLI_SP_FIRST_BURST)) { + if ((fd->payload_length <= + sp->fcport->nvme_first_burst_size) || + (sp->fcport->nvme_first_burst_size == 0)) + cmd_pkt->control_flags |= + cpu_to_le16(CF_NVME_FIRST_BURST_ENABLE); + } vha->qla_stats.output_bytes += fd->payload_length; vha->qla_stats.output_requests++; } else if (fd->io_dir == 0) { - cmd_pkt->control_flags = cpu_to_le16(CF_NVME_ENABLE); + cmd_pkt->control_flags = 0; } /* Set NPORT-ID */ diff --git a/drivers/scsi/qla2xxx/qla_nvme.h b/drivers/scsi/qla2xxx/qla_nvme.h index 4941d107fb1c..da8dad5ad693 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.h +++ b/drivers/scsi/qla2xxx/qla_nvme.h @@ -57,7 +57,7 @@ struct cmd_nvme { uint64_t rsvd; uint16_t control_flags; /* Control Flags */ -#define CF_NVME_ENABLE BIT_9 +#define CF_NVME_FIRST_BURST_ENABLE BIT_11 #define CF_DIF_SEG_DESCR_ENABLE BIT_3 #define CF_DATA_SEG_DESCR_ENABLE BIT_2 #define CF_READ_DATA BIT_1 From patchwork Tue Feb 12 23:40:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10808971 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ECC5D1390 for ; Tue, 12 Feb 2019 23:42:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB3D22C080 for ; Tue, 12 Feb 2019 23:42:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC9DF2C083; Tue, 12 Feb 2019 23:42:44 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 B73ED2C080 for ; Tue, 12 Feb 2019 23:42:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732544AbfBLXmn (ORCPT ); Tue, 12 Feb 2019 18:42:43 -0500 Received: from mail-eopbgr780053.outbound.protection.outlook.com ([40.107.78.53]:31722 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728579AbfBLXmm (ORCPT ); Tue, 12 Feb 2019 18:42:42 -0500 Received: from BYAPR07CA0004.namprd07.prod.outlook.com (2603:10b6:a02:bc::17) by SN1PR0701MB1934.namprd07.prod.outlook.com (2a01:111:e400:517e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.22; Tue, 12 Feb 2019 23:42:01 +0000 Received: from CO1NAM05FT060.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::205) by BYAPR07CA0004.outlook.office365.com (2603:10b6:a02:bc::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Tue, 12 Feb 2019 23:42:01 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by CO1NAM05FT060.mail.protection.outlook.com (10.152.96.178) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Tue, 12 Feb 2019 23:42:00 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Tue, 12 Feb 2019 15:40:56 -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 x1CNeu8v029865; Tue, 12 Feb 2019 15:40:56 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1CNeuC5029864; Tue, 12 Feb 2019 15:40:56 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 03/12] qla2xxx: Fix unload when NVMe devices are configured Date: Tue, 12 Feb 2019 15:40:37 -0800 Message-ID: <20190212234046.29809-4-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190212234046.29809-1-hmadhani@marvell.com> References: <20190212234046.29809-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131944885207915462;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(396003)(39860400002)(376002)(346002)(136003)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(14444005)(105606002)(6666004)(356004)(1076003)(47776003)(110136005)(498600001)(68736007)(48376002)(16586007)(2906002)(50466002)(316002)(87636003)(42186006)(54906003)(36906005)(26826003)(4326008)(86362001)(76176011)(51416003)(53936002)(106466001)(26005)(85426001)(69596002)(80596001)(36756003)(97736004)(50226002)(446003)(81166006)(8936002)(8676002)(336012)(476003)(81156014)(2616005)(486006)(11346002)(126002)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR0701MB1934;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT060;1:HKevAdqU5t3HQgu8/M+NfrV6G9jROM0cvLWkWpimjdSgyX/TUSFT+IpLTTIaQbsdn78AAIUode9Daj6oyBfhCGqg1yd6/BC1izSj27uP/59pudDLCMIBQ//xtMn1mx9MwSl1qPeU9EPXzeutbjbOUkqnjYhZFRUnZpewtUemS6k= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a8d99dcb-c340-4b64-2848-08d69143af28 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:SN1PR0701MB1934; X-MS-TrafficTypeDiagnostic: SN1PR0701MB1934: X-Microsoft-Antispam-PRVS: X-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2jNSYybQFmXi2XQboSQ+FMCxIvcjDysmBaCy/+sGkEZ1I6emxEKyWXKsWvDfYP3E7Ec6JpzAQYUhgMKH1w5DHlypmfearnPmOg9ldZdo+73XETMZg2wdsvH/kcJDLNgWuHHgGaB7OA2Bb65i2OIfGjQejPLcuTx82LgzN4JslQiEu+GSZiwNf/A7Qd8abb6mBHXgpIjEYKHwqEWKU2puIx5FaIMt8vcDEQ== X-Microsoft-Antispam-Message-Info: 7SWh9aBOC6a53h90nRIWWJelt4RefVFbGrSuQWxnRgYFRePhgj0tZsXGnKk6qF9QMdNu595r4Ryf/vr0xVcwK48Zlb3HLgQNme9WGM+FLY3Ul3/O0WPhikhEBckvLGUaLuBbDfM/36V9WQhh3yRAndklZW5ZVPSQ/1YlIMceAAyUSic+qz3bZHKNveeDTtqZsIgzYcb7TT6BTxTBiCdkpEZNgpXRcckt0PkapzOUAvy6/X0JEj38tpxELDVrrgkJcDqv4PTkTPdh3Qz1p9vl96zWKW3pfS3hU6ON7Z2LJLa3JSV0twyGJNURFBvV7pdVSE5ld/Ajw4bjMWa1m1BylqmyiRfT17NWtSKK9Fh+ysXMmLnno2cBWFUPK9EfqboRXrtMm/VztbloU2DTrQTCHqSN5sIyplrIkUbkxVM0nfA= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2019 23:42:00.4012 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8d99dcb-c340-4b64-2848-08d69143af28 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0701MB1934 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 This patch fixes driver unload issue when FC-NVMe devices are configured. Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_nvme.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index efc23761de1c..69fb7c605c75 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -609,6 +609,7 @@ static void qla_nvme_unregister_remote_port(struct work_struct *work) struct fc_port *fcport = container_of(work, struct fc_port, nvme_del_work); struct qla_nvme_rport *qla_rport, *trport; + scsi_qla_host_t *base_vha; if (!IS_ENABLED(CONFIG_NVME_FC)) return; @@ -616,6 +617,15 @@ static void qla_nvme_unregister_remote_port(struct work_struct *work) ql_log(ql_log_warn, NULL, 0x2112, "%s: unregister remoteport on %p\n",__func__, fcport); + base_vha = pci_get_drvdata(fcport->vha->hw->pdev); + if (test_bit(PFLG_DRIVER_REMOVING, &base_vha->pci_flags)) { + ql_dbg(ql_dbg_disc, fcport->vha, 0x2114, + "%s: Notify FC-NVMe transport, set devloss=0\n", + __func__); + + nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, 0); + } + list_for_each_entry_safe(qla_rport, trport, &fcport->vha->nvme_rport_list, list) { if (qla_rport->fcport == fcport) { @@ -632,23 +642,11 @@ static void qla_nvme_unregister_remote_port(struct work_struct *work) void qla_nvme_delete(struct scsi_qla_host *vha) { - struct qla_nvme_rport *qla_rport, *trport; - fc_port_t *fcport; int nv_ret; if (!IS_ENABLED(CONFIG_NVME_FC)) return; - list_for_each_entry_safe(qla_rport, trport, - &vha->nvme_rport_list, list) { - fcport = qla_rport->fcport; - - ql_log(ql_log_info, fcport->vha, 0x2114, "%s: fcport=%p\n", - __func__, fcport); - - nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, 0); - } - if (vha->nvme_local_port) { init_completion(&vha->nvme_del_done); ql_log(ql_log_info, vha, 0x2116, From patchwork Tue Feb 12 23:40:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10808953 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BF9A5188E for ; Tue, 12 Feb 2019 23:42:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB8512C080 for ; Tue, 12 Feb 2019 23:42:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96A952C132; Tue, 12 Feb 2019 23:42:20 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI 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 0A7052C080 for ; Tue, 12 Feb 2019 23:42:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732232AbfBLXmI (ORCPT ); Tue, 12 Feb 2019 18:42:08 -0500 Received: from mail-eopbgr780051.outbound.protection.outlook.com ([40.107.78.51]:63952 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732160AbfBLXmI (ORCPT ); Tue, 12 Feb 2019 18:42:08 -0500 Received: from DM5PR07CA0113.namprd07.prod.outlook.com (2603:10b6:4:ae::42) by DM5PR07MB2908.namprd07.prod.outlook.com (2603:10b6:3:9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.22; Tue, 12 Feb 2019 23:42:06 +0000 Received: from CO1NAM05FT058.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::200) by DM5PR07CA0113.outlook.office365.com (2603:10b6:4:ae::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Tue, 12 Feb 2019 23:42:06 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by CO1NAM05FT058.mail.protection.outlook.com (10.152.96.176) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Tue, 12 Feb 2019 23:42:05 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Tue, 12 Feb 2019 15:40:59 -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 x1CNex09029869; Tue, 12 Feb 2019 15:40:59 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1CNexPr029868; Tue, 12 Feb 2019 15:40:59 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 04/12] qla2xxx: Check for FW started flag before aborting Date: Tue, 12 Feb 2019 15:40:38 -0800 Message-ID: <20190212234046.29809-5-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190212234046.29809-1-hmadhani@marvell.com> References: <20190212234046.29809-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131944885260858874;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(376002)(346002)(136003)(39860400002)(396003)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(50226002)(110136005)(8936002)(26826003)(87636003)(8676002)(316002)(16586007)(2906002)(54906003)(68736007)(4326008)(36906005)(81166006)(51416003)(81156014)(50466002)(76176011)(336012)(42186006)(498600001)(69596002)(80596001)(26005)(305945005)(48376002)(126002)(476003)(2616005)(6666004)(356004)(446003)(106466001)(486006)(47776003)(86362001)(4744005)(53936002)(105606002)(1076003)(36756003)(85426001)(11346002)(97736004);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR07MB2908;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT058;1:Vi7LLAhZIv/pNilck/yG/R4JoGrJzsq415kMcmIYQUfDDqjJ3tQ2avUsFMJZohG2Nyow7Ea3C+Zm0PPqDJQ/MKcUzqSEYcXVZKgv79do+EsfzyQTE5+vd20Cndhlbk1JU6eqjW9+kORxVbZn3+cvYNxwsnCGTeR1zADJ5UcV8pk= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 435e9fbc-b1a6-4a6b-e199-08d69143b256 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:DM5PR07MB2908; X-MS-TrafficTypeDiagnostic: DM5PR07MB2908: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0946DC87A1 X-Microsoft-Exchange-Diagnostics: 1;DM5PR07MB2908;23:/92TNurw6JfPa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AnPG2HYaDygbs50q4Q768GASP4wekdKzY8m1jBS51MEWTasjUbOziOXTF+YCP61JdyuSwAtQlMVdMEdc0cmGwXvDuHkqUheqvVOqYpKiXD4LqNtEtUeGFqCYL/OPxaOfMEmye/5Mw8+XL0VUaDQ== X-Microsoft-Antispam-Message-Info: kmEAjaYc587aGjXuQETNX4efrZftKOimgGYjOb02x3Z9WX7fda/V1mjHTO9R0scW9EFsCOE9jChWzwnaQArpC0a/kBWzmkbcqt31M20vgJjZfA9iYJMWSohbbeFRyqbPOQVSM8HpX3E+K0fm9u2VtNGp/5Z4W4ljPNxDSAT0yMkMFipcm9icLah1grbM3edEXsAMSDRNpEc2b4PtGSjDi0OC0GiOrtfb682KTNbfnj9HgEHNc3A7aoa4oJligNaLFSPq0H33AAFV3H5JcudaSiYU2QpMQhGYgO/YhJtl7AFfGuGBqIbgk4Vph7wsM8NDpZhkqKhD3kE3/RTQZPpK6Uz7e75VjajKwzEg4zsBZB7Ol6gXIpWP1MlSDz/Xkn1bkmX28OWoFNZzkXppHahqDmb2iBTPSxfmRnjyvO+wyC0= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2019 23:42:05.7386 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 435e9fbc-b1a6-4a6b-e199-08d69143b256 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB2908 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 For FC-NVMe, if the fw_started flag is not set or fcport is deleted, then do not send Abort command Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_nvme.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index 69fb7c605c75..968fd3e66dd9 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -185,6 +185,14 @@ static void qla_nvme_abort_work(struct work_struct *work) struct qla_hw_data *ha = fcport->vha->hw; int rval; + if (fcport) + ql_dbg(ql_dbg_io, fcport->vha, 0xffff, + "%s called for sp=%p, hndl=%x on fcport=%p deleted=%d\n", + __func__, sp, sp->handle, fcport, fcport->deleted); + + if (!ha->flags.fw_started && (fcport && fcport->deleted)) + return; + rval = ha->isp_ops->abort_command(sp); ql_dbg(ql_dbg_io, fcport->vha, 0x212b, From patchwork Tue Feb 12 23:40:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10808961 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8CE7513A4 for ; Tue, 12 Feb 2019 23:42:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7BA1C2C080 for ; Tue, 12 Feb 2019 23:42:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6EDDB2C083; Tue, 12 Feb 2019 23:42:23 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 5F41E2C080 for ; Tue, 12 Feb 2019 23:42:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729496AbfBLXmV (ORCPT ); Tue, 12 Feb 2019 18:42:21 -0500 Received: from mail-eopbgr820055.outbound.protection.outlook.com ([40.107.82.55]:30866 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732236AbfBLXmU (ORCPT ); Tue, 12 Feb 2019 18:42:20 -0500 Received: from DM6PR07CA0028.namprd07.prod.outlook.com (2603:10b6:5:94::41) by BL0PR07MB5457.namprd07.prod.outlook.com (2603:10b6:208:37::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.19; Tue, 12 Feb 2019 23:42:12 +0000 Received: from CO1NAM05FT009.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::208) by DM6PR07CA0028.outlook.office365.com (2603:10b6:5:94::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1601.19 via Frontend Transport; Tue, 12 Feb 2019 23:42:12 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by CO1NAM05FT009.mail.protection.outlook.com (10.152.96.116) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Tue, 12 Feb 2019 23:42:11 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Tue, 12 Feb 2019 15:41:03 -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 x1CNf3be029874; Tue, 12 Feb 2019 15:41:03 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1CNf2Xa029872; Tue, 12 Feb 2019 15:41:02 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 05/12] qla2xxx: Prevent multiple ADISC commands per session Date: Tue, 12 Feb 2019 15:40:39 -0800 Message-ID: <20190212234046.29809-6-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190212234046.29809-1-hmadhani@marvell.com> References: <20190212234046.29809-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131944885319832754;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(396003)(376002)(346002)(39860400002)(136003)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(36756003)(50466002)(86362001)(50226002)(51416003)(26005)(85426001)(53936002)(76176011)(305945005)(36906005)(316002)(54906003)(8936002)(110136005)(16586007)(42186006)(47776003)(8676002)(11346002)(4326008)(80596001)(498600001)(486006)(81156014)(81166006)(2906002)(87636003)(68736007)(4744005)(446003)(1076003)(26826003)(476003)(126002)(2616005)(6666004)(48376002)(356004)(106466001)(97736004)(69596002)(105606002)(336012);DIR:OUT;SFP:1101;SCL:1;SRVR:BL0PR07MB5457;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT009;1:npKLXVikcUzgo3xUpDvXngZ0d+MhCak4Bp7d7FpyUhbEvg8orNH5vcg94FTsxFpkNh7EyhgzXLJzsoRE3jWuKAFMYG5Q0Gv83DAE3k+cJtZKQcHbGhc/bDe8VKC+q6S6OGj3agZ4XS7IW6H3SsJ5UePE8L3UNr7IHGQhJwoGk/Q= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 93bf7580-35e9-4b7f-c67c-08d69143b5e1 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:BL0PR07MB5457; X-MS-TrafficTypeDiagnostic: BL0PR07MB5457: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0946DC87A1 X-Microsoft-Exchange-Diagnostics: 1;BL0PR07MB5457;23:z8Q3lLciQ3g7Lrj+iuHONAI1YZmMb9nOeLh+l021TtQlhlIu7rPe/GzzQyANvaw2+Lx67o0gqvofgQ9hFGK4f5wdgwQtP3J4b5Y5UKELx6vND4eWsNYnG2f0xIXc9P0237pPgirR6pTNftUgWlYZGeLCtyYrfJJFVnpb8uQ5bhogq1gUKf9BldLZvh7fvCpJre9EkXTnfF9ZOWcQGvh4utK92hZMI7LZqivHzXG9AzFrXU1QsyWS1p3bR2L5nCnVnvt5MOKbI5AXUZ+0ZlgpXzYVEJtIlrVsNEvMD8qc9qFd7LQBem1w3NUgsc1/9FHbNgTHQpCaCOVY/oB7lYQJU5Y2qr27wDdvq6jmL7PClAUEOjKQsyM30VbHxnwtmhQm6X9e25k8QQrlQFcXD8Dsgv08F7tF8+9dyfWqXsiJfIRb3wo8dQ3wRPlOOlw3BC50a4RIEObRl6bDIpP+21byn1XMPK7BxakYtsSl3ypllgiGjjKLnbiEkiYnbBVESrEWD42t7QTOYSG4bT87+C64H5nADMPZS5ay5JAoUtnc56w0xy3VWKbOadSJbSzo7b5Ci7yzrgr4qBYEkRinB5hSK/InLhjuQvW00PuUBNrnovU/vpKRt0ail94D6VsX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riginalArrivalTime: 12 Feb 2019 23:42:11.6880 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 93bf7580-35e9-4b7f-c67c-08d69143b5e1 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR07MB5457 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 add check to allow 1 discovery command per session to be sent. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 2d9336a87e42..ba5da365ee4a 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -471,9 +471,11 @@ qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport, { srb_t *sp; struct srb_iocb *lio; - int rval; + int rval = QLA_FUNCTION_FAILED; + + if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT)) + return rval; - rval = QLA_FUNCTION_FAILED; fcport->flags |= FCF_ASYNC_SENT; sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); if (!sp) From patchwork Tue Feb 12 23:40:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10808941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 73AAC13A4 for ; Tue, 12 Feb 2019 23:42:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 607272C082 for ; Tue, 12 Feb 2019 23:42:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 54C502C0AD; Tue, 12 Feb 2019 23:42:16 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 9009C2C082 for ; Tue, 12 Feb 2019 23:42:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732237AbfBLXmO (ORCPT ); Tue, 12 Feb 2019 18:42:14 -0500 Received: from mail-eopbgr780072.outbound.protection.outlook.com ([40.107.78.72]:53588 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732160AbfBLXmN (ORCPT ); Tue, 12 Feb 2019 18:42:13 -0500 Received: from DM6PR07CA0001.namprd07.prod.outlook.com (2603:10b6:5:94::14) by MWHPR07MB2912.namprd07.prod.outlook.com (2603:10b6:300:1f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.22; Tue, 12 Feb 2019 23:42:11 +0000 Received: from CO1NAM05FT009.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::205) by DM6PR07CA0001.outlook.office365.com (2603:10b6:5:94::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Tue, 12 Feb 2019 23:42:11 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by CO1NAM05FT009.mail.protection.outlook.com (10.152.96.116) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Tue, 12 Feb 2019 23:42:10 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Tue, 12 Feb 2019 15:41:06 -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 x1CNf6YY029878; Tue, 12 Feb 2019 15:41:06 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1CNf63R029877; Tue, 12 Feb 2019 15:41:06 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 06/12] qla2xxx: Add support for setting port speed Date: Tue, 12 Feb 2019 15:40:40 -0800 Message-ID: <20190212234046.29809-7-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190212234046.29809-1-hmadhani@marvell.com> References: <20190212234046.29809-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131944885309844926;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(39860400002)(346002)(376002)(396003)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(36756003)(85426001)(106466001)(53936002)(126002)(1076003)(2616005)(16586007)(36906005)(86362001)(476003)(42186006)(105606002)(68736007)(110136005)(316002)(486006)(47776003)(446003)(11346002)(54906003)(69596002)(2906002)(80596001)(14444005)(76176011)(8936002)(336012)(26005)(8676002)(51416003)(26826003)(50226002)(305945005)(498600001)(48376002)(356004)(81166006)(81156014)(50466002)(97736004)(6666004)(4326008)(87636003);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR07MB2912;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT009;1:RE6cTdMh33w+azx7muqj63IRofp4y2ebq4o2gqceboTJ+cn7CBKdrGI1PRcOg9qCXIJr1EBVVB/vk1QQSI1FKqgbhClvAxloWJ0RgLB5YoykwLzgSu0+g+xnvB1E1jo7m9B5uWo8iTtHqkm5fO2xOh1LWFFg9u51llThBuV7Sm0= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 38995e08-d18c-4ab8-79b3-08d69143b53b X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:MWHPR07MB2912; X-MS-TrafficTypeDiagnostic: MWHPR07MB2912: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0946DC87A1 X-Microsoft-Exchange-Diagnostics: 1;MWHPR07MB2912;23:Y9wOl1WWnQeSQC/l6inn/vWi1F9RsXxuD8dRqnKABgX0zQVUZlhiPhiop7WcpVPw/8idccB3ZDRlxhyhofKtXinDv6fY2IjWmfP6iUk2r1JJj4RyFsPeCJO6Adcp2VlIpCUO+nVLw6hljaN9W8vyZhjbAzZqPaTAry48vuqKsEN1FLvfKxvpwqCSumVkx+Quu2KR2HV433SF4ycA85J45BU4lK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MJ4z+z6LH2N82MLhPjf7b6vgNbLZCjOTzI3JNDAEm8BlxHDH5t1X58p/DYhsUGfDeMaS73ottrxCb/AymJQ0VhSvla+GKNxepOjY4vx+JSZizUiuunNUkjOkXfBm+LZFcksxsO8w1Wfc//gnUtWxGCuU0ayar5Qd9iE2Pm/4lvZo7QO6vU4MOkXNRbWvzWviu3GhDy7J1VvbgGocG3GpS0bisLSYC481jPdh7niV/5CX83u119zSiBSDp25FGLQuHWAjexvwJim3kqh4KzchgLLFTTqirTb178kYhBNrUyMmXlpSyHjnTUUSd5NIsZ64CnMGIMwIvi891okKUD16SQBmoiqCUVlIS6IlgsG8Xi3/OqVBqM= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2019 23:42:10.5521 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 38995e08-d18c-4ab8-79b3-08d69143b53b X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB2912 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: Anil Gurumurthy This patch adds SysFS node 1. There is a new sysfs node port_speed 2. The possible values are 2(Auto neg), 8, 16, 32 3. A value outside of the above defaults to Auto neg 4. Any update to the setting causes a link toggle 5. This feature is currently only for ISP27xx Signed-off-by: Anil Gurumurthy Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_attr.c | 103 ++++++++++++++++++++++++++++++++++++++++ drivers/scsi/qla2xxx/qla_def.h | 6 +++ drivers/scsi/qla2xxx/qla_gbl.h | 1 + drivers/scsi/qla2xxx/qla_init.c | 9 ++++ drivers/scsi/qla2xxx/qla_mbx.c | 62 +++++++++++++++++++++++- 5 files changed, 180 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 8b4dd72011bf..dcdfcf3bc955 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -631,6 +631,108 @@ static struct bin_attribute sysfs_sfp_attr = { }; static ssize_t +qla2x00_sysfs_set_port_speed(struct file *filp, struct kobject *kobj, + struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) +{ + struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, + struct device, kobj))); + int type; + int mode = QLA_SET_DATA_RATE_LR; + int rval; + struct qla_hw_data *ha = vha->hw; + int speed, oldspeed; + + if (!IS_QLA27XX(vha->hw)) { + ql_log(ql_log_warn, vha, 0x70d8, + "Speed setting not supported \n"); + return -EINVAL; + } + + speed = type = simple_strtol(buf, NULL, 10); + if (type == 40 || type == 80 || type == 160 || + type == 320) { + ql_log(ql_log_warn, vha, 0x70d9, + "Setting will be affected after a loss of sync\n"); + type = type/10; + mode = QLA_SET_DATA_RATE_NOLR; + } + + oldspeed = ha->set_data_rate; + + switch (type) { + case 0: + ha->set_data_rate = PORT_SPEED_AUTO; + break; + case 4: + ha->set_data_rate = PORT_SPEED_4GB; + break; + case 8: + ha->set_data_rate = PORT_SPEED_8GB; + break; + case 16: + ha->set_data_rate = PORT_SPEED_16GB; + break; + case 32: + ha->set_data_rate = PORT_SPEED_32GB; + break; + default: + ql_log(ql_log_warn, vha, 0x1199, + "Unrecognized speed setting:%d. Setting Autoneg\n", + speed); + ha->set_data_rate = PORT_SPEED_AUTO; + } + + if (qla2x00_chip_is_down(vha) || (oldspeed == ha->set_data_rate)) + return count; + + ql_log(ql_log_info, vha, 0x70da, + "Setting speed to %d Gbps \n", type); + + rval = qla2x00_set_data_rate(vha, mode); + if (rval != QLA_SUCCESS) + return -EIO; + + return count; +} + +static ssize_t +qla2x00_sysfs_get_port_speed(struct file *filp, struct kobject *kobj, + struct bin_attribute *bin_attr, + char *buf, loff_t off, size_t count) +{ + struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, + struct device, kobj))); + struct qla_hw_data *ha = vha->hw; + ssize_t rval; + char *spd[7] = {"0", "0", "0", "4", "8", "16", "32"}; + + rval = qla2x00_get_data_rate(vha); + if (rval != QLA_SUCCESS) { + ql_log(ql_log_warn, vha, 0x70db, + "Unable to get port speed rval:%zd\n", rval); + return -EINVAL; + } + + ql_log(ql_log_info, vha, 0x70d6, + "port speed:%d\n", ha->link_data_rate); + + rval = memory_read_from_buffer(buf, count, + &off, spd[ha->link_data_rate], sizeof(ha->link_data_rate)); + + return rval; +} + +static struct bin_attribute sysfs_port_speed_attr = { + .attr = { + .name = "port_speed", + .mode = 0600, + }, + .size = 16, + .write = qla2x00_sysfs_set_port_speed, + .read = qla2x00_sysfs_get_port_speed, +}; + +static ssize_t qla2x00_sysfs_write_reset(struct file *filp, struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) @@ -943,6 +1045,7 @@ static struct sysfs_entry { { "issue_logo", &sysfs_issue_logo_attr, }, { "xgmac_stats", &sysfs_xgmac_stats_attr, 3 }, { "dcbx_tlv", &sysfs_dcbx_tlv_attr, 3 }, + { "port_speed", &sysfs_port_speed_attr, }, { NULL }, }; diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index c256ba7fba84..c0f7593666a1 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -3698,12 +3698,14 @@ struct qla_hw_data { #define PORT_SPEED_UNKNOWN 0xFFFF #define PORT_SPEED_1GB 0x00 #define PORT_SPEED_2GB 0x01 +#define PORT_SPEED_AUTO 0x02 #define PORT_SPEED_4GB 0x03 #define PORT_SPEED_8GB 0x04 #define PORT_SPEED_16GB 0x05 #define PORT_SPEED_32GB 0x06 #define PORT_SPEED_10GB 0x13 uint16_t link_data_rate; /* F/W operating speed */ + uint16_t set_data_rate; /* Set by user */ uint8_t current_topology; uint8_t prev_topology; @@ -4232,6 +4234,10 @@ struct qla_hw_data { #define FW_ABILITY_MAX_SPEED(ha) \ (ha->fw_ability_mask & FW_ABILITY_MAX_SPEED_MASK) +#define QLA_GET_DATA_RATE 0 +#define QLA_SET_DATA_RATE_NOLR 1 +#define QLA_SET_DATA_RATE_LR 2 /* Set speed and initiate LR */ + /* * Qlogic scsi host structure */ diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index bcc17a7261e7..3c59006e64bb 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -899,5 +899,6 @@ void qlt_update_host_map(struct scsi_qla_host *, port_id_t); void qlt_remove_target_resources(struct qla_hw_data *); void qlt_clr_qp_table(struct scsi_qla_host *vha); void qlt_set_mode(struct scsi_qla_host *); +int qla2x00_set_data_rate(scsi_qla_host_t *vha, uint16_t mode); #endif /* _QLA_GBL_H */ diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index ba5da365ee4a..bb9bccb734f8 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -3880,8 +3880,17 @@ qla24xx_config_rings(struct scsi_qla_host *vha) WRT_REG_DWORD(®->isp24.rsp_q_in, 0); WRT_REG_DWORD(®->isp24.rsp_q_out, 0); } + qlt_24xx_config_rings(vha); + /* If the user has configured the speed, set it here */ + if (ha->set_data_rate) { + ql_dbg(ql_dbg_init, vha, 0x00fd, + "Speed set by user : %s Gbps \n", + qla2x00_get_link_speed_str(ha, ha->set_data_rate)); + icb->firmware_options_3 = (ha->set_data_rate << 13); + } + /* PCI posting */ RD_REG_DWORD(&ioreg->hccr); } diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 6c911f2e4cdb..913dc36c48bc 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -5250,6 +5250,66 @@ qla81xx_write_mpi_register(scsi_qla_host_t *vha, uint16_t *mb) return rval; } +/* Set the specified data rate */ +int +qla2x00_set_data_rate(scsi_qla_host_t *vha, uint16_t mode) +{ + int rval; + mbx_cmd_t mc; + mbx_cmd_t *mcp = &mc; + struct qla_hw_data *ha = vha->hw; + uint16_t val; + + ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1106, + "Entered %s speed:0x%x mode:0x%x.\n", __func__, ha->set_data_rate, + mode); + + if (!IS_FWI2_CAPABLE(ha)) + return QLA_FUNCTION_FAILED; + + memset(mcp, 0, sizeof(mbx_cmd_t)); + switch (ha->set_data_rate) { + case PORT_SPEED_AUTO: + case PORT_SPEED_4GB: + case PORT_SPEED_8GB: + case PORT_SPEED_16GB: + case PORT_SPEED_32GB: + val = ha->set_data_rate; + break; + default: + ql_log(ql_log_warn, vha, 0x1199, + "Unrecognized speed setting:%d. Setting Autoneg\n", + ha->set_data_rate); + val = ha->set_data_rate = PORT_SPEED_AUTO; + break; + } + + mcp->mb[0] = MBC_DATA_RATE; + mcp->mb[1] = mode; + mcp->mb[2] = val; + + mcp->out_mb = MBX_2|MBX_1|MBX_0; + mcp->in_mb = MBX_2|MBX_1|MBX_0; + if (IS_QLA83XX(ha) || IS_QLA27XX(ha)) + mcp->in_mb |= MBX_4|MBX_3; + mcp->tov = MBX_TOV_SECONDS; + mcp->flags = 0; + rval = qla2x00_mailbox_command(vha, mcp); + if (rval != QLA_SUCCESS) { + ql_dbg(ql_dbg_mbx, vha, 0x1107, + "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); + } else { + if (mcp->mb[1] != 0x7) + ql_dbg(ql_dbg_mbx, vha, 0x1179, + "Speed set:0x%x\n", mcp->mb[1]); + + ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1108, + "Done %s.\n", __func__); + } + + return rval; +} + int qla2x00_get_data_rate(scsi_qla_host_t *vha) { @@ -5265,7 +5325,7 @@ qla2x00_get_data_rate(scsi_qla_host_t *vha) return QLA_FUNCTION_FAILED; mcp->mb[0] = MBC_DATA_RATE; - mcp->mb[1] = 0; + mcp->mb[1] = QLA_GET_DATA_RATE; mcp->out_mb = MBX_1|MBX_0; mcp->in_mb = MBX_2|MBX_1|MBX_0; if (IS_QLA83XX(ha) || IS_QLA27XX(ha)) From patchwork Tue Feb 12 23:40:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10808957 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DFE491390 for ; Tue, 12 Feb 2019 23:42:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE3792C080 for ; Tue, 12 Feb 2019 23:42:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C28E72C0AD; Tue, 12 Feb 2019 23:42:21 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 5DA652C080 for ; Tue, 12 Feb 2019 23:42:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729383AbfBLXmU (ORCPT ); Tue, 12 Feb 2019 18:42:20 -0500 Received: from mail-eopbgr710085.outbound.protection.outlook.com ([40.107.71.85]:58112 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729139AbfBLXmU (ORCPT ); Tue, 12 Feb 2019 18:42:20 -0500 Received: from DM6PR07CA0001.namprd07.prod.outlook.com (2603:10b6:5:94::14) by BY1PR0701MB1925.namprd07.prod.outlook.com (2a01:111:e400:51ab::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.19; Tue, 12 Feb 2019 23:42:18 +0000 Received: from CO1NAM05FT009.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::205) by DM6PR07CA0001.outlook.office365.com (2603:10b6:5:94::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Tue, 12 Feb 2019 23:42:17 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by CO1NAM05FT009.mail.protection.outlook.com (10.152.96.116) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Tue, 12 Feb 2019 23:42:17 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Tue, 12 Feb 2019 15:41:09 -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 x1CNf9FB029882; Tue, 12 Feb 2019 15:41:09 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1CNf9DX029881; Tue, 12 Feb 2019 15:41:09 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 07/12] qla2xxx: Prevent SysFS access when chip is down Date: Tue, 12 Feb 2019 15:40:41 -0800 Message-ID: <20190212234046.29809-8-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190212234046.29809-1-hmadhani@marvell.com> References: <20190212234046.29809-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131944885375876907;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(376002)(346002)(136003)(396003)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(53936002)(76176011)(105606002)(1076003)(110136005)(16586007)(42186006)(4326008)(106466001)(51416003)(86362001)(126002)(6666004)(87636003)(498600001)(54906003)(2616005)(11346002)(356004)(26826003)(69596002)(80596001)(446003)(476003)(336012)(486006)(97736004)(2906002)(85426001)(68736007)(50466002)(305945005)(48376002)(8936002)(36906005)(316002)(50226002)(26005)(36756003)(81156014)(81166006)(47776003)(8676002);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR0701MB1925;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT009;1:YrOzEwEh9NCoBd4N1oSTF7rPpqbwaSp2kaAmy3yDCL3syMQD7j0iZAAgJ62gBYw+yVEmvDbsA6GB3T8U5wTjXHizJzi01ZFHY2Dx9wvKfw2Sganz99Cma+GkgOiyVMRaB4meaOrc3XPBV/ipc25CMRvWiT9hK/wb2PTDMx0jrvk= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 20d8805d-ad24-46dc-c9ce-08d69143b938 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:BY1PR0701MB1925; X-MS-TrafficTypeDiagnostic: BY1PR0701MB1925: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0946DC87A1 X-Microsoft-Exchange-Diagnostics: 1;BY1PR0701MB1925;23:Hn9YMibhezHmBSqTcN+7ua0QoZDn/v39j/05B7F87BK4TI4II0pxvLD6yc9tPJiLkvLZXxXSWJecmM62dFqquCCY+8x/hRowfwqF5K8WPufLC8cxsN/wy8I89T9DpBhXRE+gt2mOd6kaMp9C9afJfJATvFVThosp7vr6Iw7GjopEA8KkAtyraM6qFBmKoPYHybip2p58Mvn1fmbpqaXvKAOFxzEgR/a5Fugsfvfea95OGKGBnqQtqYZ3npKILUk35XbyhM1Adh4w7cuItqn2xOnxGIO24zb+EOixW+nWr+OPQoh7ZNQPtYerqqwUGZ0zyALf3dotz+2Cjr4bykfQGm5i5C2D/k/BzIn4dzQh3fbAoftfGU2Dbth5FemevzKybBMLZipaRfiIZmpembojr9LdEQjZubqx2Wu+MlT6+pavVVpj3IU1NUzwSOeDJbA0p+6wxwKcTAhSlEnb/vQBrvg1piwS/gE6XGtwPu7JS0+xsrmohgRSitjmxhOp9w7JYaO6ATzZxOzWbJmANAzucgZSsly/bQTCUUtuS+qmzacXxBqrkLxuVUJzDx8iIApriDBDMPbIjvUtTt84u8u7vgIaqihfDxl7qtnA/f4roFcOGGRiqGzHa6MZSNwMD+nGxiDZXMKgY5qntiyc4wcUKX6+OOjgZMAkcxVaJ4bw+YKzlVuLjCTW7WP2PBe/JYBI8MgWgJmEALkUZOW4QpiLaWlcLVb/2nYpPiosBldGX+vRif/89RDJI78ZmraGunq6owz03ywHeH7cMTGjUnC7aj0BfaJKq+LRvI8xbYtEW4llVkPi+sd0znrFfn5VsU/p7OynN1t3ArTNY1U1tzs8H7H6w6lrzDah7qe5A7SHsHOkEEvKQnsxxkxbpXTcg43dTClBsbKZs0ltlrwQ/EjUIEzDUN6npw1WHp1Sc98rYicnhqs8Ic3296sqaEnv5EIjPJJkm+rqfSpaIoCqJpzptb9CDK/Gketix7RRoBjG76hNlfhN1BgFe/dFwbq6ZMs7VM0RSyPkfKNZAJQsUPSPGICsA/TWSZU6/KBL2EoZu781NRToJrP8XG20TBCmgpicJJ/co/M12bm7a3zoEaIQ1efJhZSgkX29NDAuOQqKhWqIZJqRauJEGAdPVXwQC3v+XYGB+2Kuw6tSTKzpPnMYSl3URrnG6BwDuPqq8eSkVnDOvad4kw8IE5778OLCcyMs X-Microsoft-Antispam-Message-Info: ZcLk0ozSv/ynX7mhn3scV+tyFvmk1DuDzbBr3tsZX6UwcJWyEyrcB7QSs1bsrc5MAr+A4Z624hW8BOjtkqjk0SI0o6KjtoqYQQAhdKk+Y3zp9ImGwW6iYVJ6xI8TB6GSkT5/4I0P5B6sF3HazHgA9RcmsZ9jPwJw7BgcAARkTlscHjazccMWrcMO7o3l66tGGHbV5nf+cbt2TZJvbPMUaZzSvCPl1PKtnR5WG0b8KkPkv8AroZun6xaxAzPkiAhiqWaQ003QlCvqXQRCNJBdgsdsIwHai0BbZS3qMaVJNEj75wbdxZRGBVE4/IlmBpNmN9bd9a+KYHGwn21L61HWA/3UgSSp98/BmuCv3xGgR3LIYCS547cIE6fScR1AHR5GEhDI3UTcuhygWLHNMen6/huQec0oniIeInhyvdKb014= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2019 23:42:17.2894 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 20d8805d-ad24-46dc-c9ce-08d69143b938 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1925 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 Prevent user from sending commands through SysFS while FW is not running or reset is in progress. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_attr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index dcdfcf3bc955..c4a129d049f5 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -543,6 +543,9 @@ qla2x00_sysfs_write_vpd(struct file *filp, struct kobject *kobj, if (unlikely(pci_channel_offline(ha->pdev))) return 0; + if (qla2x00_chip_is_down(vha)) + return 0; + if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size || !ha->isp_ops->write_nvram) return 0; @@ -993,6 +996,9 @@ qla2x00_sysfs_read_dcbx_tlv(struct file *filp, struct kobject *kobj, return 0; } + if (qla2x00_chip_is_down(vha)) + return 0; + ha->dcbx_tlv = dma_alloc_coherent(&ha->pdev->dev, DCBX_TLV_DATA_SIZE, &ha->dcbx_tlv_dma, GFP_KERNEL); if (!ha->dcbx_tlv) { From patchwork Tue Feb 12 23:40:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10808959 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1571817FB for ; Tue, 12 Feb 2019 23:42:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 046B12C080 for ; Tue, 12 Feb 2019 23:42:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED24B2C083; Tue, 12 Feb 2019 23:42:21 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 885F52C082 for ; Tue, 12 Feb 2019 23:42:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729458AbfBLXmU (ORCPT ); Tue, 12 Feb 2019 18:42:20 -0500 Received: from mail-eopbgr740054.outbound.protection.outlook.com ([40.107.74.54]:46309 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728924AbfBLXmU (ORCPT ); Tue, 12 Feb 2019 18:42:20 -0500 Received: from DM6PR07CA0001.namprd07.prod.outlook.com (2603:10b6:5:94::14) by CY4PR07MB2901.namprd07.prod.outlook.com (2603:10b6:903:2e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Tue, 12 Feb 2019 23:42:16 +0000 Received: from CO1NAM05FT009.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::205) by DM6PR07CA0001.outlook.office365.com (2603:10b6:5:94::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Tue, 12 Feb 2019 23:42:16 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by CO1NAM05FT009.mail.protection.outlook.com (10.152.96.116) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Tue, 12 Feb 2019 23:42:16 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Tue, 12 Feb 2019 15:41:12 -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 x1CNfCij029886; Tue, 12 Feb 2019 15:41:12 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1CNfCff029885; Tue, 12 Feb 2019 15:41:12 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 08/12] qla2xxx: Add workqueue to delete fcport from bsg sp->free(). Date: Tue, 12 Feb 2019 15:40:42 -0800 Message-ID: <20190212234046.29809-9-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190212234046.29809-1-hmadhani@marvell.com> References: <20190212234046.29809-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131944885367310108;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(376002)(396003)(346002)(39860400002)(136003)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(106466001)(446003)(486006)(4326008)(11346002)(80596001)(1076003)(105606002)(498600001)(2906002)(26826003)(476003)(2616005)(85426001)(87636003)(126002)(76176011)(51416003)(68736007)(50226002)(336012)(356004)(14444005)(6666004)(36756003)(81156014)(8676002)(69596002)(316002)(81166006)(36906005)(8936002)(305945005)(54906003)(86362001)(53936002)(47776003)(48376002)(26005)(50466002)(97736004)(16586007)(110136005)(42186006);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR07MB2901;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT009;1:am6mAERud3urtSXPAk0ZIx2u6juFsHZ3k76qY43yMowhrLyl1NisqSHue4RvPBc6fOmhsV7ng5+2vwQPio5TUDqd6vcMfaMM2PKGtYF2AoJWjbsW8m0sStikk3mXoWq+DfTpuROvHhTXbYZBBt+HVxgdQzelLRtPf/E056FCmXU= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 72292c4d-006f-4ffc-11d8-08d69143b8b6 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:CY4PR07MB2901; X-MS-TrafficTypeDiagnostic: CY4PR07MB2901: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0946DC87A1 X-Microsoft-Exchange-Diagnostics: 1;CY4PR07MB2901;23:Ei8+QIMe1h6TQdViQsRDYgtUFMRbLFykEjxMFLMVoTsj2Ms5gsfmmpkSYzBJvq4Qvt8PYx/447BbHCASfrH4+yGHuRSUWqSmnkEFDtRGIderEcHGPT4xYKeaPa0MsEUzjW6vYeOmM/7H+h880s0eMT6J1VMSxLkQrSxXuqWwqbM/PrgP05VwNJT1kcjeNoUFJuR2PZeONOguu3w53iC8el7ICDCoPvIoSF82a2SdrQNL1GQMKiK0utuhxB5eZafV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o3g7HpdHfyzaHPJaICllVerXTl8bBeTTetndDZ7eYU+6Ob6lxCIJrlTzXDD+xJrJXU8clnx7xFgzm50PDW0yat7dtX6xVSotdl8ZnGjwLrU1TMnkRx/XlXfGIaAHVztrw2FXWsMUBUJ3qVuYc2Xq2KJcwmXxJO8i1UHGQCNmgZsPiiwkFph5CCvtk/jvBp3/udJbY0pIMrJMOAi9zpBxJUtkICrlJYPokB1HBV9Rg2oV4lPcxxqsLHrHwsq1kx7y3kpuDQ3uvfI3WhhqJTtrTz/Cn04WlbzPNupGJQMoy5k6yiJfgVzb+Codd0aXF6ah76JR7speeUIIIMFdGewTwjus= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2019 23:42:16.4357 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 72292c4d-006f-4ffc-11d8-08d69143b8b6 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB2901 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: Joe Carnuccio This patch adds workqueue mechanism for deleting fcport via BSG interface. Signed-off-by: Joe Carnuccio Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_bsg.c | 18 +++++++++++++++++- drivers/scsi/qla2xxx/qla_def.h | 1 + drivers/scsi/qla2xxx/qla_os.c | 11 +++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c index 4a9fd8d944d6..d9b6af975691 100644 --- a/drivers/scsi/qla2xxx/qla_bsg.c +++ b/drivers/scsi/qla2xxx/qla_bsg.c @@ -11,6 +11,14 @@ #include #include +static void qla2xxx_free_fcport_work(struct work_struct *work) +{ + struct fc_port *fcport = container_of(work, typeof(*fcport), + free_work); + + qla2x00_free_fcport(fcport); +} + /* BSG support for ELS/CT pass through */ void qla2x00_bsg_job_done(void *ptr, int res) @@ -57,8 +65,16 @@ qla2x00_bsg_sp_free(void *ptr) if (sp->type == SRB_CT_CMD || sp->type == SRB_FXIOCB_BCMD || - sp->type == SRB_ELS_CMD_HST) + sp->type == SRB_ELS_CMD_HST) { + if (ha->free_fcport) { + INIT_WORK(&sp->fcport->free_work, + qla2xxx_free_fcport_work); + queue_work(ha->free_fcport, &sp->fcport->free_work); + goto done; + } kfree(sp->fcport); + } +done: qla2x00_rel_sp(sp); } diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index c0f7593666a1..a0304746e8a5 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -4190,6 +4190,7 @@ struct qla_hw_data { struct work_struct idc_state_handler; struct work_struct nic_core_unrecoverable; struct work_struct board_disable; + struct workqueue_struct *free_fcport; struct mr_data_fx00 mr; uint32_t chip_reset; diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 7bf23943c815..8bc60ba7fd13 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -3196,6 +3196,12 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) host->max_cmd_len, host->max_channel, host->max_lun, host->transportt, sht->vendor_id); + ha->free_fcport = create_workqueue("free_fcport"); + if (!ha->free_fcport) { + ql_log(ql_log_info, base_vha, 0xee00, + "Failed to allocate workqueue ha->free_fcport\n"); + } + INIT_WORK(&base_vha->iocb_work, qla2x00_iocb_work_fn); /* Set up the irqs */ @@ -3650,6 +3656,11 @@ qla2x00_destroy_deferred_work(struct qla_hw_data *ha) ha->dpc_hp_wq = NULL; } + if (ha->free_fcport) { + destroy_workqueue(ha->free_fcport); + ha->free_fcport = NULL; + } + /* Kill the kernel thread for this host */ if (ha->dpc_thread) { struct task_struct *t = ha->dpc_thread; From patchwork Tue Feb 12 23:40:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10808965 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4DB5C13A4 for ; Tue, 12 Feb 2019 23:42:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 382C02C080 for ; Tue, 12 Feb 2019 23:42:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C82B2C083; Tue, 12 Feb 2019 23:42:30 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 3F3472C082 for ; Tue, 12 Feb 2019 23:42:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732454AbfBLXm1 (ORCPT ); Tue, 12 Feb 2019 18:42:27 -0500 Received: from mail-eopbgr740045.outbound.protection.outlook.com ([40.107.74.45]:42784 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732236AbfBLXm0 (ORCPT ); Tue, 12 Feb 2019 18:42:26 -0500 Received: from DM6PR07CA0010.namprd07.prod.outlook.com (2603:10b6:5:94::23) by CY4PR07MB2901.namprd07.prod.outlook.com (2603:10b6:903:2e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Tue, 12 Feb 2019 23:42:23 +0000 Received: from CO1NAM05FT047.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::203) by DM6PR07CA0010.outlook.office365.com (2603:10b6:5:94::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16 via Frontend Transport; Tue, 12 Feb 2019 23:42:23 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by CO1NAM05FT047.mail.protection.outlook.com (10.152.96.162) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Tue, 12 Feb 2019 23:42:23 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Tue, 12 Feb 2019 15:41:15 -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 x1CNfFsY029890; Tue, 12 Feb 2019 15:41:15 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1CNfFa8029889; Tue, 12 Feb 2019 15:41:15 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 09/12] qla2xxx: Move marker request behind QPair Date: Tue, 12 Feb 2019 15:40:43 -0800 Message-ID: <20190212234046.29809-10-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190212234046.29809-1-hmadhani@marvell.com> References: <20190212234046.29809-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131944885434415122;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(376002)(396003)(346002)(39860400002)(136003)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(106466001)(446003)(486006)(4326008)(11346002)(80596001)(1076003)(105606002)(498600001)(2906002)(26826003)(476003)(2616005)(85426001)(87636003)(126002)(76176011)(51416003)(68736007)(50226002)(336012)(356004)(14444005)(6666004)(36756003)(81156014)(8676002)(69596002)(316002)(30864003)(81166006)(36906005)(8936002)(305945005)(54906003)(86362001)(53936002)(47776003)(48376002)(26005)(50466002)(97736004)(16586007)(110136005)(42186006);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR07MB2901;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT047;1:UsJU8RBgEP0HALAWY/lMvg6ozRwpjvwhS5c1vrgG3yRz3EHRaNrR4MoCcm0LeQo37KS9s+jK+KgZANawa+7wmS8DS/UOtotbUjHbqBiGJLXum+WAV0xADkk1wUJUG8QHjJb1/CZ8bJ1ZYSLAXl6Y7gjG21cMWQQzvf+TnCHwgs8= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b266045c-0695-43b4-02ce-08d69143bcb6 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:CY4PR07MB2901; X-MS-TrafficTypeDiagnostic: CY4PR07MB2901: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0946DC87A1 X-Microsoft-Exchange-Diagnostics: 1;CY4PR07MB2901;23:nsWMT2JM6MmbOFZo9xQw3FKKmNS/6Bs07IuzwEYJWHUhdw/eJC9wlgKrT5kIobtGl012/3pFlsq+uekjkELdRT1OXH6Cojg1vmC9rmiIASJdADlNa6dAM9DLiZXo5ShN9GAwwLH9uN8YgfJf6XrE41r8kPs66gl1O/+30H6rK37EJ/drieZzRpGuyQ9QEwUQ/xB5dzlCrNoRjiVouOCUPKIh17KaCNotQa2hpPrc2sn+CcEx3YhNvZl7/0uWoAGtIPF7ROUPfe28wdHBVvLxCMbxL5vrqEq130cclKnuhSMRcv7dbmPje7aM0KnoagGjhgQH0IuEsZRswln38rjgPV5at8pZpIH9XOvubZqmQJcH9a6SEHwdln9EZBu2lR8lCmoHaiT0iKHIvc5CxZDQX1yKaJYfKB5BpZzJyLUGygOUm0dp4XE6NrOikC6cBO54ukymzJYOvhMFe5F5AOcrFB9ewt+dBLXTBJCY07Se4Tcgb2e4adhlBpr2bXy3irefW6xn+fyI8PxzEqZ/1Z0A1MOecskl4VBTwBMPSHvTcy0wfxFilbSlXOdGAijg4NVg12utScM6ylnWr7Lb9x2SQFSjg34+5r+I7lliFSvzDjbkb2zRSieE5AG78jf8umMEzrbhum3L8mvxP8wmoxvZddSQlZR1e4VAKH6JbNBKeOdPaiMoIeEEO6bijhey7FKRvmuWYhxp+DdyraeBV+uWJt3ZwXI9oETsrsSQliZVql7kSDd99uBGzILZTHTUxxtoYh+hI/HWHXJjSJohBjkwzTnVhhd8KHxDMWL/xb+SR3lPqbY4VrzK+1yEzOKi9kNo8hih4NVYVeimJVp8tu4dRzjPefXT3F+xnzMXX9q9PWwkbg99XTQjWg1GVrbZMTHYqm0BIK0OeojC92JmKWxCeL7WffuJo583tM+mQxOOyyj8aMu02KqNVq0i89nf+j0+OdikVfgNg3416E+3Hy77ed24EgQrTj2o9g8XJq+P/dJPlf4BOVlXbOdkmIyXnFL5VhPLslgYENCrdf5YyDM0+Txd/r8INn9KjklNyphDnEttoZuaatUCXO0UWcBZto3fhFozfmluP0a4GEip6L1BPNd8qMiyCHy1PDmf+uo3yVqpMKTh6FbY7nUBOcYDEuCSP8IfKnmh7a3NbafKEZAX3SI91Ii7wXBTbIwbiteoU5J6uLl+evdEHj2cxn2tDSrkBAvSPpcgPI+l0aCfhdhSLa42hquEhKuTpbHGSur76Wo= X-Microsoft-Antispam-Message-Info: J8XLzkycCFhGj8VSo1Hrhk/5Dr09gEPdwJ5ZbxQHj+NvPyR2+KSRkwJc0q1gM9AQHjqbw0sI16bGmQKVZh0ZdBhlv4k6fK7qo4miR9yzUudXSbBfQ8j7y//CHnx3CwydTlNXXmtMa0QSDlL1W100Ig1R9jeYMOZz747nWTBiZD1xeGqXs6CjsUFS4eLtka+OKzH4SRzzi/UyVSSLSXrXpt6LvHfkO2MAtMCfOjdd729wv13fdszPmZ8TxMFoGUa1JFoPJrePyVoq8AD9VPYi6MsK7nlaxGhS/MkuEDOSTsDt3Rhh9y9Pjcvu0jHWih4SfaD12VOQhs0XqTi7RtvWgEZMEQxX2HjqTJ8I748PW4eMD54/Fa7m+TvMFWpwcMyxIgoNtCGLg1tzSsbxySYFMy/eVy1Chi19Qy0K0LYtbZA= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2019 23:42:23.0912 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b266045c-0695-43b4-02ce-08d69143bcb6 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB2901 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 current code hard code marker request to use request and response queue 0. This patch make use of the qpair as the path to access the request/response queues. It allows marker to be place on any hardware queues. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_gbl.h | 4 ++-- drivers/scsi/qla2xxx/qla_init.c | 30 ++++++------------------- drivers/scsi/qla2xxx/qla_iocb.c | 50 +++++++++++++++++------------------------ drivers/scsi/qla2xxx/qla_mbx.c | 18 +++------------ 4 files changed, 33 insertions(+), 69 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 3c59006e64bb..4eefe69ca807 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -270,8 +270,8 @@ extern void qla24xx_build_scsi_iocbs(srb_t *, struct cmd_type_7 *, uint16_t, struct req_que *); extern int qla2x00_start_scsi(srb_t *sp); extern int qla24xx_start_scsi(srb_t *sp); -int qla2x00_marker(struct scsi_qla_host *, struct req_que *, struct rsp_que *, - uint16_t, uint64_t, uint8_t); +int qla2x00_marker(struct scsi_qla_host *, struct qla_qpair *, + uint16_t, uint64_t, uint8_t); extern int qla2x00_start_sp(srb_t *); extern int qla24xx_dif_start_scsi(srb_t *); extern int qla2x00_start_bidir(srb_t *, struct scsi_qla_host *, uint32_t); diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index bb9bccb734f8..a95915881c87 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1703,8 +1703,8 @@ qla2x00_async_tm_cmd(fc_port_t *fcport, uint32_t flags, uint32_t lun, lun = (uint16_t)tm_iocb->u.tmf.lun; /* Issue Marker IOCB */ - qla2x00_marker(vha, vha->hw->req_q_map[0], - vha->hw->rsp_q_map[0], sp->fcport->loop_id, lun, + qla2x00_marker(vha, vha->hw->base_qpair, + sp->fcport->loop_id, lun, flags == TCF_LUN_RESET ? MK_SYNC_ID_LUN : MK_SYNC_ID); } @@ -6039,11 +6039,6 @@ qla2x00_loop_resync(scsi_qla_host_t *vha) { int rval = QLA_SUCCESS; uint32_t wait_time; - struct req_que *req; - struct rsp_que *rsp; - - req = vha->req; - rsp = req->rsp; clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); if (vha->flags.online) { @@ -6056,8 +6051,8 @@ qla2x00_loop_resync(scsi_qla_host_t *vha) * Issue a marker after FW becomes * ready. */ - qla2x00_marker(vha, req, rsp, 0, 0, - MK_SYNC_ALL); + qla2x00_marker(vha, vha->hw->base_qpair, + 0, 0, MK_SYNC_ALL); vha->marker_needed = 0; } @@ -6795,8 +6790,6 @@ qla2x00_restart_isp(scsi_qla_host_t *vha) { int status = 0; struct qla_hw_data *ha = vha->hw; - struct req_que *req = ha->req_q_map[0]; - struct rsp_que *rsp = ha->rsp_q_map[0]; /* If firmware needs to be loaded */ if (qla2x00_isp_firmware(vha)) { @@ -6816,7 +6809,7 @@ qla2x00_restart_isp(scsi_qla_host_t *vha) status = qla2x00_fw_ready(vha); if (!status) { /* Issue a marker after FW becomes ready. */ - qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL); + qla2x00_marker(vha, ha->base_qpair, 0, 0, MK_SYNC_ALL); set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); } @@ -7871,22 +7864,15 @@ qla24xx_configure_vhba(scsi_qla_host_t *vha) uint16_t mb[MAILBOX_REGISTER_COUNT]; struct qla_hw_data *ha = vha->hw; struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); - struct req_que *req; - struct rsp_que *rsp; if (!vha->vp_idx) return -EINVAL; rval = qla2x00_fw_ready(base_vha); - if (vha->qpair) - req = vha->qpair->req; - else - req = ha->req_q_map[0]; - rsp = req->rsp; if (rval == QLA_SUCCESS) { clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); - qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL); + qla2x00_marker(vha, ha->base_qpair, 0, 0, MK_SYNC_ALL); } vha->flags.management_server_logged_in = 0; @@ -8278,8 +8264,6 @@ qla82xx_restart_isp(scsi_qla_host_t *vha) { int status, rval; struct qla_hw_data *ha = vha->hw; - struct req_que *req = ha->req_q_map[0]; - struct rsp_que *rsp = ha->rsp_q_map[0]; struct scsi_qla_host *vp; unsigned long flags; @@ -8291,7 +8275,7 @@ qla82xx_restart_isp(scsi_qla_host_t *vha) status = qla2x00_fw_ready(vha); if (!status) { /* Issue a marker after FW becomes ready. */ - qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL); + qla2x00_marker(vha, ha->base_qpair, 0, 0, MK_SYNC_ALL); vha->flags.online = 1; set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); } diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index cdac282b5bd3..63f8e3c19841 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -336,7 +336,7 @@ qla2x00_start_scsi(srb_t *sp) /* Send marker if required */ if (vha->marker_needed != 0) { - if (qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL) != + if (qla2x00_marker(vha, ha->base_qpair, 0, 0, MK_SYNC_ALL) != QLA_SUCCESS) { return (QLA_FUNCTION_FAILED); } @@ -490,8 +490,7 @@ qla2x00_start_iocbs(struct scsi_qla_host *vha, struct req_que *req) /** * qla2x00_marker() - Send a marker IOCB to the firmware. * @vha: HA context - * @req: request queue - * @rsp: response queue + * @qpair: queue pair pointer * @loop_id: loop ID * @lun: LUN * @type: marker modifier @@ -501,18 +500,16 @@ qla2x00_start_iocbs(struct scsi_qla_host *vha, struct req_que *req) * Returns non-zero if a failure occurred, else zero. */ static int -__qla2x00_marker(struct scsi_qla_host *vha, struct req_que *req, - struct rsp_que *rsp, uint16_t loop_id, - uint64_t lun, uint8_t type) +__qla2x00_marker(struct scsi_qla_host *vha, struct qla_qpair *qpair, + uint16_t loop_id, uint64_t lun, uint8_t type) { mrk_entry_t *mrk; struct mrk_entry_24xx *mrk24 = NULL; - + struct req_que *req = qpair->req; struct qla_hw_data *ha = vha->hw; scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev); - req = ha->req_q_map[0]; - mrk = (mrk_entry_t *)qla2x00_alloc_iocbs(vha, NULL); + mrk = (mrk_entry_t *)__qla2x00_alloc_iocbs(qpair, NULL); if (mrk == NULL) { ql_log(ql_log_warn, base_vha, 0x3026, "Failed to allocate Marker IOCB.\n"); @@ -543,16 +540,15 @@ __qla2x00_marker(struct scsi_qla_host *vha, struct req_que *req, } int -qla2x00_marker(struct scsi_qla_host *vha, struct req_que *req, - struct rsp_que *rsp, uint16_t loop_id, uint64_t lun, - uint8_t type) +qla2x00_marker(struct scsi_qla_host *vha, struct qla_qpair *qpair, + uint16_t loop_id, uint64_t lun, uint8_t type) { int ret; unsigned long flags = 0; - spin_lock_irqsave(&vha->hw->hardware_lock, flags); - ret = __qla2x00_marker(vha, req, rsp, loop_id, lun, type); - spin_unlock_irqrestore(&vha->hw->hardware_lock, flags); + spin_lock_irqsave(qpair->qp_lock_ptr, flags); + ret = __qla2x00_marker(vha, qpair, loop_id, lun, type); + spin_unlock_irqrestore(qpair->qp_lock_ptr, flags); return (ret); } @@ -567,11 +563,11 @@ qla2x00_marker(struct scsi_qla_host *vha, struct req_que *req, int qla2x00_issue_marker(scsi_qla_host_t *vha, int ha_locked) { if (ha_locked) { - if (__qla2x00_marker(vha, vha->req, vha->req->rsp, 0, 0, + if (__qla2x00_marker(vha, vha->hw->base_qpair, 0, 0, MK_SYNC_ALL) != QLA_SUCCESS) return QLA_FUNCTION_FAILED; } else { - if (qla2x00_marker(vha, vha->req, vha->req->rsp, 0, 0, + if (qla2x00_marker(vha, vha->hw->base_qpair, 0, 0, MK_SYNC_ALL) != QLA_SUCCESS) return QLA_FUNCTION_FAILED; } @@ -1627,21 +1623,19 @@ qla24xx_start_scsi(srb_t *sp) uint16_t req_cnt; uint16_t tot_dsds; struct req_que *req = NULL; - struct rsp_que *rsp = NULL; struct scsi_cmnd *cmd = GET_CMD_SP(sp); struct scsi_qla_host *vha = sp->vha; struct qla_hw_data *ha = vha->hw; /* Setup device pointers. */ req = vha->req; - rsp = req->rsp; /* So we know we haven't pci_map'ed anything yet */ tot_dsds = 0; /* Send marker if required */ if (vha->marker_needed != 0) { - if (qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL) != + if (qla2x00_marker(vha, ha->base_qpair, 0, 0, MK_SYNC_ALL) != QLA_SUCCESS) return QLA_FUNCTION_FAILED; vha->marker_needed = 0; @@ -1794,7 +1788,7 @@ qla24xx_dif_start_scsi(srb_t *sp) /* Send marker if required */ if (vha->marker_needed != 0) { - if (qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL) != + if (qla2x00_marker(vha, ha->base_qpair, 0, 0, MK_SYNC_ALL) != QLA_SUCCESS) return QLA_FUNCTION_FAILED; vha->marker_needed = 0; @@ -1965,7 +1959,6 @@ qla2xxx_start_scsi_mq(srb_t *sp) uint16_t req_cnt; uint16_t tot_dsds; struct req_que *req = NULL; - struct rsp_que *rsp = NULL; struct scsi_cmnd *cmd = GET_CMD_SP(sp); struct scsi_qla_host *vha = sp->fcport->vha; struct qla_hw_data *ha = vha->hw; @@ -1975,7 +1968,6 @@ qla2xxx_start_scsi_mq(srb_t *sp) spin_lock_irqsave(&qpair->qp_lock, flags); /* Setup qpair pointers */ - rsp = qpair->rsp; req = qpair->req; /* So we know we haven't pci_map'ed anything yet */ @@ -1983,7 +1975,7 @@ qla2xxx_start_scsi_mq(srb_t *sp) /* Send marker if required */ if (vha->marker_needed != 0) { - if (__qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL) != + if (__qla2x00_marker(vha, qpair, 0, 0, MK_SYNC_ALL) != QLA_SUCCESS) { spin_unlock_irqrestore(&qpair->qp_lock, flags); return QLA_FUNCTION_FAILED; @@ -2151,7 +2143,7 @@ qla2xxx_dif_start_scsi_mq(srb_t *sp) /* Send marker if required */ if (vha->marker_needed != 0) { - if (__qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL) != + if (__qla2x00_marker(vha, qpair, 0, 0, MK_SYNC_ALL) != QLA_SUCCESS) { spin_unlock_irqrestore(&qpair->qp_lock, flags); return QLA_FUNCTION_FAILED; @@ -3205,8 +3197,8 @@ qla82xx_start_scsi(srb_t *sp) /* Send marker if required */ if (vha->marker_needed != 0) { - if (qla2x00_marker(vha, req, - rsp, 0, 0, MK_SYNC_ALL) != QLA_SUCCESS) { + if (qla2x00_marker(vha, ha->base_qpair, + 0, 0, MK_SYNC_ALL) != QLA_SUCCESS) { ql_log(ql_log_warn, vha, 0x300c, "qla2x00_marker failed for cmd=%p.\n", cmd); return QLA_FUNCTION_FAILED; @@ -3859,8 +3851,8 @@ qla2x00_start_bidir(srb_t *sp, struct scsi_qla_host *vha, uint32_t tot_dsds) /* Send marker if required */ if (vha->marker_needed != 0) { - if (qla2x00_marker(vha, req, - rsp, 0, 0, MK_SYNC_ALL) != QLA_SUCCESS) + if (qla2x00_marker(vha, ha->base_qpair, + 0, 0, MK_SYNC_ALL) != QLA_SUCCESS) return EXT_STATUS_MAILBOX; vha->marker_needed = 0; } diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 913dc36c48bc..b5dc70a0a14f 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -1513,16 +1513,12 @@ qla2x00_abort_target(struct fc_port *fcport, uint64_t l, int tag) mbx_cmd_t mc; mbx_cmd_t *mcp = &mc; scsi_qla_host_t *vha; - struct req_que *req; - struct rsp_que *rsp; vha = fcport->vha; ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x103e, "Entered %s.\n", __func__); - req = vha->hw->req_q_map[0]; - rsp = req->rsp; mcp->mb[0] = MBC_ABORT_TARGET; mcp->out_mb = MBX_9|MBX_2|MBX_1|MBX_0; if (HAS_EXTENDED_IDS(vha->hw)) { @@ -1545,7 +1541,7 @@ qla2x00_abort_target(struct fc_port *fcport, uint64_t l, int tag) } /* Issue marker IOCB. */ - rval2 = qla2x00_marker(vha, req, rsp, fcport->loop_id, 0, + rval2 = qla2x00_marker(vha, vha->hw->base_qpair, fcport->loop_id, 0, MK_SYNC_ID); if (rval2 != QLA_SUCCESS) { ql_dbg(ql_dbg_mbx, vha, 0x1040, @@ -1565,16 +1561,12 @@ qla2x00_lun_reset(struct fc_port *fcport, uint64_t l, int tag) mbx_cmd_t mc; mbx_cmd_t *mcp = &mc; scsi_qla_host_t *vha; - struct req_que *req; - struct rsp_que *rsp; vha = fcport->vha; ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1042, "Entered %s.\n", __func__); - req = vha->hw->req_q_map[0]; - rsp = req->rsp; mcp->mb[0] = MBC_LUN_RESET; mcp->out_mb = MBX_9|MBX_3|MBX_2|MBX_1|MBX_0; if (HAS_EXTENDED_IDS(vha->hw)) @@ -1594,7 +1586,7 @@ qla2x00_lun_reset(struct fc_port *fcport, uint64_t l, int tag) } /* Issue marker IOCB. */ - rval2 = qla2x00_marker(vha, req, rsp, fcport->loop_id, l, + rval2 = qla2x00_marker(vha, vha->hw->base_qpair, fcport->loop_id, l, MK_SYNC_ID_LUN); if (rval2 != QLA_SUCCESS) { ql_dbg(ql_dbg_mbx, vha, 0x1044, @@ -3186,7 +3178,6 @@ __qla24xx_issue_tmf(char *name, uint32_t type, struct fc_port *fcport, scsi_qla_host_t *vha; struct qla_hw_data *ha; struct req_que *req; - struct rsp_que *rsp; struct qla_qpair *qpair; vha = fcport->vha; @@ -3199,10 +3190,7 @@ __qla24xx_issue_tmf(char *name, uint32_t type, struct fc_port *fcport, if (vha->vp_idx && vha->qpair) { /* NPIV port */ qpair = vha->qpair; - rsp = qpair->rsp; req = qpair->req; - } else { - rsp = req->rsp; } tsk = dma_pool_zalloc(ha->s_dma_pool, GFP_KERNEL, &tsk_dma); @@ -3259,7 +3247,7 @@ __qla24xx_issue_tmf(char *name, uint32_t type, struct fc_port *fcport, } /* Issue marker IOCB. */ - rval2 = qla2x00_marker(vha, req, rsp, fcport->loop_id, l, + rval2 = qla2x00_marker(vha, ha->base_qpair, fcport->loop_id, l, type == TCF_LUN_RESET ? MK_SYNC_ID_LUN: MK_SYNC_ID); if (rval2 != QLA_SUCCESS) { ql_dbg(ql_dbg_mbx, vha, 0x1099, From patchwork Tue Feb 12 23:40:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10808963 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9DF241390 for ; Tue, 12 Feb 2019 23:42:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A1CF2C080 for ; Tue, 12 Feb 2019 23:42:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7ED292C0B6; Tue, 12 Feb 2019 23:42:29 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 148742C080 for ; Tue, 12 Feb 2019 23:42:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732452AbfBLXmZ (ORCPT ); Tue, 12 Feb 2019 18:42:25 -0500 Received: from mail-eopbgr780072.outbound.protection.outlook.com ([40.107.78.72]:52741 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732343AbfBLXmY (ORCPT ); Tue, 12 Feb 2019 18:42:24 -0500 Received: from DM6PR07CA0010.namprd07.prod.outlook.com (2603:10b6:5:94::23) by MWHPR07MB2912.namprd07.prod.outlook.com (2603:10b6:300:1f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.22; Tue, 12 Feb 2019 23:42:22 +0000 Received: from CO1NAM05FT047.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::203) by DM6PR07CA0010.outlook.office365.com (2603:10b6:5:94::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16 via Frontend Transport; Tue, 12 Feb 2019 23:42:22 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by CO1NAM05FT047.mail.protection.outlook.com (10.152.96.162) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Tue, 12 Feb 2019 23:42:21 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Tue, 12 Feb 2019 15:41:18 -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 x1CNfIJW029894; Tue, 12 Feb 2019 15:41:18 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1CNfIW4029893; Tue, 12 Feb 2019 15:41:18 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 10/12] qla2xxx: Fix code indentation for qla27xx_fwdt_entry Date: Tue, 12 Feb 2019 15:40:44 -0800 Message-ID: <20190212234046.29809-11-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190212234046.29809-1-hmadhani@marvell.com> References: <20190212234046.29809-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131944885419483660;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(39860400002)(346002)(376002)(396003)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(36756003)(85426001)(106466001)(53936002)(126002)(1076003)(2616005)(16586007)(36906005)(86362001)(476003)(42186006)(105606002)(68736007)(110136005)(316002)(486006)(47776003)(446003)(11346002)(54906003)(69596002)(2906002)(80596001)(76176011)(8936002)(336012)(26005)(8676002)(51416003)(26826003)(50226002)(305945005)(498600001)(48376002)(356004)(81166006)(81156014)(50466002)(97736004)(6666004)(4326008)(87636003);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR07MB2912;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT047;1:+KtwgoyYKfjDlQyGzX9o2FMMeQET0AmFRzZdzJTQWu5rbs3kkH+K0Fk0NF+VGr9LAVNV8DPO3TdI0rwTtKmdm7qZTxFHs+nl0IydDj0Bxxdz8+W+Ed0Y+wzTY+KNeaz6blNr/GI+caDYzlykqkCxSAGDSeGq2Oyq5Hbj8QrmN40= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4c669575-3e96-4434-6e9f-08d69143bbc4 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:MWHPR07MB2912; X-MS-TrafficTypeDiagnostic: MWHPR07MB2912: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0946DC87A1 X-Microsoft-Exchange-Diagnostics: 1;MWHPR07MB2912;23:li95JZBd5qZd1As70Jx9oBHZ/SHrccRiAR14swIl4TSCel+7gt+JFLVCeOBIq8/OCswkO3fejQmDqWlabIser46A8lNGEEUNAMVnJDbCjV2lxgLOGjbq5uJT+yZle3zD8YbhPBLYDE4P9A0+QwMFLPvcJNvWK0rq0uQGnYtLkmg0F7PB/6fWFTg5/g447g1clOjvEzJPhsBYluOonmRRtbiSUP2Uz7UOfnE3JOrWqqJin1wPUfw7xiW/FAisFUP3Wo0Ys8vmYmGayWRmynbAHpQtiFWz8O+3CnnUVWRjoHL8QbnxD9Beja8LD2iAVxSQqDlKJ2LRlAIv5NYMrsPLI6q/KRMe2oiyPWYjjurvVR10hqeDv3/xcuPp33Hhko8Yw7WmARWc0xCLNIbL4TZgAuyh+Lg/p0rclex4LDx1RF5MQJXTMPQ/OkPP+ObYrIZi9czZvTqbvUONBZTTGSJAt55ijjTffDI2UJJnqW1fqZuF0vLTD0FJYKp7ryX6MhgQXALnjX8xuM3Tz7tefpbR0SsbLal73f2OtlWydm6n6m74CIFtZEALJaX+bMYlJ7YHJfMhm3+MyudMgxl+xYAf19MreuXNplFxoXEZk4SCRDawNfd0F2ryrmf5VqKubRxOApk5C3A8quSFJau5Xw/87SUEuKr62lXTIigETHsLnc5zk4TeR+BgbAJeGMOl4fxfPv2LANMPanaGQ8fkogQ65qRZhqHA+DGElZKEagzP+XIHjMNR64TF65u04vSyrYgcJXXbkLtMOlnMow3fYKwP+BNkiVJ2e11+EnbIWszxaMJsCBVidRDr1CGaZfrqK6lG+imJMnm+548afH7IP/xKiu+TyKd6OArgZOxH11doT23YuKbJQP/8BEGqz2j0eSfkEONkW0ULXsTjN66PnXMHuVNBCOwOgUlCjk1AbxdiIIEr/NYRocsMPh2NQLQuN4knZ4XszBARAXlFXKYstzrCtL81kkWYD7RernTwvT/xfEpengKwu1DjQOVsB3Sh69/TGIi/ussPp2y3cYefy864nfszP8NcqlMaeU9aE9sEeGRZHvINInJxCpqvn0tdPjBdldPWsPJWXd1o9YTyLhTv+swdSBfTgqWsFzLZuxgoLVQ2KtIG3kVXB46Vhr/C9vRttmKaAnE4wpcZwq47sOiVENmCPwObtguW8Do01yC8AEmziolebaI5rM16melTPfgs X-Microsoft-Antispam-Message-Info: SDmWwVT8JbRtopmjDXlgGhnePkEL3I64DEWZzuO4w7Tjbi+3+g+38Q+tyDOAz87TZf/BcssNx3MpMTpwXKw+D7tKck6ehWzXVpMdfnbHqyRknFR48tdjlHUJkesv6CorxiRqnzzB3Xn+xoWFSxTrvM4tzpUD/9gOvSEL9eVh1TGn8jcbfo1kbFeO0Fkug7ranID08Ixaf2smM9GAyrbJs4toF/yrIVk3G4SA5H1ERS3KerQX+3SN1N8Dz9U0A1I6lQ5TckiUrvx2HB68PtEGtIwYsNO+o6tmQP3lcqzCVeYn7bZnEwPWjNIK0zjJvZZpZexJbqrqRkxydELWfAj3atIp/9UfmhJlh2HnQmxMPehIEDLwFHGbpfFVeTNCCJJBbNBiWDuYFpBgc3Qd4PU5y2BC4+115jyhBq2YW7ZTkSw= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2019 23:42:21.5550 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c669575-3e96-4434-6e9f-08d69143bbc4 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB2912 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 This patch fixes following checkpatch ERROR ERROR: space prohibited before that ',' (ctx:WxW) No change is functionality due to this patch. Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_tmpl.c | 46 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_tmpl.c b/drivers/scsi/qla2xxx/qla_tmpl.c index 0ccd06f11f12..f0c7c0c75ef7 100644 --- a/drivers/scsi/qla2xxx/qla_tmpl.c +++ b/drivers/scsi/qla2xxx/qla_tmpl.c @@ -796,29 +796,29 @@ struct qla27xx_fwdt_entry_call { }; static struct qla27xx_fwdt_entry_call ql27xx_fwdt_entry_call_list[] = { - { ENTRY_TYPE_NOP , qla27xx_fwdt_entry_t0 } , - { ENTRY_TYPE_TMP_END , qla27xx_fwdt_entry_t255 } , - { ENTRY_TYPE_RD_IOB_T1 , qla27xx_fwdt_entry_t256 } , - { ENTRY_TYPE_WR_IOB_T1 , qla27xx_fwdt_entry_t257 } , - { ENTRY_TYPE_RD_IOB_T2 , qla27xx_fwdt_entry_t258 } , - { ENTRY_TYPE_WR_IOB_T2 , qla27xx_fwdt_entry_t259 } , - { ENTRY_TYPE_RD_PCI , qla27xx_fwdt_entry_t260 } , - { ENTRY_TYPE_WR_PCI , qla27xx_fwdt_entry_t261 } , - { ENTRY_TYPE_RD_RAM , qla27xx_fwdt_entry_t262 } , - { ENTRY_TYPE_GET_QUEUE , qla27xx_fwdt_entry_t263 } , - { ENTRY_TYPE_GET_FCE , qla27xx_fwdt_entry_t264 } , - { ENTRY_TYPE_PSE_RISC , qla27xx_fwdt_entry_t265 } , - { ENTRY_TYPE_RST_RISC , qla27xx_fwdt_entry_t266 } , - { ENTRY_TYPE_DIS_INTR , qla27xx_fwdt_entry_t267 } , - { ENTRY_TYPE_GET_HBUF , qla27xx_fwdt_entry_t268 } , - { ENTRY_TYPE_SCRATCH , qla27xx_fwdt_entry_t269 } , - { ENTRY_TYPE_RDREMREG , qla27xx_fwdt_entry_t270 } , - { ENTRY_TYPE_WRREMREG , qla27xx_fwdt_entry_t271 } , - { ENTRY_TYPE_RDREMRAM , qla27xx_fwdt_entry_t272 } , - { ENTRY_TYPE_PCICFG , qla27xx_fwdt_entry_t273 } , - { ENTRY_TYPE_GET_SHADOW , qla27xx_fwdt_entry_t274 } , - { ENTRY_TYPE_WRITE_BUF , qla27xx_fwdt_entry_t275 } , - { -1 , qla27xx_fwdt_entry_other } + { ENTRY_TYPE_NOP, qla27xx_fwdt_entry_t0 }, + { ENTRY_TYPE_TMP_END, qla27xx_fwdt_entry_t255 }, + { ENTRY_TYPE_RD_IOB_T1, qla27xx_fwdt_entry_t256 }, + { ENTRY_TYPE_WR_IOB_T1, qla27xx_fwdt_entry_t257 }, + { ENTRY_TYPE_RD_IOB_T2, qla27xx_fwdt_entry_t258 }, + { ENTRY_TYPE_WR_IOB_T2, qla27xx_fwdt_entry_t259 }, + { ENTRY_TYPE_RD_PCI, qla27xx_fwdt_entry_t260 }, + { ENTRY_TYPE_WR_PCI, qla27xx_fwdt_entry_t261 }, + { ENTRY_TYPE_RD_RAM, qla27xx_fwdt_entry_t262 }, + { ENTRY_TYPE_GET_QUEUE, qla27xx_fwdt_entry_t263 }, + { ENTRY_TYPE_GET_FCE, qla27xx_fwdt_entry_t264 }, + { ENTRY_TYPE_PSE_RISC, qla27xx_fwdt_entry_t265 }, + { ENTRY_TYPE_RST_RISC, qla27xx_fwdt_entry_t266 }, + { ENTRY_TYPE_DIS_INTR, qla27xx_fwdt_entry_t267 }, + { ENTRY_TYPE_GET_HBUF, qla27xx_fwdt_entry_t268 }, + { ENTRY_TYPE_SCRATCH, qla27xx_fwdt_entry_t269 }, + { ENTRY_TYPE_RDREMREG, qla27xx_fwdt_entry_t270 }, + { ENTRY_TYPE_WRREMREG, qla27xx_fwdt_entry_t271 }, + { ENTRY_TYPE_RDREMRAM, qla27xx_fwdt_entry_t272 }, + { ENTRY_TYPE_PCICFG, qla27xx_fwdt_entry_t273 }, + { ENTRY_TYPE_GET_SHADOW, qla27xx_fwdt_entry_t274 }, + { ENTRY_TYPE_WRITE_BUF, qla27xx_fwdt_entry_t275 }, + { -1, qla27xx_fwdt_entry_other } }; static inline int (*qla27xx_find_entry(uint type)) From patchwork Tue Feb 12 23:40:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10808969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2BA181390 for ; Tue, 12 Feb 2019 23:42:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17F412C080 for ; Tue, 12 Feb 2019 23:42:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B9E42C082; Tue, 12 Feb 2019 23:42:36 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 D2DB92C0AD for ; Tue, 12 Feb 2019 23:42:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732475AbfBLXmd (ORCPT ); Tue, 12 Feb 2019 18:42:33 -0500 Received: from mail-eopbgr800053.outbound.protection.outlook.com ([40.107.80.53]:34816 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732560AbfBLXmd (ORCPT ); Tue, 12 Feb 2019 18:42:33 -0500 Received: from DM5PR07CA0028.namprd07.prod.outlook.com (2603:10b6:3:16::14) by BY1PR0701MB1928.namprd07.prod.outlook.com (2a01:111:e400:51aa::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.19; Tue, 12 Feb 2019 23:42:28 +0000 Received: from CO1NAM05FT046.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::203) by DM5PR07CA0028.outlook.office365.com (2603:10b6:3:16::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1601.19 via Frontend Transport; Tue, 12 Feb 2019 23:42:28 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by CO1NAM05FT046.mail.protection.outlook.com (10.152.96.161) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Tue, 12 Feb 2019 23:42:27 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Tue, 12 Feb 2019 15:41:19 -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 x1CNfJxu029898; Tue, 12 Feb 2019 15:41:19 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1CNfJ0F029897; Tue, 12 Feb 2019 15:41:19 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 11/12] qla2xxx: Add new FW dump template entry types Date: Tue, 12 Feb 2019 15:40:45 -0800 Message-ID: <20190212234046.29809-12-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190212234046.29809-1-hmadhani@marvell.com> References: <20190212234046.29809-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131944885479591407;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(39860400002)(346002)(376002)(396003)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(47776003)(106466001)(68736007)(51416003)(356004)(53936002)(6666004)(105606002)(14444005)(48376002)(316002)(16586007)(42186006)(26826003)(85426001)(36906005)(110136005)(87636003)(30864003)(50466002)(486006)(50226002)(54906003)(498600001)(1076003)(8676002)(2616005)(126002)(80596001)(305945005)(86362001)(8936002)(81166006)(97736004)(69596002)(11346002)(26005)(4326008)(36756003)(336012)(476003)(76176011)(2906002)(446003)(81156014);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR0701MB1928;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT046;1:KD+8U6qywtQ58eHZzTNdmF19DKQZ3ydbBYqTphSoZJvko4JbWuZBQ8rRR54kbHxVDTgggYJoMtIl2BzK2NL0htx5i+vRoO+m7P0j4AT8Jrd4PHzNawyYVV7ogxY9YGWf+LsNh8n866E1iHW864cAZ+SseIajAz1x6t1oX8lyTyI= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7d895bac-3b43-49f0-7fbf-08d69143bf67 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:BY1PR0701MB1928; X-MS-TrafficTypeDiagnostic: BY1PR0701MB1928: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0946DC87A1 X-Microsoft-Exchange-Diagnostics: 1;BY1PR0701MB1928;23:0zv+7M8rq/CvtkRz9iPH5PAOXqvzRxlclRyDkkPSDQTLNN93YxYAow9aLOW/3RZ45gfDEBmDfOv7d3p1cMcz38blZYU3YW9ddbwOQ6fqW5Iz1vJzdBLCrCg5yEaRQGawUXgHRSF4bwf27BScUL78tIeLBzSiGa5XqeWUKC7sh62IlZBMfjJPTmX5ty7IogoduE32dQ+YBzKtC9FHOQeJStMsYWlg/wwN/w8R+IG8dFPzaX2L7Qt6LmEB82c1yDv8abpJf+IT4re7F/4i/CcSzzdp5U03eiSTn5mRMB/9rJiCQeCKBi1FcrvjD5Ypq7FbEZmkc+Dza7WCPF3SrmMt1m+E4Arv/IYwU0M+1vDFRMTPUHQELL0XxzOt8Uw1yNeYpLXJClCCcMWxlwRqARL8mvdFE8+1q7ZNkx0qIHCCV5mpzCpFShtlFKkiAdICx9IjnUboGhKxsuqptOx0mX+5hIP9WcVkG4w/6W38j0SyCgp1GhlFOeHv1kXp03hYpX1IeX0gii/oKahtUdSSX+K7+I8TaXnXn2H6H82ZBU66pmB28R2CcdsybfU6r+FjhxL/26gTSjsguttpdpqYv2SC5/F7fo6+ExlylHOFeQ49NzjgN8+/xp9T6AdJnOQl3VwwiIOvGv60cyXxA+dYFfTb3BdkF2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ArrivalTime: 12 Feb 2019 23:42:27.6188 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7d895bac-3b43-49f0-7fbf-08d69143bf67 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1928 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: Joe Carnuccio This patch adds new firmware dump template entries for ISP27XX firmware dump. Signed-off-by: Joe Carnuccio Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_tmpl.c | 191 +++++++++++++++++++++++++--------------- drivers/scsi/qla2xxx/qla_tmpl.h | 26 +++++- 2 files changed, 142 insertions(+), 75 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_tmpl.c b/drivers/scsi/qla2xxx/qla_tmpl.c index f0c7c0c75ef7..9e52500caff0 100644 --- a/drivers/scsi/qla2xxx/qla_tmpl.c +++ b/drivers/scsi/qla2xxx/qla_tmpl.c @@ -221,7 +221,13 @@ qla27xx_skip_entry(struct qla27xx_fwdt_entry *ent, void *buf) ent->hdr.driver_flags |= DRIVER_FLAG_SKIP_ENTRY; } -static int +static inline struct qla27xx_fwdt_entry * +qla27xx_next_entry(struct qla27xx_fwdt_entry *ent) +{ + return (void *)ent + ent->hdr.size; +} + +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t0(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -229,10 +235,10 @@ qla27xx_fwdt_entry_t0(struct scsi_qla_host *vha, "%s: nop [%lx]\n", __func__, *len); qla27xx_skip_entry(ent, buf); - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t255(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -241,10 +247,10 @@ qla27xx_fwdt_entry_t255(struct scsi_qla_host *vha, qla27xx_skip_entry(ent, buf); /* terminate */ - return true; + return NULL; } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t256(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -255,10 +261,10 @@ qla27xx_fwdt_entry_t256(struct scsi_qla_host *vha, qla27xx_read_window(reg, ent->t256.base_addr, ent->t256.pci_offset, ent->t256.reg_count, ent->t256.reg_width, buf, len); - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t257(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -269,10 +275,10 @@ qla27xx_fwdt_entry_t257(struct scsi_qla_host *vha, qla27xx_write_reg(reg, IOBASE_ADDR, ent->t257.base_addr, buf); qla27xx_write_reg(reg, ent->t257.pci_offset, ent->t257.write_data, buf); - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t258(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -284,10 +290,10 @@ qla27xx_fwdt_entry_t258(struct scsi_qla_host *vha, qla27xx_read_window(reg, ent->t258.base_addr, ent->t258.pci_offset, ent->t258.reg_count, ent->t258.reg_width, buf, len); - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t259(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -299,10 +305,10 @@ qla27xx_fwdt_entry_t259(struct scsi_qla_host *vha, qla27xx_write_reg(reg, ent->t259.banksel_offset, ent->t259.bank, buf); qla27xx_write_reg(reg, ent->t259.pci_offset, ent->t259.write_data, buf); - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t260(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -313,10 +319,10 @@ qla27xx_fwdt_entry_t260(struct scsi_qla_host *vha, qla27xx_insert32(ent->t260.pci_offset, buf, len); qla27xx_read_reg(reg, ent->t260.pci_offset, buf, len); - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t261(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -326,10 +332,10 @@ qla27xx_fwdt_entry_t261(struct scsi_qla_host *vha, "%s: wrpci [%lx]\n", __func__, *len); qla27xx_write_reg(reg, ent->t261.pci_offset, ent->t261.write_data, buf); - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t262(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -362,6 +368,11 @@ qla27xx_fwdt_entry_t262(struct scsi_qla_host *vha, ent->t262.start_addr = start; ent->t262.end_addr = end; } + } else if (ent->t262.ram_area == T262_RAM_AREA_MISC) { + if (buf) { + ent->t262.start_addr = start; + ent->t262.end_addr = end; + } } else { ql_dbg(ql_dbg_misc, vha, 0xd022, "%s: unknown area %x\n", __func__, ent->t262.ram_area); @@ -384,10 +395,10 @@ qla27xx_fwdt_entry_t262(struct scsi_qla_host *vha, } *len += dwords * sizeof(uint32_t); done: - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t263(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -450,10 +461,10 @@ qla27xx_fwdt_entry_t263(struct scsi_qla_host *vha, qla27xx_skip_entry(ent, buf); } - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t264(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -478,10 +489,10 @@ qla27xx_fwdt_entry_t264(struct scsi_qla_host *vha, qla27xx_skip_entry(ent, buf); } - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t265(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -492,10 +503,10 @@ qla27xx_fwdt_entry_t265(struct scsi_qla_host *vha, if (buf) qla24xx_pause_risc(reg, vha->hw); - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t266(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -504,10 +515,10 @@ qla27xx_fwdt_entry_t266(struct scsi_qla_host *vha, if (buf) qla24xx_soft_reset(vha->hw); - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t267(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -517,10 +528,10 @@ qla27xx_fwdt_entry_t267(struct scsi_qla_host *vha, "%s: dis intr [%lx]\n", __func__, *len); qla27xx_write_reg(reg, ent->t267.pci_offset, ent->t267.data, buf); - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t268(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -587,10 +598,10 @@ qla27xx_fwdt_entry_t268(struct scsi_qla_host *vha, break; } - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t269(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -604,10 +615,10 @@ qla27xx_fwdt_entry_t269(struct scsi_qla_host *vha, if (buf) ent->t269.scratch_size = 5 * sizeof(uint32_t); - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t270(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -625,10 +636,10 @@ qla27xx_fwdt_entry_t270(struct scsi_qla_host *vha, addr += sizeof(uint32_t); } - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t271(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -642,10 +653,10 @@ qla27xx_fwdt_entry_t271(struct scsi_qla_host *vha, qla27xx_write_reg(reg, 0xc4, data, buf); qla27xx_write_reg(reg, 0xc0, addr, buf); - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t272(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -662,10 +673,10 @@ qla27xx_fwdt_entry_t272(struct scsi_qla_host *vha, } *len += dwords * sizeof(uint32_t); - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t273(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -685,10 +696,10 @@ qla27xx_fwdt_entry_t273(struct scsi_qla_host *vha, addr += sizeof(uint32_t); } - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t274(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -746,10 +757,10 @@ qla27xx_fwdt_entry_t274(struct scsi_qla_host *vha, qla27xx_skip_entry(ent, buf); } - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_t275(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { @@ -763,7 +774,7 @@ qla27xx_fwdt_entry_t275(struct scsi_qla_host *vha, qla27xx_skip_entry(ent, buf); goto done; } - if (offset + ent->t275.length > ent->hdr.entry_size) { + if (offset + ent->t275.length > ent->hdr.size) { ql_dbg(ql_dbg_misc, vha, 0xd030, "%s: buffer overflow\n", __func__); qla27xx_skip_entry(ent, buf); @@ -772,30 +783,71 @@ qla27xx_fwdt_entry_t275(struct scsi_qla_host *vha, qla27xx_insertbuf(ent->t275.buffer, ent->t275.length, buf, len); done: - return false; + return qla27xx_next_entry(ent); } -static int +static struct qla27xx_fwdt_entry * +qla27xx_fwdt_entry_t276(struct scsi_qla_host *vha, + struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) +{ + uint type = vha->hw->pdev->device >> 4 & 0xf; + uint func = vha->hw->port_no & 0x3; + + ql_dbg(ql_dbg_misc + ql_dbg_verbose, vha, 0xd214, + "%s: cond [%lx]\n", __func__, *len); + + if (type != ent->t276.cond1 || func != ent->t276.cond2) { + ent = qla27xx_next_entry(ent); + qla27xx_skip_entry(ent, buf); + } + + return qla27xx_next_entry(ent); +} + +static struct qla27xx_fwdt_entry * +qla27xx_fwdt_entry_t277(struct scsi_qla_host *vha, + struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) +{ + struct device_reg_24xx __iomem *reg = qla27xx_isp_reg(vha); + + ql_dbg(ql_dbg_misc + ql_dbg_verbose, vha, 0xd215, + "%s: rdpep [%lx]\n", __func__, *len); + qla27xx_insert32(ent->t277.wr_cmd_data, buf, len); + qla27xx_write_reg(reg, ent->t277.cmd_addr, ent->t277.wr_cmd_data, buf); + qla27xx_read_reg(reg, ent->t277.data_addr, buf, len); + + return qla27xx_next_entry(ent); +} + +static struct qla27xx_fwdt_entry * +qla27xx_fwdt_entry_t278(struct scsi_qla_host *vha, + struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) +{ + struct device_reg_24xx __iomem *reg = qla27xx_isp_reg(vha); + + ql_dbg(ql_dbg_misc + ql_dbg_verbose, vha, 0xd216, + "%s: wrpep [%lx]\n", __func__, *len); + qla27xx_write_reg(reg, ent->t278.data_addr, ent->t278.wr_data, buf); + qla27xx_write_reg(reg, ent->t278.cmd_addr, ent->t278.wr_cmd_data, buf); + + return qla27xx_next_entry(ent); +} + +static struct qla27xx_fwdt_entry * qla27xx_fwdt_entry_other(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) { ql_dbg(ql_dbg_misc, vha, 0xd2ff, - "%s: type %x [%lx]\n", __func__, ent->hdr.entry_type, *len); + "%s: type %x [%lx]\n", __func__, ent->hdr.type, *len); qla27xx_skip_entry(ent, buf); - return false; + return qla27xx_next_entry(ent); } -struct qla27xx_fwdt_entry_call { +static struct { uint type; - int (*call)( - struct scsi_qla_host *, - struct qla27xx_fwdt_entry *, - void *, - ulong *); -}; - -static struct qla27xx_fwdt_entry_call ql27xx_fwdt_entry_call_list[] = { + typeof(qla27xx_fwdt_entry_other)(*call); +} qla27xx_fwdt_entry_call[] = { { ENTRY_TYPE_NOP, qla27xx_fwdt_entry_t0 }, { ENTRY_TYPE_TMP_END, qla27xx_fwdt_entry_t255 }, { ENTRY_TYPE_RD_IOB_T1, qla27xx_fwdt_entry_t256 }, @@ -818,13 +870,16 @@ static struct qla27xx_fwdt_entry_call ql27xx_fwdt_entry_call_list[] = { { ENTRY_TYPE_PCICFG, qla27xx_fwdt_entry_t273 }, { ENTRY_TYPE_GET_SHADOW, qla27xx_fwdt_entry_t274 }, { ENTRY_TYPE_WRITE_BUF, qla27xx_fwdt_entry_t275 }, + { ENTRY_TYPE_CONDITIONAL, qla27xx_fwdt_entry_t276 }, + { ENTRY_TYPE_RDPEPREG, qla27xx_fwdt_entry_t277 }, + { ENTRY_TYPE_WRPEPREG, qla27xx_fwdt_entry_t278 }, { -1, qla27xx_fwdt_entry_other } }; -static inline int (*qla27xx_find_entry(uint type)) - (struct scsi_qla_host *, struct qla27xx_fwdt_entry *, void *, ulong *) +static inline +typeof(qla27xx_fwdt_entry_call->call)(qla27xx_find_entry(uint type)) { - struct qla27xx_fwdt_entry_call *list = ql27xx_fwdt_entry_call_list; + typeof(*qla27xx_fwdt_entry_call) *list = qla27xx_fwdt_entry_call; while (list->type < type) list++; @@ -834,14 +889,6 @@ static inline int (*qla27xx_find_entry(uint type)) return qla27xx_fwdt_entry_other; } -static inline void * -qla27xx_next_entry(void *p) -{ - struct qla27xx_fwdt_entry *ent = p; - - return p + ent->hdr.entry_size; -} - static void qla27xx_walk_template(struct scsi_qla_host *vha, struct qla27xx_fwdt_template *tmp, void *buf, ulong *len) @@ -852,18 +899,16 @@ qla27xx_walk_template(struct scsi_qla_host *vha, ql_dbg(ql_dbg_misc, vha, 0xd01a, "%s: entry count %lx\n", __func__, count); while (count--) { - if (buf && *len >= vha->hw->fw_dump_len) + ent = qla27xx_find_entry(ent->hdr.type)(vha, ent, buf, len); + if (!ent) break; - if (qla27xx_find_entry(ent->hdr.entry_type)(vha, ent, buf, len)) - break; - ent = qla27xx_next_entry(ent); } if (count) ql_dbg(ql_dbg_misc, vha, 0xd018, "%s: entry residual count (%lx)\n", __func__, count); - if (ent->hdr.entry_type != ENTRY_TYPE_TMP_END) + if (ent) ql_dbg(ql_dbg_misc, vha, 0xd019, "%s: missing end entry (%lx)\n", __func__, count); diff --git a/drivers/scsi/qla2xxx/qla_tmpl.h b/drivers/scsi/qla2xxx/qla_tmpl.h index 141c1c5e73f4..5c2c2a8a19c4 100644 --- a/drivers/scsi/qla2xxx/qla_tmpl.h +++ b/drivers/scsi/qla2xxx/qla_tmpl.h @@ -54,6 +54,9 @@ struct __packed qla27xx_fwdt_template { #define ENTRY_TYPE_PCICFG 273 #define ENTRY_TYPE_GET_SHADOW 274 #define ENTRY_TYPE_WRITE_BUF 275 +#define ENTRY_TYPE_CONDITIONAL 276 +#define ENTRY_TYPE_RDPEPREG 277 +#define ENTRY_TYPE_WRPEPREG 278 #define CAPTURE_FLAG_PHYS_ONLY BIT_0 #define CAPTURE_FLAG_PHYS_VIRT BIT_1 @@ -62,8 +65,8 @@ struct __packed qla27xx_fwdt_template { struct __packed qla27xx_fwdt_entry { struct __packed { - uint32_t entry_type; - uint32_t entry_size; + uint32_t type; + uint32_t size; uint32_t reserved_1; uint8_t capture_flags; @@ -199,6 +202,24 @@ struct __packed qla27xx_fwdt_entry { uint32_t length; uint8_t buffer[]; } t275; + + struct __packed { + uint32_t cond1; + uint32_t cond2; + } t276; + + struct __packed { + uint32_t cmd_addr; + uint32_t wr_cmd_data; + uint32_t data_addr; + } t277; + + struct __packed { + uint32_t cmd_addr; + uint32_t wr_cmd_data; + uint32_t data_addr; + uint32_t wr_data; + } t278; }; }; @@ -206,6 +227,7 @@ struct __packed qla27xx_fwdt_entry { #define T262_RAM_AREA_EXTERNAL_RAM 2 #define T262_RAM_AREA_SHARED_RAM 3 #define T262_RAM_AREA_DDR_RAM 4 +#define T262_RAM_AREA_MISC 5 #define T263_QUEUE_TYPE_REQ 1 #define T263_QUEUE_TYPE_RSP 2 From patchwork Tue Feb 12 23:40:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10808967 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E886213A4 for ; Tue, 12 Feb 2019 23:42:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D75822C080 for ; Tue, 12 Feb 2019 23:42:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB6582C083; Tue, 12 Feb 2019 23:42:31 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 6C55D2C080 for ; Tue, 12 Feb 2019 23:42:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732552AbfBLXm3 (ORCPT ); Tue, 12 Feb 2019 18:42:29 -0500 Received: from mail-eopbgr710084.outbound.protection.outlook.com ([40.107.71.84]:21232 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732475AbfBLXm3 (ORCPT ); Tue, 12 Feb 2019 18:42:29 -0500 Received: from DM5PR07CA0028.namprd07.prod.outlook.com (2603:10b6:3:16::14) by MWHPR07MB2911.namprd07.prod.outlook.com (2603:10b6:300:1f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.17; Tue, 12 Feb 2019 23:42:27 +0000 Received: from CO1NAM05FT046.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::203) by DM5PR07CA0028.outlook.office365.com (2603:10b6:3:16::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1601.19 via Frontend Transport; Tue, 12 Feb 2019 23:42:27 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by CO1NAM05FT046.mail.protection.outlook.com (10.152.96.161) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Tue, 12 Feb 2019 23:42:26 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Tue, 12 Feb 2019 15:41:22 -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 x1CNfMIh029902; Tue, 12 Feb 2019 15:41:22 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1CNfMr9029901; Tue, 12 Feb 2019 15:41:22 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 12/12] qla2xxx: Update driver version to 10.00.00.14-k Date: Tue, 12 Feb 2019 15:40:46 -0800 Message-ID: <20190212234046.29809-13-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190212234046.29809-1-hmadhani@marvell.com> References: <20190212234046.29809-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131944885468332529;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(376002)(396003)(39860400002)(346002)(136003)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(8676002)(105606002)(81166006)(81156014)(97736004)(4326008)(42186006)(47776003)(26005)(4744005)(68736007)(80596001)(16586007)(48376002)(69596002)(76176011)(106466001)(305945005)(110136005)(85426001)(2906002)(50466002)(87636003)(11346002)(86362001)(53936002)(446003)(476003)(51416003)(26826003)(486006)(2616005)(498600001)(8936002)(36906005)(6666004)(126002)(336012)(1076003)(316002)(356004)(36756003)(50226002)(54906003)(14444005);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR07MB2911;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT046;1:uYTRGyqO0tXhZpj901DM+7c9b1X3Cauls2ov0L3kdR74cI4fURaOmcNj7EzRBI2heZLx9XKNBQEHz8zfeUDX8sA0FA8aSAylpczgmQCNB5Ygf0jgG+eutl0nFbE8FhZM+P+dLvU3xL4CNUANA5vYnq9NwgomZLPV5sS5ktUa1f4= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1e90e550-d520-4870-ad96-08d69143beb4 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:MWHPR07MB2911; X-MS-TrafficTypeDiagnostic: MWHPR07MB2911: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0946DC87A1 X-Microsoft-Exchange-Diagnostics: 1;MWHPR07MB2911;23:mYl/5GKAck9V6a5NdJtvd520nKJk8XfYsNr7gYW5DpI+lIQKHok5soroUj24vwnX7jReUfIQCHpIHGMBdRk0de0SK6QasczOXNW/XpeUhedhEt+8cKsNmTB+kiEfh0VR57hKtVhJMLjMxLCMen8aZMDoMHoAk9j6iwq9xG32Kp0tAgA/1UknOlnmQeOJPpSl+uBzO6Fwn0Y5OypnQ2Uj6ClMPQqiBWZqL2nDFc9oxEe9lGj5MNXmZI2vfVgLQDMVRYr5+lIAifdfhfcQUVZaFndHlnb+DNnqpxc5QyrFOMKwQ4KBUxKO0V+kzs6ztUpAZD3PR7edVnMmZrE+IS64/eo+VLA870HQmb1QnKUwyTFdc7XE+RKs7QpYoyE5WRjbQoXznI6sdzed4UylK0SwV2ThB3xv61yh/wZFA1T0oHX3dTuWBtDQuZ1jTqIhjXZSaQmyEWAuUH3qf6pGCCphOcAdS7GuI14s7WE5OCGlnmL+2DAm5Zb82TFOSe6uXGeI3KvDZev/GIADfVSstcLcAzM8ZaD2w3D/WLzgD+h5KrnCpzjezeNKAOktc8yWCiw9tfG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nB/LZtPWl5WMHnTabGFFb0YV9LnGqJcmAzXsKyeT2sWVj/jb3+8djlg= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2019 23:42:26.4929 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1e90e550-d520-4870-ad96-08d69143beb4 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB2911 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 Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index 537098e8f1c1..0690dac24081 100644 --- a/drivers/scsi/qla2xxx/qla_version.h +++ b/drivers/scsi/qla2xxx/qla_version.h @@ -7,7 +7,7 @@ /* * Driver version */ -#define QLA2XXX_VERSION "10.00.00.13-k" +#define QLA2XXX_VERSION "10.00.00.14-k" #define QLA_DRIVER_MAJOR_VER 10 #define QLA_DRIVER_MINOR_VER 0