From patchwork Wed Feb 13 18:53:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10810723 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 7E30D13B4 for ; Wed, 13 Feb 2019 18:54:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D3082C95A for ; Wed, 13 Feb 2019 18:54:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 613E12DEAD; Wed, 13 Feb 2019 18:54:43 +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 440C02C95A for ; Wed, 13 Feb 2019 18:54:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394302AbfBMSyl (ORCPT ); Wed, 13 Feb 2019 13:54:41 -0500 Received: from mail-eopbgr810043.outbound.protection.outlook.com ([40.107.81.43]:27771 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2394299AbfBMSyk (ORCPT ); Wed, 13 Feb 2019 13:54:40 -0500 Received: from SN4PR0701CA0015.namprd07.prod.outlook.com (2603:10b6:803:28::25) by CY1PR0701MB1930.namprd07.prod.outlook.com (2a01:111:e400:58fa::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Wed, 13 Feb 2019 18:54:38 +0000 Received: from DM3NAM05FT044.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::205) by SN4PR0701CA0015.outlook.office365.com (2603:10b6:803:28::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Wed, 13 Feb 2019 18:54:38 +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 DM3NAM05FT044.mail.protection.outlook.com (10.152.98.157) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Wed, 13 Feb 2019 18:54:37 +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; Wed, 13 Feb 2019 10:53:28 -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 x1DIrSDC021691; Wed, 13 Feb 2019 10:53:28 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1DIrS7X021690; Wed, 13 Feb 2019 10:53:28 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 01/12] qla2xxx: Fix LUN discovery if loop id is not assigned yet by firmware Date: Wed, 13 Feb 2019 10:53:13 -0800 Message-ID: <20190213185324.21652-2-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190213185324.21652-1-hmadhani@marvell.com> References: <20190213185324.21652-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131945576780979887;(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)(39860400002)(136003)(376002)(396003)(346002)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(11346002)(446003)(2616005)(105606002)(106466001)(476003)(85426001)(486006)(80596001)(69596002)(498600001)(2906002)(53936002)(51416003)(87636003)(76176011)(86362001)(26826003)(50226002)(26005)(336012)(356004)(6666004)(81156014)(16586007)(42186006)(110136005)(54906003)(81166006)(1076003)(8676002)(316002)(4326008)(36906005)(8936002)(36756003)(68736007)(48376002)(97736004)(50466002)(126002)(305945005)(47776003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0701MB1930;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM05FT044;1:cmM43YCc/OG4anpC8kDO7qK5CdrTXsKDomyfuQr5vdqQOpOjXzptcbHO/rd03uZBrar6tcqzLRP5Hdm3j3qxeFHY/Qz9OUxMLB7YnoofuPgnFU0tCJAHkW5PA0RgCwxQMYlY73X/Fnb7pBj2K/iIGw== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2dabd001-0ab0-4b9a-9049-08d691e4b42d X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:CY1PR0701MB1930; X-MS-TrafficTypeDiagnostic: CY1PR0701MB1930: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 094700CA91 X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1930;23:i3oaxEj1eEQXkLWqil3g8ziU7w9/kZQcEQSVPCFH1F44TYSzcDjZaSFJVH/w3ikpAzkil7dkF9MeIH+TWe657UZMRxB0Rts9n9BdfL2AxfRDeWYjGKsmnPxipKARjqNSvd30UbXLRX+2HBpSibu+mTiMEPRZGHf0UuFitytB8257ywiuOtXpI1xYBdJUMHLBLJpsqangxMU1gR644QvMlTff8+ryiIsij6Xejw10QWn83bL2TVue3HJsQhEusIDJvqTZKrXQRqfgvO1rA9zvPYi17q/AySRcJOnhjUqlouzh/DolsnGCrsgLidKqsBAn/20ikVpwQQDsFaAtVNWPUoxqaPXx9VMEhWGyVOtMHYJd8vIuUdVYQTBaivfV7IvvXheZyzhB9b9vrfX0s86U0RpfnvmYf2d4uP0WGuRHROAaxmPfK0/9cM9jp9gc3EJ5m928DKgJOyFa9DZhQxVUlBq1og0loCcxpDdjuvtAfBbhka2ozcIBUzYMKQssU/gqqsC1hYbx46TFlieaSmN7qX9WPWwh9jPw8FqewXVno1gczptuc+4mUQ4U/V28trKy9O8KrZ+zKGQj+/5kj2rPo6XRNIiKMJXwybjPSQ711tkpzJ6Nf83g8L8/UIOZLIjTEEZbeh4eDWmjqBzkhmz7h+TJa/s7/lZKu4b4ERHMB5IbQn42CfanldkC18jvMX0MN2BRVZuMLIpIrgPIDbyBUEZRFFVr/O3mdZUPlYqtl8FssGmTZSR0am1ot5xJYo8SCDAW3kiJp8EqxW1RPo5/q7TV401Q1aknJBRuyPBK9runbFLwPHmOb/xKVRK8y723TMhnwapQJWDCFVfhQK82hUEsPHAsm/2ddthd+mN5ViMvxkIJYSI2rzlg6kn1JvUxomtyJ86VtqvXg1/FOTiu09zk6eoABFjPTpTPDVPf4mT1onozyolIFobCOZoaoXhxmx+ytbMrJfr1S03RsJx1RSbKiod2MUmj0TvqBYtN2SN8beAlQcxNdPtU21Ud9QhtMZXOGJx6UxVceG5Tqb3CqAbmrP8N1yEoaHhwp9Sm2l0YitlbpAyvQ/AXrZuBQolgUsQLIebDgVWEsTl4uj1rCd5SscbqosURKvhZ90+by25DJUuJNspL3p5n2HqK7auqjwMjk1Nk2Ea99Dx0FcOwLK5MwxemBpiO8vkjl+Xcj1698g4LsWltb3opjuaoJR2H X-Microsoft-Antispam-Message-Info: cjeXEuNoEcZ1sG7een+3OIHybB65kkEduae+YGeMwfEia1H1kAr6/rJIt/fOURVUSjtNHqG58r/9CyKZW9nFWCQJnUB2JTTSdG5/+JK1oIpwXcjxmJOgKEdSuwI/5E3vLH6nBdBLlwW1AQi9uKZ+5gD735Y++Alur9ANd4NOJpBxFIT/3pdkAuz4ucMw5zNFaneaY0PaJCsnZYokoFw30YZ4mnzXjZpwwR3UumHM3CvxmYzKwz3G3yhvcUxlcSGam1oDa46snVO85hnk4y5mTiRdK90wn1gt4I1lt3HnGJr/rz3ScZlJ1S7J5x08c/A35oTgRTzDisXlfUO4Qm9INwYUU1NYAS48rw7xqHA9l2P5vS2riRmdpXRQAgHQ+sDvCOkmQLtHAm3f6oOBHcpPYCoZlFQSX1Dx6mdYHVGTnOI= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2019 18:54:37.7487 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2dabd001-0ab0-4b9a-9049-08d691e4b42d 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: CY1PR0701MB1930 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 Wed Feb 13 18:53:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10810725 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 40C8B922 for ; Wed, 13 Feb 2019 18:54:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DAD129569 for ; Wed, 13 Feb 2019 18:54:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21AB12DEAD; Wed, 13 Feb 2019 18:54:46 +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 3E1972C95A for ; Wed, 13 Feb 2019 18:54:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394299AbfBMSyo (ORCPT ); Wed, 13 Feb 2019 13:54:44 -0500 Received: from mail-eopbgr740058.outbound.protection.outlook.com ([40.107.74.58]:21273 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2393881AbfBMSyn (ORCPT ); Wed, 13 Feb 2019 13:54:43 -0500 Received: from SN4PR0701CA0002.namprd07.prod.outlook.com (2603:10b6:803:28::12) by CY1PR0701MB1931.namprd07.prod.outlook.com (2a01:111:e400:58fa::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Wed, 13 Feb 2019 18:54:37 +0000 Received: from DM3NAM05FT044.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::200) by SN4PR0701CA0002.outlook.office365.com (2603:10b6:803:28::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Wed, 13 Feb 2019 18:54:37 +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 DM3NAM05FT044.mail.protection.outlook.com (10.152.98.157) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Wed, 13 Feb 2019 18:54:36 +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; Wed, 13 Feb 2019 10:53:32 -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 x1DIrVFB021695; Wed, 13 Feb 2019 10:53:31 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1DIrV9r021694; Wed, 13 Feb 2019 10:53:31 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 02/12] qla2xxx: Add First Burst support for FC-NVMe devices Date: Wed, 13 Feb 2019 10:53:14 -0800 Message-ID: <20190213185324.21652-3-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190213185324.21652-1-hmadhani@marvell.com> References: <20190213185324.21652-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131945576770201406;(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)(346002)(39860400002)(396003)(136003)(376002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(97736004)(105606002)(36756003)(106466001)(1076003)(4326008)(6666004)(356004)(86362001)(47776003)(2906002)(36906005)(51416003)(53936002)(54906003)(42186006)(110136005)(16586007)(87636003)(126002)(80596001)(336012)(48376002)(316002)(50466002)(14444005)(476003)(8676002)(50226002)(11346002)(8936002)(85426001)(26826003)(486006)(446003)(81156014)(498600001)(81166006)(69596002)(68736007)(2616005)(76176011)(305945005)(26005);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0701MB1931;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM05FT044;1:FJ45oAvMMbXGO1+Bh96iwy4tDvrP40a5r1zaIdBbmgiotR1qud1ot3eKhD0RglRAKlx1shR8QitZ2clyLlpco+QpBG2nizFL27v/jgmYEHAQPHH3nDEqqTr8IjQMeV6JCnrYGaUcmh17MfmHUlviYg== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 08493db8-7785-44d2-2beb-08d691e4b37f X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:CY1PR0701MB1931; X-MS-TrafficTypeDiagnostic: CY1PR0701MB1931: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 094700CA91 X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1931;23:UOmBz90dtCcVnm/Z62JO1pezT6zOcmA03dHuJ8TngDOXHQAvb9LBRpTQBjQr2tExInIOkevfCPqmOZQsZqTkQfJEfOIA8culm/yBejPlnf7tcW2S2xapoiKa6FTdo8Bpn9mK2qc8yA+8rodmC79PJW8D+ptXd/avKFxFClZ9rOoA65MDSXiWiRa4zvyxWJ3wl4OdcziQGWDDJg5SYHZ4t0KP4aTzhHDC7ZOqiJ9X+lmac8N2eWa9PlEzBqbt5/7hrvb3cc3NvUs1IpMTr8VHUQtsqL0Lx1Cuc/2AtL/uvfcMpZHgt5ViAT348f3bjrF/H+zj2Uorwv3YwpN7yFyy/VvvL/2W1lMG1vzNRQeA488eqOUKE7uWskoIOuJoHCml3oNzIYZfOPUkYdczEPVbuTQJY9oWGTPYYfqxRnlQoZLi9DsWyECFI8ARpZ/gEI7F5b861wp5UCz9PWG3oYo+1ow12ojBHuL7MSXsQ2RuLgL0W+TjCrwaxnIhGawbZdtU9t38F6qpt7+NIGkd7971vCO0Q+mE6ue7En9jeAn0056lwZCFwBN4tTnIrBLHrYWFDCp/kh9NoYT0JaMGG46xXEVYVKAkAn8o7+yOMklP1y+nNio0F8vqI98K6m/ZmxC4OCoZ/FVOxC9YGWS8HgvCmeHWCovEGmXFdfTV+mee93Y8Z22p5sfyxZB/yOh2X0v6gSJIB/Hbb4X7e9PQN3llspwlsbLDF3exorwoQcuwrnciZA6p79KolbNwFPgO5UempYDafJQn/mejgAtEmm+DdMuI32mqczzlGKynZYuuHrUBFCQ2enrhlMt1/0od9Z20PWIvbxCJsn7C3mCHo4dwdwpQE68vcVHsAILOYGXx3EtDNTaq6+AIUuAzKP5A7tXLd2w6nCg9YMwu7lgzStHIUfbq/k8yiLU9bwa7m3GwiB3IOGqQru2flCovJzSoS/AM/o98SCNFfeGwhLpApXmkaHSUaSN7BNYrss77hjVPG2joR43EjUGC0sHxMEcArKvQDnPREZft0vYdLLsvzgKkvZKrcNKnJ1zDwDHwuN7nuIwBeIY2dXboMyXRGMq96Q+dNGaV0MizkNhptQ8DAOs5Km13FNV7fhmpB9YFRNoPVBW5Yekv3KXqZI7Tigo3IUogr4xa/ByjDigIxPs4A/O2lUhLKFLY8jE/vzO9EiodMtQEvK8Do5SoWj6w0Dvhh0Ih388ZPa393Xia01Lowq0jgw== X-Microsoft-Antispam-Message-Info: 034zMLIY7RTjr9ik/zrDOiut4CXvPscrpEGWvbr75MSOnlvRewpqvQIFObHODRcE8T7Nu9L2wycNclXHYrUlBou+Rd2UBCUeXkuJ0l5iwuJA1D8gwna2wehV+Bz1quV03u8KJr2KyHJRmOpOp9j3MLdWLlasJqiSaYIteKJ2PNMJBKxL0Dfu6lmNGUWqshGOZLxw7uwKBYO5LUuud8Glf1zBcQC6Wc7SDOqDQxMefoFCN/yYa3kgUElXnVlEJOg+Rw2DfXE7UmjTBIW7137qHlYu73sneut7XnjDpnK2PYtGcSF3f5zVekBvtwzZaL0LUwjO5j9E9BKQ/QXkR+Phmpx8KJM6BAIkKP7mG1mOoMrzngXu9euLLuMuIn4UYsF+MclCXxuHxyW5ULFIAJpN9d04E7AQmzah9hi5p+fNMg8= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2019 18:54:36.5387 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 08493db8-7785-44d2-2beb-08d691e4b37f 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: CY1PR0701MB1931 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 | 17 ++++++++++++----- drivers/scsi/qla2xxx/qla_nvme.h | 2 +- 7 files changed, 39 insertions(+), 9 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..d6ba078d8255 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -358,17 +358,24 @@ 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); + cmd_pkt->control_flags = 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); + cmd_pkt->control_flags = 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 |= + 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 Wed Feb 13 18:53:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10810727 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 3BFF5922 for ; Wed, 13 Feb 2019 18:54:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BBAF29569 for ; Wed, 13 Feb 2019 18:54:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2012F2D52D; Wed, 13 Feb 2019 18:54:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-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 A60D929569 for ; Wed, 13 Feb 2019 18:54:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394315AbfBMSys (ORCPT ); Wed, 13 Feb 2019 13:54:48 -0500 Received: from mail-eopbgr790042.outbound.protection.outlook.com ([40.107.79.42]:37931 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2394301AbfBMSyr (ORCPT ); Wed, 13 Feb 2019 13:54:47 -0500 Received: from BYAPR07CA0069.namprd07.prod.outlook.com (2603:10b6:a03:60::46) 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; Wed, 13 Feb 2019 18:54:45 +0000 Received: from DM3NAM05FT051.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::208) by BYAPR07CA0069.outlook.office365.com (2603:10b6:a03:60::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Wed, 13 Feb 2019 18:54:45 +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 DM3NAM05FT051.mail.protection.outlook.com (10.152.98.165) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Wed, 13 Feb 2019 18:54:44 +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; Wed, 13 Feb 2019 10:53:35 -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 x1DIrYL6021699; Wed, 13 Feb 2019 10:53:34 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1DIrYcg021698; Wed, 13 Feb 2019 10:53:34 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 03/12] qla2xxx: Fix unload when NVMe devices are configured Date: Wed, 13 Feb 2019 10:53:15 -0800 Message-ID: <20190213185324.21652-4-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190213185324.21652-1-hmadhani@marvell.com> References: <20190213185324.21652-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131945576848119869;(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)(136003)(346002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(69596002)(81166006)(81156014)(105606002)(8676002)(97736004)(26005)(4326008)(42186006)(47776003)(80596001)(48376002)(68736007)(16586007)(76176011)(110136005)(106466001)(305945005)(85426001)(8936002)(2906002)(50466002)(87636003)(53936002)(446003)(86362001)(11346002)(54906003)(51416003)(14444005)(26826003)(486006)(2616005)(476003)(36906005)(126002)(6666004)(336012)(316002)(356004)(1076003)(36756003)(50226002)(498600001);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;DM3NAM05FT051;1:GKjTnUatkg1Bi+xYATVifRaEYd7jZ25jd7fmoXrNbI6XILEHtPoCKei/w0AYFqbTDooKnnabXcjh5uTPI+Pq1jwDuOcaRLV9f554LS9MG48t5hE4SlD+p6Zg9kDN9F8tK9HJzZ59AQVGPve+VmUMHw== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ae22c8be-8130-488c-8495-08d691e4b821 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: 094700CA91 X-Microsoft-Exchange-Diagnostics: 1;MWHPR07MB2911;23:k6/UXIFlLvHwB0WiQPkI3P0FXHKlg/MKfUF86rQJG9qvAMOS7ueF2oxguFuJm2xI1Mg+er0AybAOKikptyXhbbmWANiHNgY84qAyamcZ5AUAYb+EP/xdoLazMYexiS078zQk1UVVH5IWAn3JZyai0m+y1vnx3u+Q+6JN/A14AYa7LN+SAglXKzk/n4+Ydls10wyGgsU0ISmI4BCtgjkuzSWRJZE/WVh7pn9iQfXoTURzrLXayLVZ6vKFWQ5EkgKTKOsm6eXa+/256tIeFs0zZOqYPhfQgDT7gJ/AmzF44iZwToMKNt6jkbfI0R+8rOsILfi+rwaukZ4Ju+MRVPZOpeq7wClCZX89HmwtNFB50ZSErJqxdtxIHuU/0S5nymjF0828b2eRUi1HN+zBMSvlqX9vRVDI0hefotCWBn6/SibMqtCsjDPOlL7WnWNMOJku0tQZlNV92+58zqRSe1XOYHowKGPql1VG06J2ATXLWSwEvZjk4D57GVfAhU7ixIjBXzpxsRQB0I6R/EYk0OYKy+zHr/N8Cz1Nv4RDXMU8P6poyzBh1gw2zTBWSz2GocXS662vYYsnEp5+o+1ycKMIeeA1jHkdamGVCN+T6L/7lRGh+bW1JgqDGNxNGgVPEhjirK1aSXkGkn03qN+hPH4j1kMOvHFpoW/0rSDEjGccav+S268XsoU0W5bjG2Zo/d6lH+6qDtTcWmhLIEwVd/eHueFtiZR2186DAJXii35hXeejQnPRjEc1ZeW2OuRuglQ2vzDIJIcMwG1ZVW2zdCHwo/imZRVBropiNUY65jMoQaWJIrl0Ay4Uxk12vs3XL9O9JwcLxbc15aoX774d1WL8uRP4Vi5OZ6DiqPGBHwN01QBMK5RisAJy6O8f++oqqdX5La14WLodpz2EIJPnUjwgdzd4dcE4op43l+1LCahTwDBpn1de9badtXI5zvVayT5J3GxjcobJ+Vs8pg8976QkZe0MSf7xpeeBdCMmldKvB2+i+wlFAf7vApAjjp6GSZLNuBJbWPQ7/iGecyMOIkJ4j+wKg4uumJUAdZN1npZWJUqqaRjCt1LXU4GXDEEO7sB1M3mXhdpVb6ibOJrNGryqXyd/NtNVZyhl3nvYgwlNJiDrv+c5tmU/GaC1EnTzf88Ua4TxCaXNcoEZPtDua1s/3R1J2Z4xeb4mceSTyVnHCK5VwEC7+4QgdlIfi2o738m9OAYavLvLnb58e9pGdFefMg== X-Microsoft-Antispam-Message-Info: OJD4whkFOo3jDgqVh7AQdBxwhIjz80Y6VaMHk1z/rwTpsPqKWm+yXgAELtdy6PcpaejQfRHUXyfX/8bSA06uki5A4TjqY47FQNtzPOfdqXWKgWiZMVD0MQPF/0RmybtKjSMrG7aXQJAt4QtgmPZZMaRtpZVSCSxMAo7VgET7TOb2yuffsV5mKMpq6gU/yT5iC+NyC04UEtFfLLfSCL2JOPC930ebzZ/r99+JqcM048SwCYUN3KyAMYOUrO/XyDG5xaybxfE1IXNehpxuVIyuWHRlJwT2lSBA79r0u5swx91hAmT4mH44DmHqgflAtqXDuOvi/yCiuSL4cR+w5W06LdQZNEkdbtD0BStgUNv1D8rT2WWC0k5Jzb5zX0Kz7LyH6+ibYa0JrI5LznhYgAe4YiwUp/pnaNmCnrjizAcQKI8= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2019 18:54:44.3856 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ae22c8be-8130-488c-8495-08d691e4b821 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 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 d6ba078d8255..232b987e79dd 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -607,6 +607,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; @@ -614,6 +615,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) { @@ -630,23 +640,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 Wed Feb 13 18:53:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10810729 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 AC37013B4 for ; Wed, 13 Feb 2019 18:54:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C00729569 for ; Wed, 13 Feb 2019 18:54:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 901D92DEAD; Wed, 13 Feb 2019 18:54:52 +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 384A029569 for ; Wed, 13 Feb 2019 18:54:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403831AbfBMSyv (ORCPT ); Wed, 13 Feb 2019 13:54:51 -0500 Received: from mail-eopbgr740048.outbound.protection.outlook.com ([40.107.74.48]:8928 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2394301AbfBMSyt (ORCPT ); Wed, 13 Feb 2019 13:54:49 -0500 Received: from DM6PR07CA0042.namprd07.prod.outlook.com (2603:10b6:5:74::19) by CY1PR0701MB1931.namprd07.prod.outlook.com (2a01:111:e400:58fa::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Wed, 13 Feb 2019 18:54:47 +0000 Received: from DM3NAM05FT046.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::204) by DM6PR07CA0042.outlook.office365.com (2603:10b6:5:74::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Wed, 13 Feb 2019 18:54:47 +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 DM3NAM05FT046.mail.protection.outlook.com (10.152.98.160) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Wed, 13 Feb 2019 18:54:47 +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; Wed, 13 Feb 2019 10:53:38 -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 x1DIrbRv021703; Wed, 13 Feb 2019 10:53:37 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1DIrbmf021702; Wed, 13 Feb 2019 10:53:37 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 04/12] qla2xxx: Check for FW started flag before aborting Date: Wed, 13 Feb 2019 10:53:16 -0800 Message-ID: <20190213185324.21652-5-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190213185324.21652-1-hmadhani@marvell.com> References: <20190213185324.21652-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131945576877678982;(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)(346002)(39860400002)(396003)(136003)(376002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(97736004)(105606002)(36756003)(106466001)(1076003)(4326008)(6666004)(356004)(86362001)(47776003)(2906002)(36906005)(51416003)(53936002)(54906003)(42186006)(110136005)(16586007)(87636003)(126002)(80596001)(336012)(48376002)(316002)(50466002)(4744005)(476003)(8676002)(50226002)(11346002)(8936002)(85426001)(26826003)(486006)(446003)(81156014)(498600001)(81166006)(69596002)(68736007)(2616005)(76176011)(305945005)(26005);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0701MB1931;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM05FT046;1:YFbDsFQS2lDb6z/XDCjgtt+TtltUytiGGRnQwBBaJHfNySWJxHpBeN3YbkNQ/sWaubhyzS/1NrEsq3K8DdvpRSKTLaF9O1ZwZLl0c6Ny4eZEBIIXPBKFn2OIMUQP4q/k+vgyU4qxS+fPpIGS9SP/Ww== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c1e7ce08-2c6d-4c6c-134a-08d691e4b9f1 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:CY1PR0701MB1931; X-MS-TrafficTypeDiagnostic: CY1PR0701MB1931: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 094700CA91 X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1931;23:TogxocjY7/rAqcWnHDmwauUlK1FO0AR4vvaL2ckd99XSHGTGYn8bQmIkEts6KQtF9v1O6K8Vmdf/QXfv3ArPPeGmxuWLJPUki/E4Xbn7DN8hCx+MHwJX/zsCwkOgOqonH+0fpQnSK/rD9yrrEUnRSEXx7rZB+kJyGRR0eiDeISy/upHqponp4m2HUtL6DtJrlC4SKERxztMFJbyS0KDCFmXiZhQCAV82Jic5bfH9IHsjsXE1+4rwE+vG2ZiSSs246meP2RVDc8LuBrkvBlJUQAxgZIYnn/9lHvvKzFR2HQpDC4aQLuGyVOVNzv2ZJVWQBjQ5nuSI1aaPohxrPiG5t3Nn8vdzVuQIzuT4cDMLQaGR+OSonrjFCcVPBc6ng1BB5fBtsJEejd7WSAVXwfE4X8N+WTOHkoRbeMAEeEFd7ze049doSVX5pi+7PgPSKBIwbxargdBhYRtdgbkqjWKdVPSQf4bE244kxL/KIWA6tZgP20NiLdPGRsEYhv+mhK7SK4LzlDnIFZblQhKCqXdKgHx2dNmXBHiw5t3HSDK0DpB76RmoHCvgwk/1y7cBZdPnB/gDkECQaBusvy4nxAjuyQYxudzB6syjR0qaC1tMZhtZdOriVPNVs30NB8XpAoHB83orKDdZ09a5g7VRTj7uPVkiPVL2FdK1S9HuiNRSOappeT9wlIqXbsXngbKaFzklX6vCWjGm10BMrPKeWGmxSvz5+5ESodKvrK5/rTK1rD6PySFeyYgPrgx+Ez037KhfzwPP4yOysfOSSfdXtt1893UDBFTcLcf6erdUBm6DzWZ8UPt3tVtpIvhY/VShF0Vd4bS/oXwK4Ma3A0RpIF24Hrrn7ZYogKAhM5CMRf/1bmjvMKEBnPdlucPcnSgzdATiuXExaQ/R7FvxwKd9woqZyzlA7z1GZDeMmKW8bbbUzbOMa6xerIFCtxTiQ4YBUKQu9mGL/uX/SZmZ+lF3SDsEjFHZsQgnGrOT8sLYIK4q1R6ifS7LvZGL+ng2LCzUe6J3eWOMKPgXvHO7D3CAmmyXX/4mS++qDQ1x6e8XWsFl3jdhp2S1BF6RV1WD4fzhhiGCqWQBCe95AzzYuflaKJClBjQH4K+C7Arst2xL9Gm74SRH4awji2g3OnorIvHJcrwiflGoS2dCic5jy3DkC9dQESJ2o614kU1Am+jG+IHl7Mrj4I/h+7sVX4ntP9b5FwInJ+2KBQmw8l/kuqDLC1kNTA== X-Microsoft-Antispam-Message-Info: 5LLWEXCloHg0vwCFIIxhibHMc+4z1G4Kqv33cxa73CUIt+ND+pnCHLHdktF4CJbkb1y2wvf/waNIehat1p1I26topauu6XVlUQGZ+SHJ52l96YyxNkpvmOq8kkillCxyFn7ux7LkCukx6scDN+Jzc9SVmB+u5YAU3qSRCeprwJY6u79PbsBh/9YGFzzWDtLNF/4X62UMGJ10Vh1TISaEiKYrihaZH4ap2UBrhyp3BSRJxKEGzsntWpXEoIKDsU8FLeF22WQFaHjcZ69FczFdm+GtN+gSO7oGkfXKczsLz8+sh3omMV/2nE4NLcPOUcUB1rfRZ0Bw9DSDW+jPUUoSathISJ01DvhhZUm0+i+YUM5n2dn9ZE4V5MVtVSfv+K+B5N7Mo87JBGc0rb9o46DhUXXtCWHy2NUKswHguDlmub0= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2019 18:54:47.4206 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c1e7ce08-2c6d-4c6c-134a-08d691e4b9f1 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: CY1PR0701MB1931 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 232b987e79dd..41c85da3ab32 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 Wed Feb 13 18:53:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10810731 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 DA06B13B4 for ; Wed, 13 Feb 2019 18:54:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C955C2C95A for ; Wed, 13 Feb 2019 18:54:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE0B82DEAD; Wed, 13 Feb 2019 18:54:53 +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 818752D52D for ; Wed, 13 Feb 2019 18:54:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403841AbfBMSyv (ORCPT ); Wed, 13 Feb 2019 13:54:51 -0500 Received: from mail-eopbgr770071.outbound.protection.outlook.com ([40.107.77.71]:56224 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2394314AbfBMSys (ORCPT ); Wed, 13 Feb 2019 13:54:48 -0500 Received: from DM6PR07CA0042.namprd07.prod.outlook.com (2603:10b6:5:74::19) 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; Wed, 13 Feb 2019 18:54:47 +0000 Received: from DM3NAM05FT046.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::204) by DM6PR07CA0042.outlook.office365.com (2603:10b6:5:74::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Wed, 13 Feb 2019 18:54:47 +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 DM3NAM05FT046.mail.protection.outlook.com (10.152.98.160) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Wed, 13 Feb 2019 18:54:46 +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; Wed, 13 Feb 2019 10:53:41 -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 x1DIrfsO021707; Wed, 13 Feb 2019 10:53:41 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1DIrf0i021706; Wed, 13 Feb 2019 10:53:41 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 05/12] qla2xxx: Prevent multiple ADISC commands per session Date: Wed, 13 Feb 2019 10:53:17 -0800 Message-ID: <20190213185324.21652-6-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190213185324.21652-1-hmadhani@marvell.com> References: <20190213185324.21652-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131945576869502413;(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)(39860400002)(136003)(396003)(346002)(376002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(97736004)(446003)(106466001)(6666004)(2616005)(126002)(476003)(356004)(4744005)(1076003)(85426001)(11346002)(47776003)(486006)(36756003)(105606002)(53936002)(86362001)(68736007)(4326008)(2906002)(36906005)(54906003)(110136005)(8676002)(16586007)(316002)(8936002)(26826003)(50226002)(80596001)(305945005)(26005)(48376002)(69596002)(51416003)(81166006)(50466002)(76176011)(81156014)(336012)(42186006)(87636003)(498600001);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;DM3NAM05FT046;1:WN/TCMlXkr+9rsAmpbYCi/hHB0iglHclpSomcFFsLCqXDe26wvy/UKo7i+49vr+qxlhbbgCxEwKb00s5E8JqCtBYPBKmn2WBvMPagso7oBNSzI9y6uH1tJbU+D1XVu4xqXVTNeX5GD2ZMYmLE2pAJw== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3feee374-045b-4db4-a2a8-08d691e4b967 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: 094700CA91 X-Microsoft-Exchange-Diagnostics: 1;DM5PR07MB2908;23:BG6fXZZnLBxvLW4FQbPZhTgNKNqzZSN231b3fMS4j/2UE73IhHDrPry8VkAf7sJleqiGbBaqu6NcryLkwQHYYnt6uAXkhCIS+o257zvMnshMvw97lq+/aFr0zYOytpaQOaMmlz7kZWTIizIbIVASlmC5M4hkBUJ9DN7jSQenmrwlttbDtha+ssc+DKrWkstnUqLCTD5rRsxFQNjZ7pK2g5n/fbui7xA+6yv5ABL8mFespBJfJw64u0Q//RyCEO9Anxcb03w29g9XHsByFhEMkyfu1HQw/+Llhfu/57NiVblnIKLIx5XOc/Op/SmsV/kyQG+dEwrFManxgbexO0ZHHLljUFj0tXYesmNWE/1bkKUNpuu5c0NTZYrtmgFaTM2ZtPrCP2R7W6HHq/C9SN7nqDYxKeM0nAaxbGOVa3DlUOhxOsp/YHufJoQsAHfhWHjRLX28hjh7M/8r/sirbCYFTj6T2dM1Lpc8/x4608KsFVuRdK9BNgCacA/LYmpmx0segO3q3Bm1sP7+BDAz01vuP7uSaeSFn2u3wyEWIQZkJvpEd4RIcFs3WIABeUyBwVoJRdWsd2986anNlWMVDkHu98fKqr5b1w3Tf8a9IcZbfE5yNnPedSDjk4cGC2E2D3qI+OeC/uyuUatvcEfJfXl9gFNhi+D6Yx7mjxlsZ/lPA4tbvl7A5/HZLYbOym9Uq0wJCPLiRGuJMy8CJtmds9jJ282avf0bqubMoUNklGbqoOJW2K5MfzsDaLzcNCoqI5iKF5AfCqDgESXTsfW/Dw14Q+39PMUh+YdRbnbq69k5AbUWGnTRF46LE2UxXvGozLzEXi4JOiNov0KCP1uKo+Z+6PFF4QmNbdlLElMcBKOKVU/NPjKrQtnJbYq6ovoIRTDdvzX7fZAHib/aKQ/STmrrMPZOKkRtEugtjju4rY60r71irzpLdzssWgdpCcPGD8YH0pPqlSGTeZNVCRQE6zb+5RKGuC71RDl7DpS2yl1YjMz2T7uTKyaAWO+Y9QHDTtjg2uxTLsb+Ao1nom3OgsbK2vDCM0n15+9h5hVXyKKmA7T+kGSsxPFZpxBXaxsbzFNzh19zx0S9K0JlCrLB9ZkgcxGJ+u+Yxt5kquC5u3ff7f2w6YhXi0Jmi1J9o3lFYPtHmNR0oRdatBdk9E2wvpg8G+Thj6eollSjHFkpwrwYLH+lkJy2Ad/AWJtz21WupeRS/NJPHTdHg5RVzUb/M05pjw== X-Microsoft-Antispam-Message-Info: L/EqE26eSVTN68DyKQDc7ZlqBvWxvsrKseZDCfRPKsFYWA8+lgMQqSB8nhbNWaZkkmO9GLX7NKQbSP6r2+eFaEr1Qc6nPtPY/69eTjm9uSQuMwi3OtuTn/CTdoDXpD73awXPctfuGZWeFaGdDLKYZiRhO0eBY/sz413uMTgxPAxq2hYx6zJMa5038LLcl2z0oHmuP9sITKefzKXZdJeK19+Lrns2FknktMnxQ+6cQEFHs0C2A51dFaUEMw8UvS5cwEXfPTUts8wSELrddOafmWGRwqyFWWAaLE/Ux65tMQqqcghGgfjMUHkg+NgmwChO8yqNPorm6Ktwu6ecYVsKEE6n8sQWLAAsVK9vdHWBQdjtSTqaLRG4M7EP2GBg07sDVxdJtpJ2uDC51Exve/jXi8eCUo8NvujpXpxqInMGGjg= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2019 18:54:46.5279 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3feee374-045b-4db4-a2a8-08d691e4b967 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 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 Wed Feb 13 18:53:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10810737 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 4E5021575 for ; Wed, 13 Feb 2019 18:55:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3ADBB2E045 for ; Wed, 13 Feb 2019 18:55:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EF8A2E04A; Wed, 13 Feb 2019 18:55:04 +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 0CEB52E045 for ; Wed, 13 Feb 2019 18:55:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436550AbfBMSzB (ORCPT ); Wed, 13 Feb 2019 13:55:01 -0500 Received: from mail-eopbgr760072.outbound.protection.outlook.com ([40.107.76.72]:17376 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2436551AbfBMSy7 (ORCPT ); Wed, 13 Feb 2019 13:54:59 -0500 Received: from BYAPR07CA0049.namprd07.prod.outlook.com (2603:10b6:a03:60::26) by BY1PR0701MB1927.namprd07.prod.outlook.com (2a01:111:e400:51aa::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Wed, 13 Feb 2019 18:54:53 +0000 Received: from DM3NAM05FT011.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::209) by BYAPR07CA0049.outlook.office365.com (2603:10b6:a03:60::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Wed, 13 Feb 2019 18:54:53 +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 DM3NAM05FT011.mail.protection.outlook.com (10.152.98.120) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Wed, 13 Feb 2019 18:54:52 +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; Wed, 13 Feb 2019 10:53:44 -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 x1DIriaC021711; Wed, 13 Feb 2019 10:53:44 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1DIrikl021710; Wed, 13 Feb 2019 10:53:44 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 06/12] qla2xxx: Add support for setting port speed Date: Wed, 13 Feb 2019 10:53:18 -0800 Message-ID: <20190213185324.21652-7-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190213185324.21652-1-hmadhani@marvell.com> References: <20190213185324.21652-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131945576931721579;(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)(39860400002)(376002)(396003)(136003)(346002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(97736004)(110136005)(498600001)(87636003)(54906003)(53936002)(42186006)(16586007)(316002)(1076003)(8936002)(85426001)(81156014)(8676002)(81166006)(86362001)(47776003)(36756003)(36906005)(26826003)(14444005)(356004)(4326008)(6666004)(336012)(80596001)(68736007)(51416003)(106466001)(11346002)(105606002)(26005)(76176011)(476003)(2616005)(446003)(50466002)(305945005)(48376002)(50226002)(69596002)(486006)(126002)(2906002);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR0701MB1927;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM05FT011;1:aNvY5Yz8c/oABby3WLjz7TvSKI4hXTLGWTbFlYl52/VgB+T9kExyyu5GuKHfVpI36qoegcZGZ3KE0E0oYWAdVPwE7XQMJlM21xs7kyNEMNW1TbOxgMC/bgyKdCMy9h7DziMojDtDcxKdrg0TtxK/bw== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 55abcb69-6956-4db4-8c2c-08d691e4bd29 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:BY1PR0701MB1927; X-MS-TrafficTypeDiagnostic: BY1PR0701MB1927: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 094700CA91 X-Microsoft-Exchange-Diagnostics: 1;BY1PR0701MB1927;23:8wdu+HGQLRKvH8d7MVhl+bAMtdpr5teqkeZuapyyHD3f1TI8d/J9yRjD+yEr2h9aGCoDwSNCMfVomyoWnKojAJXY1Jl4bd7v4bmYzea2e00FCiQtGc0huyGtrwEihW5laJicBempG8j5YgJZxGrr0JK+V0t3ngJ83QI3rBctVy5H/QRa1Jj3s6BXBy4O7fBNjTwf5pqtXhAt+12Ih5k3faOWTw5g0/N+H7EZjviHFkIrWSIovHMV5pwBlrXhR0zhH/8E4664fzMIbLxDuvqY7Umx3yEaz6thy9AepoIf6l/Ktp9ZUVajGly7O5cKqLx921n+3mb8L3DhfZnVr8edY75TqBq4mCJFmCjdxdgMb/DsQkaEJe7/E1j3fEoaZIJhb+zh5AE9P4TRk+vv9ptU+fP3DJ80mhi2wcP3vp1rUozxoYcjPkW5BSSVWdogBg3Zfao3evLAwbtQM4Wt/VGfROWsjoJil6LSvU8JT3N3Pj14B3G4yj7czEmw8KxuZ0bm9GccXZKRUf9d0005RM4rYZaTJV8YcCyqF4Ft69rah+ACikGSdcamymuNMXUJC2vokA2iYQWjK4Csu4h4nnF+YdZIUdaD/47pEOeNHU8tLogFdp0Kr1e3BWoLAol2csHUqDYIVB5IFQkJwjHMf18vqvk2WeKx3fqCoEW96SpQ/+rDj400lasgtVkadJ/Z0dYmiAHAm13EzOJ7LmFuajy3TCdZDTPpbjZHyIztxq1xt55CxfOJLkLnKo469GA8xUaY6g1BQ3mEe/FWHtnA3JZm3Fv5IexsmjcXLMG8zN4iKExVqY3dsGRfCqzr8gtWHa8KUjMQZrCPfSGOPyhH89XMj0H5x/lrcyQimidpGyhQo+skjTnEcNpkrPavrhuBtHkrLCA/hjPluw45xkvYqs/bnyIwE+FTFJ2JMGLIFVjpojKwFmmPeZGVRLx1octOHnk5k89joMpVDnbeKu87O1eZBoBAwuMFaloHZZgr62Lu3j+SEPsb4YMfC0fyC0pvnwbIOwdyTMNr8R99SU+2rQVhuLOSDFlFOB94VP0fRcqzzlKrfsMgFIAuuVKCfYjg1fCHdoBXVK2yqHJc1fyx6JEv/uK1KjVv/C6yLRzaAae1CSuMmBtOlx26QY4sUnFfbIHD1tw3QjcHiiP9Gv9fefaw5/KANUrlt3Ozh9vsYzyac1zxlrUDssZ2Tzd4RjWaJ01HDdOU4amKZ8zSnIz76+ar+A== X-Microsoft-Antispam-Message-Info: ABQSnWfz0K8NGMgJAhdwxIey3qQxbzgfVR0dm4XNnC7lrs0Y8im+5dlga7K5xGvj1GBDQ3aw7IBinqfQp10M8XAwGkwXO7z6VH+yQBX9syV4ZrYPqQVmuYm2Oxz9IRUy09SVqepDV5g9OLBqYiIGPRCTzZPGT7oSI8pNhBbo39uF9Qo8ae/IsZZFza/Cd+5ITj4aBzG+RlgojVGkF6Ech8Upctj4RAi9o96hIn4BYAnwfR6QbtMQZUco75QsmWig+D9c16z/nkVjEZG54g9QFPA0wKDrNNc29bdiWvcBOIZ7Iwq3UUh3i7uKanQrjhDlx/EN65XAsFUmsdVk+rSoT8TjkcZzpPLV8TWbWotjAXZVxqcta9V8lTJvoaZNCA5slqlV4yl1ahibHED/oYShTI4vkASvqBquZvyS/CZsHt8= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2019 18:54:52.7548 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 55abcb69-6956-4db4-8c2c-08d691e4bd29 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: BY1PR0701MB1927 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 Wed Feb 13 18:53:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10810733 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 318BC922 for ; Wed, 13 Feb 2019 18:54:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 207C82DEAD for ; Wed, 13 Feb 2019 18:54:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 150EA2E047; Wed, 13 Feb 2019 18:54:57 +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 AF2A22DEAD for ; Wed, 13 Feb 2019 18:54:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436554AbfBMSyz (ORCPT ); Wed, 13 Feb 2019 13:54:55 -0500 Received: from mail-eopbgr810054.outbound.protection.outlook.com ([40.107.81.54]:44832 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2436550AbfBMSyx (ORCPT ); Wed, 13 Feb 2019 13:54:53 -0500 Received: from BYAPR07CA0068.namprd07.prod.outlook.com (2603:10b6:a03:60::45) by MWHPR07MB2910.namprd07.prod.outlook.com (2603:10b6:300:1e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.22; Wed, 13 Feb 2019 18:54:52 +0000 Received: from DM3NAM05FT011.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::203) by BYAPR07CA0068.outlook.office365.com (2603:10b6:a03:60::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Wed, 13 Feb 2019 18:54:52 +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 DM3NAM05FT011.mail.protection.outlook.com (10.152.98.120) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Wed, 13 Feb 2019 18:54:51 +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; Wed, 13 Feb 2019 10:53:47 -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 x1DIrloO021715; Wed, 13 Feb 2019 10:53:47 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1DIrlj0021714; Wed, 13 Feb 2019 10:53:47 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 07/12] qla2xxx: Prevent SysFS access when chip is down Date: Wed, 13 Feb 2019 10:53:19 -0800 Message-ID: <20190213185324.21652-8-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190213185324.21652-1-hmadhani@marvell.com> References: <20190213185324.21652-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131945576921013042;(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)(39860400002)(136003)(376002)(346002)(396003)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(47776003)(26005)(336012)(4744005)(87636003)(86362001)(305945005)(51416003)(36756003)(80596001)(48376002)(1076003)(76176011)(69596002)(54906003)(2616005)(11346002)(446003)(126002)(476003)(53936002)(486006)(50466002)(4326008)(105606002)(106466001)(8676002)(356004)(2906002)(316002)(81166006)(110136005)(26826003)(16586007)(97736004)(498600001)(50226002)(85426001)(36906005)(42186006)(68736007)(81156014)(6666004)(8936002);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR07MB2910;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM05FT011;1:b1ULehvvkK1+HQGRJOxtIevDp5iDrFuFrgSU0h2sSpV6CtLw2EN/a2fYQNu8Y07e6Px4iWtJr20F1TpGwygvNfmVEPeux/bvHHtcaMclaAbD0xQt2pQVZG54DId3lgg5SCOkZqzNlC44vV3F35BtTA== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8805567a-e33f-48ed-f232-08d691e4bc77 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:MWHPR07MB2910; X-MS-TrafficTypeDiagnostic: MWHPR07MB2910: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 094700CA91 X-Microsoft-Exchange-Diagnostics: 1;MWHPR07MB2910;23:/rDFhmIRHpa9ecscxauPZKHH6A2aKD3bj899hyTdSGIni1p7yPY39HsuMy+L2VdxRDwIrv7+m8WZnmuSCL9JJ3P39Ukr2GZ2V5uh7AYK9qxDRS2+ZVvRZ52emyI2j6iO638LxPGCSD+NcPhOHzA/IqW017dqI18U5C6fXVnGzPbB2DWHieOd/zrvsZRVvO5GdHJFskxVgeBXU33udVXseRRTgkFd9Hn9eJNsbVqHjOXplJMvncsi+Dnr277aytXLZR3tIpk9PvGPGS6pGkoUoxrhIBmQ2Gc7dc2ouxGd9V3enbSTiqenw4YYIgony3D8aHwnphg9ptgIYi1fwlHAFxDAFmFtCFiR/V27v2eWzryXh7h4OztH0JIXVoFn7nuh9Vils7FHAt3VZ2OVLgUo3MFCC6HtXRX8VZ8eg7yhvJuwQtf25kGNRA/SkLt26p1PfAFpZD6pVm3tFnAgMPdqnyjOnEeIEjY2VbrTODr69XLmNhFTYGEXDJpHYapt9cMB+7ToCaHPRXNpWGD+yNX+TQHNOSJ/JfevxMteaUMe1sV5KnxN+D0xM+HZTbXlUG0kHwqHXV9teS+d9BG5lZtn+4NFROnQ3DK4xYdSS3YLvst891k+ncTJQMupdAsYlm/knXG6zJTmSNj8GkCNKE9CCOvRL2fkFb01OCyGTP5DRZ7d+5r9L5A2mEn0yWEPE8M3LOkrsa3aBlj+P02vuEWoZNSzGu1hYD4KoX+hSakCxpep+ceOzL1IhfXWRMBJcqDHmjlgucVmXT1+F9Cw0ug2m+fgGQd5rQWOIbVxedoNPamVx+9Uw3F6J28QzGfDIRuOe+9ZR/NzVgAhsgvDSZXmfOOjLZjiFHeXS69MsjedHaKBFMb4M+1wOOFDyIFGrOo9JSlNUOLmKT4dpp6CD7hZXXSsEaXZoYohKVeDcyN0Nk863J0AsZytn8DCDQZdY89hKCzuKeR3prgETBaP5HoHbzhpmRdsvYWnZawfepjpyCizPV/ZGRt4SK4Y8g1XK35nVHnOnKBWVcgOvOX1o93GM47+uXaR3K+y+czJeLzv3rDpvsWGUwoMkZwi2wwLUpPVXZ3zBPcBGI4PMbyd0vhmPXrGs4lGEA0SNyvn6eR/7ThPT5gNZUrW6oRrI1Sr44RoQFNATFjpKjhbW1URpPcF5a8j6LnotY0MgIbW57gDE3MvJXnRTUbkLDesSuASrck+QRZUuXUSj1T900A5WvPtgA== X-Microsoft-Antispam-Message-Info: d5yZpPATs9UAubdHc9Jhflnm/PSlcnIpPrwVaMzeREVeXPQrIAM3ZcCny/Tiy4O0kmSxMV3l4Mv74hD70uF05+5lm6GMNjU7iTtkFiPNTA470RMmfaWHKPq+tCXcY88MdDjV7hFM767eyEMUyq3mqGrRlC+o9qUFw0NlE0huQ/J5R6IeS5z9j1V+wDOnLpVTIL3PGUrz8DWv5Ah9SHbNbwdRZvhYVoiiVy7CM5BmmQpPyw6VS7QXz0CnKCFD+0cZ6ZG+VsW3upiiW0ErWwX0dPRrwXI/KEppu5DQsD59dCS/OqapxtyL4CWqTH23KjayvlWCPpiUW9pLdqVCovSUXLaQUQbvGVUFhVUCSZBpNeJc6JZLpu6AZ9Gay0iFCJZ2mH5Kcqvc05yPWPufXDnRo3AF30S8XpKQX0x6Nc4bwHA= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2019 18:54:51.6519 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8805567a-e33f-48ed-f232-08d691e4bc77 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: MWHPR07MB2910 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index dcdfcf3bc955..ad947bdbc924 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; From patchwork Wed Feb 13 18:53:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10810735 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 C1A3D13B4 for ; Wed, 13 Feb 2019 18:55:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6F8E2D52D for ; Wed, 13 Feb 2019 18:55:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98EB12E047; Wed, 13 Feb 2019 18:55:03 +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 7D7CC2E04A for ; Wed, 13 Feb 2019 18:55:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436552AbfBMSzB (ORCPT ); Wed, 13 Feb 2019 13:55:01 -0500 Received: from mail-eopbgr810088.outbound.protection.outlook.com ([40.107.81.88]:40436 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2403932AbfBMSzA (ORCPT ); Wed, 13 Feb 2019 13:55:00 -0500 Received: from SN4PR0701CA0005.namprd07.prod.outlook.com (2603:10b6:803:28::15) by DM5PR07MB2905.namprd07.prod.outlook.com (2603:10b6:3:9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.21; Wed, 13 Feb 2019 18:54:57 +0000 Received: from DM3NAM05FT004.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::203) by SN4PR0701CA0005.outlook.office365.com (2603:10b6:803:28::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Wed, 13 Feb 2019 18:54:57 +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 DM3NAM05FT004.mail.protection.outlook.com (10.152.98.109) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Wed, 13 Feb 2019 18:54:56 +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; Wed, 13 Feb 2019 10:53:51 -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 x1DIro8G021719; Wed, 13 Feb 2019 10:53:50 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1DIroT5021718; Wed, 13 Feb 2019 10:53:50 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 08/12] qla2xxx: Add workqueue to delete fcport from bsg sp->free(). Date: Wed, 13 Feb 2019 10:53:20 -0800 Message-ID: <20190213185324.21652-9-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190213185324.21652-1-hmadhani@marvell.com> References: <20190213185324.21652-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131945576969950717;(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)(39860400002)(376002)(346002)(136003)(396003)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(85426001)(54906003)(48376002)(316002)(36906005)(42186006)(16586007)(110136005)(50466002)(51416003)(76176011)(80596001)(446003)(2616005)(126002)(486006)(11346002)(26005)(336012)(36756003)(69596002)(1076003)(97736004)(68736007)(476003)(6666004)(356004)(105606002)(305945005)(47776003)(4326008)(106466001)(14444005)(86362001)(8936002)(50226002)(2906002)(8676002)(81166006)(81156014)(53936002)(87636003)(26826003)(498600001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR07MB2905;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM05FT004;1:nSLwOZAtoKYbkYSB01a6CEQ9riViHMEFnr87nCul2U0wlJDXb+LXVJ5EJMfhhSHZytnJAccpOHENuZqJs7IpzzjqZ/FD+b7FNe/9PdEWoz9iM5XLsV8/Ww9rffQBwKaRbel/pHnNNmOz6IVkxfV/iA== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7e8583db-fce6-4e0a-24ca-08d691e4bf6c X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:DM5PR07MB2905; X-MS-TrafficTypeDiagnostic: DM5PR07MB2905: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 094700CA91 X-Microsoft-Exchange-Diagnostics: 1;DM5PR07MB2905;23:fQR5mtfc3FFxY0luTfYZY+zGEpowxs7drNrYTSJEtOJe2eHebAH3y15lW93jmU2PPbMQZ8W7ggUlNInlZh6QxbASnan6a5HqowETCMBWRbO3waPu6MMsWzZtO04ySNfIkiSZbIrwx882e+fOy181zaR4yVvXl6FC31Vpt7DawSZam7gFT5UbNU6HdfcaUha2tzu2MK17Dd5XhkcStGE3xA4GcmZjDSRMmGfi7AreABrZZD5ajVo0OaXRWNOJTgJ8yjZgi4fFu5K5y4K+3JWtj3NzNBeWWolajwpIGAvdDwPZpFfrydhu5N7E1f5IRtGm6T8WLEC7/acWwQcpShkqnExNCIyQYBAK2amhyiYSatLZG7q+E85Dwf0zZ1eFVJmMXBwOMqEneosg3rdD91wh2I2C3sQRlE6GMQn80pbzdJihINWZvJfwe+8agrrU0JlnzVBI9G/fk7M83BvbdceVYqq4QFHXiuRhPAYr3ElYG+xrz8WdsQKbOMvsCTDnwo1kEIen5ZW0jGtfB6eW7soH5dSI3txEeJH4DFN7pqIeKpdqpKro1s9FRSN6YJBVrm5AKJQMz7Yd9Oc/QY2ZlTzmmjsBSY8DCwqRSHaSio677brdZXv/hA8oszf2A5l6PwZXP0J4RYpso99lqZ5uGeP36CUyv3bRAKH+37l8jWNjvGYp3ma/xMJR7ADicJ0chjD263EgcnWRz9auLNV9gHcReXnkvLi9tPUYdI10RDRDr/n93PHCaXQ66OE4In3h9vP1AJllSjC7wxC/EZROlf5XQg9eNob6lnqKx3eATimhZxbf0k0K9l15qBrjfCdsCCnzx4m6Sj9wMDhlpU+dbURhgyCtaiuCu2T0hgXy1AP8tzwvz/9+XwIH+ZjW2scps6OZs6PKkeP3X95wcalLFtjqTRay+zAu+AG6RnUNjRYRTUYtRwnT6dYIAvbxvbvRyDphEQ/WtezWklqQOi6juAB/3kIDggnYahHOMJ5zTQ+Jxkqqf/IpOAJ7mMpj9RJJMMoO7TtcZJzkqHv8X9Yw4L0RkyiN27NCHtViaN/eraZI2WDEsxiq2XTS2EX8uZfn/FVOLd68SNyE3/xzlNu+Wc81x6Y3L09HOa9OXQJp1wVh+gMCWcQXfXBYm6Y0hEWsff0cDMpkpt0+npMI6Wr2CGaAnLduhbHeVdgASvCiJo9AfmfnVqL2MTIoPe02AVVqWfi3MQfzu0qPRMBPPZ/1Bfsf+g== X-Microsoft-Antispam-Message-Info: 9Nq301G8yaL9Pl1czn7LAl+kZ57B6GhSS+4rnSbJyP6vWvY89zqJE7VkFY2XkcYm152DmymPIspW7k05auyrWbWM1CpMsCUqa/9cHMEFkabFwUkH1pnnnrlOhSZ9pP7xeHXMNK8ejz0Ij4vj8RbKycQWBfn1cabUJ6L5UIXWAZ0k8sNBCvsitIhz+Fy0d2aBm7MWTmglat7WiZuSmVV6Hy6j4cuR/o/2GE06A/gNH1zOmMx3N8nI5a/yXE0NQ7NNC3qO6z1wpjJeTRhYJ+vRw3HQ0pRyD+vMB5tM5e1021N4tsPWBxnfWOmsi1VCPzp5KhVgFkl5o/HGEMgFv0EDwVvmrB4io2FiOuXWVDwWgxTkMCdW/uSbrDwBuTjv60DBsVFxF9/4K6SguSu5cJe1UtsBJT7RbxjW8Hs3YghNHjo= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2019 18:54:56.6257 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7e8583db-fce6-4e0a-24ca-08d691e4bf6c 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: DM5PR07MB2905 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 Wed Feb 13 18:53:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10810745 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 035AA922 for ; Wed, 13 Feb 2019 18:55:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5BF02D52D for ; Wed, 13 Feb 2019 18:55:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA53C2E047; Wed, 13 Feb 2019 18:55:12 +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 E16B72D52D for ; Wed, 13 Feb 2019 18:55:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436560AbfBMSzK (ORCPT ); Wed, 13 Feb 2019 13:55:10 -0500 Received: from mail-eopbgr680052.outbound.protection.outlook.com ([40.107.68.52]:46816 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2403932AbfBMSzI (ORCPT ); Wed, 13 Feb 2019 13:55:08 -0500 Received: from BYAPR07CA0101.namprd07.prod.outlook.com (2603:10b6:a03:12b::42) 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.1622.16; Wed, 13 Feb 2019 18:55:04 +0000 Received: from DM3NAM05FT053.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::207) by BYAPR07CA0101.outlook.office365.com (2603:10b6:a03:12b::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; Wed, 13 Feb 2019 18:55:04 +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 DM3NAM05FT053.mail.protection.outlook.com (10.152.98.167) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Wed, 13 Feb 2019 18:55:03 +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; Wed, 13 Feb 2019 10:53:54 -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 x1DIrrwh021723; Wed, 13 Feb 2019 10:53:53 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1DIrrkO021722; Wed, 13 Feb 2019 10:53:53 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 09/12] qla2xxx: Move marker request behind QPair Date: Wed, 13 Feb 2019 10:53:21 -0800 Message-ID: <20190213185324.21652-10-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190213185324.21652-1-hmadhani@marvell.com> References: <20190213185324.21652-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131945577043364253;(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)(39860400002)(136003)(376002)(396003)(346002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(86362001)(80596001)(69596002)(2906002)(30864003)(76176011)(8936002)(47776003)(87636003)(51416003)(50226002)(305945005)(336012)(42186006)(8676002)(81156014)(81166006)(316002)(16586007)(36906005)(54906003)(110136005)(26005)(68736007)(26826003)(498600001)(4326008)(1076003)(356004)(6666004)(53936002)(105606002)(486006)(97736004)(36756003)(48376002)(85426001)(50466002)(14444005)(446003)(106466001)(11346002)(2616005)(126002)(476003);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR0701MB1928;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM05FT053;1:1SQr9A59iGKv5ePhdcn3Jfp98v/Yfv9Clde4AmV3ATJMMMO049Q/pooKNnAXuafXnc0u6q4J9GLYl+fG/6+E+sya89td45qc14LY4WrrB7b6HVswR6vOH1m5J3oHvFgOo2Mu2bk366d+NoYU635MIA== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9b07cbd2-3507-4be9-1471-08d691e4c3d1 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: 094700CA91 X-Microsoft-Exchange-Diagnostics: 1;BY1PR0701MB1928;23:GT3BzF79Cq9s29kXvbEm7AHX3d7Ohfl5JuMucY37PXaT0VJwQJCu6oBqZVfaKIKT1y0cLofmsaAknR9FOFp9ASK0IERS8Ls3UDxWbJUsm/pTEQcEDf8DCX/oKCfmNeWagzteBR1zVyIac+jsd1S7tdB5n5LWpYRQikmYDe4Mqfwu+XyU17cC46JwRkg4Jj3SJJFmYGHZ+h3MKftXH8fnU6iylN4QqlrjtRT5ervvG8crS3ZvmrrQjuJalu8GS9GuSLRvPFExgR+QY2/MqOEAk9Li26sgPIqra1YmrwYyOlsCuEVyFLo8EP/Kapy61Vmih5OuifCwV2/0knV3+bS8jtRtN3aY8LNEvm6JX5mqWjcU1Rg0W7JwueR/Ler3iHZE1FIUD+5VZXglMSw0dHQBewkAxxVgryOPefQ1JADF4J9eizscP8A9WN4wi9mnp1l5GWVxd8FLTVCra43vcP36YRMmAcdGV/jM+xeWbjlzvT9zbvv2kGz7PP4dRqtxeS/Zwj0UQ5qC71rsLZMmbF9JjHiaWY9AfCm60RhkLiVYLnTsb8sEdcNH6JtPLqEXSY9MxXCrDg9t1C34NEXJtJyMmg6jKN2WwdGwvm5JqqGh8xGYztgmDK+i5HrPr/OFsnwm2veZ3d01sYu7POX21W1JNoQ5dpjHNTQgcfJVW4sTViloMvQEjmGhUUk+7WimEC+Rhn9NQVGF1HvRA5Xy35xtA7EUZ9csDsIaISyGdRBYrHJXVjPM7llmwATjbTngIPCIMq+s0gnlvi7VqMkjWVj+7+8RT9BP92rQAXMZ2ZUZv3eB8MnS6Hpz6dFWkfnSWACa2X/kUvXOGq9wxkQ4ijk6hE3AB1jP2zRvrQrKwu9aoRHNMXX4Qqq6bVCCZ/56Mg+RHDv7jT1f+pd7OTBo8yiEJiJLjGCC8iVHFIgzDevcFPxferXR3/BIVhp+dmkIpspnnPjepTHvm25DEdbjGcrrvlhpoLEzf3R/ng8eDFWhqg2PYiejlagBKDmIr6/4umpTG/rGH3I8pghnhV1IxhjBVNlTE9kF7+Fu1+dw3N/I0AboA3Hnn8LctJybPmMu5oEQ/xL50idK9vX8DGoWi3CxHdH3IIlepEz6KYy14i0TaTb8e2U0MkXJ4G1hoxOMCe5vcVWpkWmSSvV6HKU+G+Ekv0qgAhV9b09+noM8ua5Wy1LcjYMgcLqBu+qE3Bv56rvIoXWbE/DJrElo8Bu9tyNovXz9BvRlr0J+wbMkqV6oS4c= X-Microsoft-Antispam-Message-Info: eu6epJTPHV3PQrqd/yLz+HQUUBcqZFyNNSbQUsV1i6Xg/3P/k7jfp96gfH7+FK/gbYGttt4E1t1EVSKZiAmsuSnXHPwUKUbRHTKD07bWW3MKJ2lUfjPjok83LZb/g4/Y+a69bmC7QxOMIVMJ5ksb5EcKOynSOlj4WdiJuTphIPAxsmGyWPgthXcs9VV/Qggv+rDzmef06+WbXdsyNCVVVP6g0m5w4YjifNKgIQtFA5Of1onoiBTjoV9aqzroekMIetEJHBdfdRvWN67vNeED34DdbP/IrI6NaDW1xlxIAZ4ZAk3r1OrbJEWeZ9UBpHwGIUdLJo22tnkvqJqpH4jJ184OPmwW6PonKBMaiOh8NjjkOcAcjJ6Rd62HfiD6vf25Qv4bzZhPYpZy9PYOXWt9DEXlZGa2x70xUOTTvRpnMeU= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2019 18:55:03.9841 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9b07cbd2-3507-4be9-1471-08d691e4c3d1 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: 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 Wed Feb 13 18:53:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10810739 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 E97C1922 for ; Wed, 13 Feb 2019 18:55:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7D642D52D for ; Wed, 13 Feb 2019 18:55:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CAF852E04A; Wed, 13 Feb 2019 18:55:09 +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 5DF132D52D for ; Wed, 13 Feb 2019 18:55:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436559AbfBMSzI (ORCPT ); Wed, 13 Feb 2019 13:55:08 -0500 Received: from mail-eopbgr760082.outbound.protection.outlook.com ([40.107.76.82]:16608 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2403878AbfBMSzG (ORCPT ); Wed, 13 Feb 2019 13:55:06 -0500 Received: from BYAPR07CA0101.namprd07.prod.outlook.com (2603:10b6:a03:12b::42) by BYAPR07MB5463.namprd07.prod.outlook.com (2603:10b6:a03:96::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.21; Wed, 13 Feb 2019 18:55:03 +0000 Received: from DM3NAM05FT053.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::207) by BYAPR07CA0101.outlook.office365.com (2603:10b6:a03:12b::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; Wed, 13 Feb 2019 18:55:03 +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 DM3NAM05FT053.mail.protection.outlook.com (10.152.98.167) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Wed, 13 Feb 2019 18:55:03 +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; Wed, 13 Feb 2019 10:53:54 -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 x1DIrsWV021727; Wed, 13 Feb 2019 10:53:54 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1DIrsbc021726; Wed, 13 Feb 2019 10:53:54 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 10/12] qla2xxx: Fix code indentation for qla27xx_fwdt_entry Date: Wed, 13 Feb 2019 10:53:22 -0800 Message-ID: <20190213185324.21652-11-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190213185324.21652-1-hmadhani@marvell.com> References: <20190213185324.21652-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131945577034607305;(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)(346002)(396003)(376002)(136003)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(97736004)(486006)(446003)(356004)(6666004)(11346002)(85426001)(106466001)(2616005)(126002)(476003)(1076003)(105606002)(47776003)(36756003)(86362001)(53936002)(87636003)(4326008)(68736007)(26826003)(54906003)(36906005)(50226002)(110136005)(336012)(498600001)(16586007)(42186006)(2906002)(316002)(8936002)(8676002)(26005)(305945005)(80596001)(69596002)(81156014)(76176011)(50466002)(48376002)(51416003)(81166006);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR07MB5463;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM05FT053;1:6KSOLY6XiZPTkQLm+8vjgNGGJI+EwYa6QWGQtMKY6ve4vafBWmwbVYpK4qZJ7xuWSaZRdZb8otabTGP3c9k7ya0oClbTHu8buwtVLbkQg3J2w/taBQ5Xfq4VuVCyUiInw4MgFLLDSIL/fN4tqkFtkw== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6e30a5eb-1757-4d29-9c75-08d691e4c34b X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:BYAPR07MB5463; X-MS-TrafficTypeDiagnostic: BYAPR07MB5463: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 094700CA91 X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB5463;23:EGQsC8f4seEGum1+3hLAy29elYfJl4vs3avlaEx76PwAodMdHZV2jN5kSKhvrfb8S3qTKUGbqwo0ShSdXXOc5W+It3EqnwhhSE7dI44IopCjRxEFIpJ4gp3kvEBizlhDUIThU8X3kcgHb8PQRcxalpEswl/io+SHk8mPQfHXT7Re7q7m3S0TN+YFEjedQrhuIRwgUtA9U7+7EQm/qe3KbcnoTNmCPa0O/W/qKSojH6PEKjFHtx5IXDsyJZC0aaXck2JdgxJE/TOd53t+uDteHXg4paF5eJM8m7GHklagx/wkYQKNUyjEfgsjFHG5NFzFAREtib/16muW2T2A8AMqTGoalnpWk8er6XIZQMX3ufI20xfALm9KSLozyHmtJ7U/VoQvhRzoQKME6l8L2Jgxkf9MYD3J8xhe8/v2Ebg4bm9YorY2Fd1KYS0BNPp3kdAhva3TwrUSpC8yewfUAIY2rwfyru+tKBx0Uoha0l5xT1YgVbjxm6ELGlHxUBiRXadhXp1/LprnVviDUOxK1vyFCjQ3pJ2dsyIl8e8PtGA/1OI0LEMu4aOOvZAVm7hN4ajNNQmJPZq9e4avNLCsS9i1MESYwFZ1eatWCQQqeJkvu9tJjYMRuFBzVa0jupeMHi4cBLH16tBbytU0bZnnuT3xa1zFyzwrpCTFKKwEEoz5B3aRsvmDLvQ/MeC/itMTNv3D8o7gaVLbxIHM1s0DRra0jLpGzFIsdOSumSQX94oBQyy1WHoH3vxpMKt2+KJPE7FAN2raAPHO/veJitLQQX373w16jgeBRB+2oE7xwTuHEBiCfn0la19gts777iIEAgaXdlLrPtutyn55LhoK0PVTQEI4wj7lDkAZ4H/syiRyNbsylz17rIoVTz0ZmLCJCYzbh4mB2kXwsLMA4oH0AbUO04u8v/ySkYMXqYlqPQDAVvx+rymAKWXPkRl8kVfbfNaM2zywzCy+hkaIxx3FpLi/Pbke5vF0vhUs9DjqHk7uEHRuNKtLXAxR6LixNKVtk8DIHRrIIO3cCk1iMrZX+OcNShoN42hidf9gnVK3A2UjrsxeN1d3IQMio9zei7GO4m57WTwtaAyWkcPbatcrm2l7EJURy5kA+5rNJVigmiiowOXnaS7DV1K+bYXk46obDAQ0bk3RMk721X+qcf4EY20ZJk4LsPjLs6UpMGIxnvyb6QwhAp1rqqCbcmuBHCVJElgt X-Microsoft-Antispam-Message-Info: R1CIfPBYSygCsN7+YfiE9REY2bHng7SMfYtU5YMZe4DevQ3Dh9soJ8ENGKj5qEdtcDsBOnKqAzce0zY9LfRnfJq1jp6Q0bHUEkg1m3k3TFaRg0LK6j21yWmQjVtQgJPeBh7tgzNV/lOwNwfFM/n5ntU3nqjV+Eq7zZbWKpfwNSw5friAFd0zSau/1Sj0nAHZPVqcbm5D0QyKlucRXaRzrPRrLHU44UaFR8Ert2ddj+XE2gET2yuT10WnHmC1GxBm0gV5CagopI6SPjrCJYHIkHIbc3HIF13j3BkcaAatQCF9hmw5AJFJM7ZN5ysl0UARLKyqZ+KU/DMbWXMWHkkgljplscEdPGBokVnv7DswaiY/ePElU6tc9aA8E64syhjhaj+g28GottOBt0CCk2oEI2CaYnNPRARP3zBsDt8xS8w= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2019 18:55:03.1124 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6e30a5eb-1757-4d29-9c75-08d691e4c34b 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: BYAPR07MB5463 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 Wed Feb 13 18:53:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10810741 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 A9E1F922 for ; Wed, 13 Feb 2019 18:55:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9728E2D52D for ; Wed, 13 Feb 2019 18:55:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8AFBC2E047; Wed, 13 Feb 2019 18:55:10 +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 8B9DA2E045 for ; Wed, 13 Feb 2019 18:55:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403931AbfBMSzJ (ORCPT ); Wed, 13 Feb 2019 13:55:09 -0500 Received: from mail-eopbgr760070.outbound.protection.outlook.com ([40.107.76.70]:32499 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2436555AbfBMSzG (ORCPT ); Wed, 13 Feb 2019 13:55:06 -0500 Received: from BYAPR07CA0075.namprd07.prod.outlook.com (2603:10b6:a03:12b::16) by SN6PR07MB5472.namprd07.prod.outlook.com (2603:10b6:805:e4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.22; Wed, 13 Feb 2019 18:55:02 +0000 Received: from DM3NAM05FT053.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::204) by BYAPR07CA0075.outlook.office365.com (2603:10b6:a03:12b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Wed, 13 Feb 2019 18:55: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 DM3NAM05FT053.mail.protection.outlook.com (10.152.98.167) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Wed, 13 Feb 2019 18:55: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; Wed, 13 Feb 2019 10:53:57 -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 x1DIrv47021731; Wed, 13 Feb 2019 10:53:57 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1DIrvVT021730; Wed, 13 Feb 2019 10:53:57 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 11/12] qla2xxx: Add new FW dump template entry types Date: Wed, 13 Feb 2019 10:53:23 -0800 Message-ID: <20190213185324.21652-12-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190213185324.21652-1-hmadhani@marvell.com> References: <20190213185324.21652-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131945577020896294;(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)(346002)(376002)(396003)(136003)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(47776003)(1076003)(4326008)(6666004)(356004)(68736007)(86362001)(26826003)(14444005)(50226002)(8936002)(305945005)(110136005)(26005)(76176011)(81166006)(51416003)(87636003)(53936002)(81156014)(498600001)(97736004)(36906005)(476003)(30864003)(446003)(80596001)(8676002)(126002)(50466002)(69596002)(2616005)(336012)(54906003)(105606002)(85426001)(486006)(2906002)(48376002)(11346002)(42186006)(36756003)(16586007)(316002)(106466001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR07MB5472;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM05FT053;1:eUC+vuVm9za6rnldqfOc8mwENqq++la4R9tI4Tdc7SnYYE5nWgI5jtmsS8YhwXFhyZcG9lkFqLRykhw6+Eoq3j0rW3DjUlzD3Gyrwo5U4+Y2nUjR68gpO5XKcwGeyu8N8CCCSn+BNaSV8BaFHgVMlg== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d2e04430-39df-49f4-0390-08d691e4c270 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:SN6PR07MB5472; X-MS-TrafficTypeDiagnostic: SN6PR07MB5472: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 094700CA91 X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB5472;23:pEckduKDwCDeZ9TA3+5nVzzKFUW9h7d4tEKC1jWAO90jN0cnLYUwmykBB66SQYhlesrts61pIVxGrQ8W9FUGvtbpAtkIsPVipPo4XQv52SatIfHJVTMfVgZ9QDlUQzP2mL80/iN9lAqrYu0VH77Q9QwJfXHRKeOK8enLtTa1TNSeL3k9T3KqKWHxmn9utAheKnHCAcCtjZ0XLWGHuLJtJ661NiqKin2+PZlqFKBoiJz96xZ9jYP4g6Ta1h7u3ZaytMSsB1HwR9S/3VP6kDg/VBuYEr4i0hDS3ZMMvbweiqqav5HY9eZNc+hHE99+93X2CpVnoBSt1bDkA8sh0JMTKptcaXqShlDthQnC80GYApB/7SGyTYxhGoqHKyJiDX2nqJOuu2d0FTzTZfytc0IKQsP6fmLwwektbfpj8V986uPDb+1vHFN/Nt4bUUYZj4Wu3VhFH9LOK+DAB/Yd5/F15tadF4ke18NYXXWKMsdJMnkveTC5wHsm/H65CyQM70FREIhen7pm9X148yjzVITXRIxRD06+11wr57YVhrnRREaRQYih9or3+9Uaurdlmr1Y307CWNT2dHNtzyk/gvE0FUGc1kxDRjzoVtCwWBXOZK9VR8B0Yh9aQezxMSgkQMkuX+zv5CKXBmu4vgxPk+0A/AMpyxkxlrcomjJqoVjH8k9Yl25ePxbeGJYsi9zny2I43CwJbm1bbNYPMQ2Kt1LNckHQ6X+Etk4t3hOKLtugoHOkfaRWndgfuy0AQsD2Orq0PKs722f9lKdrPhVlCDCrPobWQXC/4GIEGeM1aK+/CMaj2yUZKdjcWi5o/YXmuJDjY6hGe9RGgQZllAsmZRXfkA9Brpwpuu+ihN0sk1MfwYOg3zuIxJ2JgjD8Eftpz33pWFFwAZnapr9NzBWZ+kaBfieBfDK2PNhAJk7GbVmLVPDBOjGpdqDDUZ0gABH524zBZq55u9sXJYnCQzr8ZClrxKZU+teHrBcfAfv8OpswCDolUgiONx36v8YMXtezsihiQbII3jugLGDXxvPVDDGdJxoCgvRJRidUQnAAaGwDNUxEnSRvL7Sm/zMVYRfOhh1wABvS0RKv4tiiRRRoVZJhinVMkGPkWWtmHO/xBrBWo47B4lvYPxSUx6yiD7iLQuYw8nFErk/X1/pFz9lpxyqmigwPCwpT0SpGoPNyDG/vx06bjBz64D0JDjguvD4N3NJ//04G9cytoPGF3nUkMdwdx2o/fmyFNUxCEW/7guFCIvU= X-Microsoft-Antispam-Message-Info: Z0OMn/wzYwRoDmBR9F7nIMvB6AiwNplewM9Rgm7lT261Ek19na9q75s8CNVLwzmpO+HHGWKy++eImhMIHhNhHwBeVYYgwHCZfMPCF1y+6NFx/Ts+k1EIBEqM9Tv9qpPOgN19llZMoTEeZ1kVk6f4JoiBRmPbyNCMoMGMvydGnI4f0tnx9KZ8q4f5MvsI0c7m9tCJVB5jPCK+py+gyxeM3VnidaZ5VzQzrEmyfZ4m7d2GNkdqHBWo/qaMOqGyyc2vUGm+bao1O3raEgvi+hFxC4NoAAdbYnkXbmjb8Bu+rj4drfBTGr3jAFX2IIaLrArpN3+ucWEK8zCj+h8yy05FaMwhK74jHF5AS1EI8JtriHHMbCB5TzmCMbvtsKGs/jfvT3G+a+XLw/9PJGgGky1ec5Nc9wSCiC636NYKy82MQyo= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2019 18:55:01.5311 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d2e04430-39df-49f4-0390-08d691e4c270 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: SN6PR07MB5472 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 Wed Feb 13 18:53:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10810743 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 4F7A01575 for ; Wed, 13 Feb 2019 18:55:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FFDF2D52D for ; Wed, 13 Feb 2019 18:55:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34AC22E047; Wed, 13 Feb 2019 18:55:11 +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 CFCF82D52D for ; Wed, 13 Feb 2019 18:55:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436555AbfBMSzK (ORCPT ); Wed, 13 Feb 2019 13:55:10 -0500 Received: from mail-eopbgr740043.outbound.protection.outlook.com ([40.107.74.43]:15712 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2436558AbfBMSzJ (ORCPT ); Wed, 13 Feb 2019 13:55:09 -0500 Received: from CO2PR07CA0061.namprd07.prod.outlook.com (2603:10b6:100::29) by CY1PR0701MB1931.namprd07.prod.outlook.com (2a01:111:e400:58fa::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Wed, 13 Feb 2019 18:55:07 +0000 Received: from DM3NAM05FT034.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::208) by CO2PR07CA0061.outlook.office365.com (2603:10b6:100::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Wed, 13 Feb 2019 18:55:07 +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 DM3NAM05FT034.mail.protection.outlook.com (10.152.98.146) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Wed, 13 Feb 2019 18:55:06 +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; Wed, 13 Feb 2019 10:54:00 -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 x1DIs0qA021735; Wed, 13 Feb 2019 10:54:00 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1DIs0Zw021734; Wed, 13 Feb 2019 10:54:00 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 12/12] qla2xxx: Update driver version to 10.00.00.14-k Date: Wed, 13 Feb 2019 10:53:24 -0800 Message-ID: <20190213185324.21652-13-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190213185324.21652-1-hmadhani@marvell.com> References: <20190213185324.21652-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131945577069008833;(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)(346002)(39860400002)(396003)(136003)(376002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(97736004)(105606002)(36756003)(106466001)(1076003)(4326008)(6666004)(356004)(86362001)(47776003)(2906002)(36906005)(51416003)(53936002)(54906003)(42186006)(110136005)(16586007)(87636003)(126002)(80596001)(336012)(48376002)(316002)(50466002)(4744005)(14444005)(476003)(8676002)(50226002)(11346002)(8936002)(85426001)(26826003)(486006)(446003)(81156014)(498600001)(81166006)(69596002)(68736007)(2616005)(76176011)(305945005)(26005);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0701MB1931;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM05FT034;1:UcmOVufv4/HZtruLikEos15clKuKUExJ90vLiaXl8kj4kzkCk6YWcPaW8wZthXfQnA3ERAa6XVRAfndVHUWLbb0plBkcjf1L6Zgtj395EeuUK5HOzrcQDnXAMbpXP9p6WbIMuMl6+23525iavkHezQ== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6d939734-fc4d-4134-585c-08d691e4c553 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:CY1PR0701MB1931; X-MS-TrafficTypeDiagnostic: CY1PR0701MB1931: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 094700CA91 X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1931;23:8qp13uhc+CbiaNgrKRg1pVNaTz+9v0wTSiirnNvu4O9EqrhTtE3TJM7LinxyyAManemHVo6eTNH7rvJWTxN1WXFtizLJ6ET030ijCiT6sVbZxRvHo2xV8YdMaGu1ZIX6NkJYrIQmtWpQ89E6fb7bXU4g1jDpMNnzzJXPKffSaasBqoiPWe34+NA9IZ6D7Y1Wot8qoqsH4ePsJHAWdPewb4uV95ckdmXUQRVJFxHOxEm3OWLyvfhVq0sMCyKcdEbg+hyzGfglz3EJvRMGSvh9cUhlrmPMiRdr62HkmrviXpiTMfq+cKWoz1pAhNVo6rbMSFwha6y/NPW7AP+9b9f7hEFmynS5kQoeRIRTskD0irf3L1SF1PilXANJBMEIv55QgbDmMoe8BekXfyZuhOCTgHkgrvcBToIcPaKqgKzP4CWODf8qe9w2bMISO0GpM328jMtbtbaWO+42iJBFiBZmQ4dC36jfa0uojX8cen9MD6w8ZpuX2JaNlHgyRaxF2h5LJ77GlUs1KpxfBNL+CksOCiWrJ4OEUUKZUKY67Ab9+LxezmCnme0tKir0TVxdENyu5Jjk8JnIktxPZm7SG7X2aX3BET2qpbSoMPKzpCjnlrtOqvit3ZjM6hyMtEHmhQz6Lr0i/iy8JEBJVhqC8xf4UamQyHrDmHUi7cOjDDTASPkAA8p/m0lFM2+DglZ4BaFgYwBKDmzJIwb9KdA5oJBV3eSP3zT01oal8TbgnH3nhnKCLZpBXFF8Acd/rJIRUskhgshNLpFADleFau3v+QJdbwiV0XR96FOFgPIOz2VGmvH5Wy1LFPu+Fwutx8sU6jfiB23oriwAJfz25TuzkeLBfpnFhYMiV2DkHD0Ohk2/fDUFHYLnNCWQ7FTbw5HrqG2quD7wDP4eoigbBEAm67wOrQx+/yPvUBDmNISzlx0ApOF9iQSXNMEO655o6z+DVYWbiv/BVz2FJwdggXOHOVhIfYuv/b+DqIGfWhLZ/8HPilmjVcQ5lYRFZcAr7BUERUlMSHT9uB00UDiJVNyRO0tp9eLzJZB7DWSF9h7q8mt4kVVAS4gUTn5HXvQUhohX7gL+d1daf1rCJ5oA9rb/3diMVvczWOn+d2R1AKFoMBKpMM4KIzESPsnMzw5CvbLv6d/SM0Pg94cEgWh+vQzSZK02w+TfkZ9dQfyoHtub9dMJ2eT0H/gAoBuFj7vg+wPYgwRjL95Mh6KDxf4AvVLj74hichH2cBuHC7yO1G8jfduZSio= X-Microsoft-Antispam-Message-Info: zkLN2+m83G81jyziqL/LodLjwf4qp8GaHYkn6mhUvyT4sCKy+81HwkYPDQwOhvmyF6EkBvkcI4ekZnVvMywCPUeVUZwWafQKxsfl5V3J0snH/TtA/9SyDdWYt1HVQoMbGKcB0LjxtIu222pAkZUrmhsCuamOgPRKHm3XqV6JcggdtV9/kEK7hyRiTs1sJeKHIADnzV9shuegzY1VRFJ4qseJlGKcqdLL0TqYDmESGziaUzy2hnkRKAR0Tt5MulUFkRONgt+k57LBGEUnysoVlxH6Inghm5+gzFz0cquvJeGX7fO2OsNqDVHwiJ2LQVC2jNpwwyzRU66XS5LOk9GzryELbTK969nQHwp2J9WFIWgzMScI+iSIwqqtu29eVpdkHbN2EPH/34g73X9COg1pXkB77wbaS/blzuoUQAxFovw= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2019 18:55:06.5245 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6d939734-fc4d-4134-585c-08d691e4c553 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: CY1PR0701MB1931 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