From patchwork Tue Sep 4 21:19:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10587983 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 0542414E0 for ; Tue, 4 Sep 2018 21:19:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E739028F76 for ; Tue, 4 Sep 2018 21:19:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB5732A128; Tue, 4 Sep 2018 21:19:37 +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,DKIM_SIGNED, DKIM_VALID,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 C6FAB28F76 for ; Tue, 4 Sep 2018 21:19:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727381AbeIEBqa (ORCPT ); Tue, 4 Sep 2018 21:46:30 -0400 Received: from mail-sn1nam01on0066.outbound.protection.outlook.com ([104.47.32.66]:6378 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727195AbeIEBqa (ORCPT ); Tue, 4 Sep 2018 21:46:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aJbXm4SiFwNERU8t3piaOWO9qW/qLAw5lx9Gt5EuegU=; b=V78wRX0IepnmghRDeth6O89xkkqS51n9BfKi7oj04Snv6rqoehHmsudUpga+EvzZaBcB9yHkqcQONTVHDKNFfh1ycKyLPDxDJ+ncjWcm6yKYZ4bz9VdJ53QGrtwuVkyAGacUJ5gqxQGhp/tMhwtm2UJxEaUFkB6xigFKjQLDsCc= Received: from DM5PR07CA0084.namprd07.prod.outlook.com (2603:10b6:4:ad::49) by BYAPR07MB4392.namprd07.prod.outlook.com (2603:10b6:a02:c0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.15; Tue, 4 Sep 2018 21:19:28 +0000 Received: from CO1NAM05FT049.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::200) by DM5PR07CA0084.outlook.office365.com (2603:10b6:4:ad::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.17 via Frontend Transport; Tue, 4 Sep 2018 21:19:27 +0000 Authentication-Results: spf=pass (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by CO1NAM05FT049.mail.protection.outlook.com (10.152.96.164) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1143.1 via Frontend Transport; Tue, 4 Sep 2018 21:19:27 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 4 Sep 2018 14:19:19 -0700 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 w84LJLa3031966; Tue, 4 Sep 2018 14:19:21 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w84LJLko031965; Tue, 4 Sep 2018 14:19:21 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 01/13] qla2xxx: Serialize mailbox request Date: Tue, 4 Sep 2018 14:19:09 -0700 Message-ID: <20180904211921.31927-2-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180904211921.31927-1-himanshu.madhani@cavium.com> References: <20180904211921.31927-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(346002)(376002)(39850400004)(396003)(136003)(2980300002)(438002)(189003)(199004)(316002)(42186006)(336012)(2906002)(76176011)(110136005)(51416003)(54906003)(72206003)(87636003)(478600001)(8936002)(16586007)(126002)(50226002)(26005)(69596002)(446003)(2616005)(486006)(1076002)(11346002)(5660300001)(186003)(44832011)(6666003)(14444005)(476003)(80596001)(15650500001)(47776003)(81156014)(81166006)(575784001)(86362001)(50466002)(4326008)(48376002)(36756003)(106002)(106466001)(356003)(305945005)(8676002);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR07MB4392;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT049;1:ssEZAOwmyhnoRnCTj3XNaDEunRzla7Ec348HxbFHKBlgZydCvu2Q0e7rLEDP+muj+NJTl4rJnW24OqWHXTcWbSzs7ksnn1h4SSyhMPlAKr7L2hAy7lL24wPZMyKjPEjz X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 68354b6c-8b5e-4948-16af-08d612ac18b6 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BYAPR07MB4392; X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4392;3:4sN2dMX1pwlqAgM3GsaiKuhe4DY7v5robHhGVHTyny0s9K78ipoeDMWuTY662nxzH9Btn9t91OT2ndK3yhjgdI7PoTZrWoK2NaP2iP/59m110ujZCPgv8TaGRDOdpLPmjhY/r3u/sPBARbP8doXFhRfOPUd6D/Hx2ee7w+nAicE1LM4QaKaOpj1Oqywcn4YcLGmrQgCv1nUD3Opb1RVl13c3h75pE0bLasAaaXYwLFjKHBF9qp8jGxiMDevA2gFjtELcs/dLHx567d/C54wRjsBVcs6rLxHdd9KIaDYF3x3YcU6xKBQt5b4afS287wHJuTeua2TVXvJntBUqnpvPaO2t1IVz5ZA1CF3RiUPauro=;25:KOj9SRr9p9VKwQeY+O0wDMC62jC/lZ1ujnyxD00AbuaU1fp4XEfYl8e1QHAgbAVMdkqoSir/1ku1Z1G7Pbb2U5Atmv28aBYzxSy1ss/kDAB2c78dCy21QPuXamX94Ox3mhnHLbfbOMIyzB0fkToipjtaggHzmptQo8aKH8NM+D+vbJ7LUuHyFYvoPZe0+8ZCFFKz+C8WmoJ0lZv/iJyfK1ttIIEujVRRaziF60vS0PU/Q/mMgf1cptsV8k3Eq5Kx9HHHWXw/IcpiVZinKVw0dONUmmy8P1Yhgbt+CumGCMSAWBb8NJcTa4exFKx0v2OZAf9HXIFr/SW8UCS6VDnC9g== X-MS-TrafficTypeDiagnostic: BYAPR07MB4392: X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4392;31:FDn6JiY7pzZrI9IRc0V8xjtxiyH0NKAVKAXYd81ssWcT7pXgw3Hypdh/DHPYOpas9SN+6SuoQmtse2AIJ4L93c4iRtPryiv8qZ1B+Oam6GNWJIxiK6jYRpIs8BtsKJG14ukvORHAXZrdVnT0rPfSoLZMuHXRgYbIsUISWsUNsfSCWquSRMDAR+IA5pnduY9aDZD6e8b/zGlf6p+J7V4HEcEy6FNZbsnFr3TjurVl8xY=;20:jyKo7UdSk+22OgUpnAOrMRTBTsV77ewR+WZxnNcXUd+/Od8wDQ2hi8GMIaesHm8LEtNxXAiYLjqiBMoMURjCrqLJVM2uN3aWnzxDI17COA/o9s0NicVm4UDdGfTxsFO6nVsLe+qBdZqL/5GbwDZJHf1Eahr7uJbujJODwOskZb/2bxQmHSkBes9+ytxhSce0IWnvow5rjm8T9MsNlfhhDHhT/YkADX2Zi0K0d+Szsk1kN2ZkakD51Bx5COs2lZyKGMCJOxIFdsSNNIdLOTvPcbfq63Vv/LWwMyE0BFb5sLzrQwjuTwJlIUOIf/0XBDGTympOc4N1+1C0tQs6CfT9vTGvlMHMMLXZm6o/3Vkf5RE6kfMFOMdGPvtHNXwU7olSuC2+ApbdtxRIX4OVAx2DtWoKD1A4bGilIO/2KdRaRhOh2SPGiVGFPN+eFmTNHzkmfxp0AuI7IYImM64ORfnZ/5O8gxKTG0ZNz4oeH9km+o/NahOOwvEMJiZTMgtk2Q8u X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93004095)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:BYAPR07MB4392;BCL:0;PCL:0;RULEID:;SRVR:BYAPR07MB4392; X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4392;4:0E2WVU6ydVlgQPkzv/gLNjCZsSwQHXztwniHHO0x5jMZIaKNlq1PDw+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8fGDbb/BLetSYsCXlr8YBq2HKrpexwpiagKxxkBAHIJzUT+8HAt+WOuWG3hjeVHwjMgxOJL5S4YoMhcjNGzHVQe/s/KO5KaSIbJGvldt7cjzzKfvP2GQU1JQC9CKotoFBuNXnrSKz7UXeG4S6UA8h/r6QqNHPu34WcxHezVzksP3wud35KDXvqnfndFR2pPhE1Ep0uGMnhu5F4Aw==;5:0kD8SBKYwIK9ExeOqQ8MTsspVUoe6Gco8lK3UO8IJzaRO3zTW1wYSQkskpM/DOS1uKCCg6eGW5ue3VNbqV3odDUFV8DVpddt/h7rJ97jZ4ouJjeU0COVwB3AvuNw0ZdZvTPfvJqtP9wD3HAnVnKJXg9UEkl5oeoiivLCczXOq3c=;7:MG/HZ8tgwkgJA3VYHwR9jNOJKVJDTsYizRC5ysrgJGKBBVRukkYj18zW7a9Xn584gKPDdOPCaTm1W58RlF1pbBv09bNVBhF2ebg0cwT+JwNe0P6b6iILue/hamdNz/VliJD83XokTABVq8BUEeWya0DuVRfqlIqWlW5Yhu/s9AyOy/U3dRTOLQV+m/AnJ+zQZKZ8GdX5TbzQ7viSJ/WTgi4k+LVjClk+ZFKStWo1F3Z84rmmF9kviOwSsOoj9P5n SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 21:19:27.5265 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 68354b6c-8b5e-4948-16af-08d612ac18b6 X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB4392 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 For driver MBX submission, use mbox_busy to serialize request. For Userspace MBX submission, use optrom mutext to serialize request. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_attr.c | 106 +++++++++++++++++++++++++++++++------- drivers/scsi/qla2xxx/qla_mbx.c | 36 ++++++++++--- drivers/scsi/qla2xxx/qla_target.c | 25 ++++----- 3 files changed, 127 insertions(+), 40 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 4888b999e82f..14c496bab280 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -158,9 +158,17 @@ qla2x00_sysfs_read_nvram(struct file *filp, struct kobject *kobj, if (!capable(CAP_SYS_ADMIN)) return 0; + mutex_lock(&ha->optrom_mutex); + if (qla2x00_chip_is_down(vha)) { + mutex_unlock(&ha->optrom_mutex); + return -EAGAIN; + } + if (IS_NOCACHE_VPD_TYPE(ha)) ha->isp_ops->read_optrom(vha, ha->nvram, ha->flt_region_nvram << 2, ha->nvram_size); + mutex_unlock(&ha->optrom_mutex); + return memory_read_from_buffer(buf, count, &off, ha->nvram, ha->nvram_size); } @@ -208,10 +216,17 @@ qla2x00_sysfs_write_nvram(struct file *filp, struct kobject *kobj, return -EAGAIN; } + mutex_lock(&ha->optrom_mutex); + if (qla2x00_chip_is_down(vha)) { + mutex_unlock(&vha->hw->optrom_mutex); + return -EAGAIN; + } + /* Write NVRAM. */ ha->isp_ops->write_nvram(vha, (uint8_t *)buf, ha->nvram_base, count); ha->isp_ops->read_nvram(vha, (uint8_t *)ha->nvram, ha->nvram_base, - count); + count); + mutex_unlock(&ha->optrom_mutex); ql_dbg(ql_dbg_user, vha, 0x7060, "Setting ISP_ABORT_NEEDED\n"); @@ -322,6 +337,10 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj, size = ha->optrom_size - start; mutex_lock(&ha->optrom_mutex); + if (qla2x00_chip_is_down(vha)) { + mutex_unlock(&ha->optrom_mutex); + return -EAGAIN; + } switch (val) { case 0: if (ha->optrom_state != QLA_SREADING && @@ -499,8 +518,14 @@ qla2x00_sysfs_read_vpd(struct file *filp, struct kobject *kobj, qla27xx_find_valid_image(vha) == QLA27XX_SECONDARY_IMAGE) faddr = ha->flt_region_vpd_sec << 2; + mutex_lock(&ha->optrom_mutex); + if (qla2x00_chip_is_down(vha)) { + mutex_unlock(&ha->optrom_mutex); + return -EAGAIN; + } ha->isp_ops->read_optrom(vha, ha->vpd, faddr, ha->vpd_size); + mutex_unlock(&ha->optrom_mutex); } return memory_read_from_buffer(buf, count, &off, ha->vpd, ha->vpd_size); } @@ -518,9 +543,6 @@ 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; @@ -531,16 +553,25 @@ qla2x00_sysfs_write_vpd(struct file *filp, struct kobject *kobj, return -EAGAIN; } + mutex_lock(&ha->optrom_mutex); + if (qla2x00_chip_is_down(vha)) { + mutex_unlock(&ha->optrom_mutex); + return -EAGAIN; + } + /* Write NVRAM. */ ha->isp_ops->write_nvram(vha, (uint8_t *)buf, ha->vpd_base, count); ha->isp_ops->read_nvram(vha, (uint8_t *)ha->vpd, ha->vpd_base, count); /* Update flash version information for 4Gb & above. */ - if (!IS_FWI2_CAPABLE(ha)) + if (!IS_FWI2_CAPABLE(ha)) { + mutex_unlock(&ha->optrom_mutex); return -EINVAL; + } tmp_data = vmalloc(256); if (!tmp_data) { + mutex_unlock(&ha->optrom_mutex); ql_log(ql_log_warn, vha, 0x706b, "Unable to allocate memory for VPD information update.\n"); return -ENOMEM; @@ -548,6 +579,8 @@ qla2x00_sysfs_write_vpd(struct file *filp, struct kobject *kobj, ha->isp_ops->get_flash_version(vha, tmp_data); vfree(tmp_data); + mutex_unlock(&ha->optrom_mutex); + return count; } @@ -573,10 +606,15 @@ qla2x00_sysfs_read_sfp(struct file *filp, struct kobject *kobj, if (!capable(CAP_SYS_ADMIN) || off != 0 || count < SFP_DEV_SIZE) return 0; - if (qla2x00_chip_is_down(vha)) + mutex_lock(&vha->hw->optrom_mutex); + if (qla2x00_chip_is_down(vha)) { + mutex_unlock(&vha->hw->optrom_mutex); return 0; + } rval = qla2x00_read_sfp_dev(vha, buf, count); + mutex_unlock(&vha->hw->optrom_mutex); + if (rval) return -EIO; @@ -785,9 +823,11 @@ qla2x00_sysfs_read_xgmac_stats(struct file *filp, struct kobject *kobj, if (unlikely(pci_channel_offline(ha->pdev))) return 0; - - if (qla2x00_chip_is_down(vha)) + mutex_lock(&vha->hw->optrom_mutex); + if (qla2x00_chip_is_down(vha)) { + mutex_unlock(&vha->hw->optrom_mutex); return 0; + } if (ha->xgmac_data) goto do_read; @@ -795,6 +835,7 @@ qla2x00_sysfs_read_xgmac_stats(struct file *filp, struct kobject *kobj, ha->xgmac_data = dma_alloc_coherent(&ha->pdev->dev, XGMAC_DATA_SIZE, &ha->xgmac_data_dma, GFP_KERNEL); if (!ha->xgmac_data) { + mutex_unlock(&vha->hw->optrom_mutex); ql_log(ql_log_warn, vha, 0x7076, "Unable to allocate memory for XGMAC read-data.\n"); return 0; @@ -806,6 +847,8 @@ qla2x00_sysfs_read_xgmac_stats(struct file *filp, struct kobject *kobj, rval = qla2x00_get_xgmac_stats(vha, ha->xgmac_data_dma, XGMAC_DATA_SIZE, &actual_size); + + mutex_unlock(&vha->hw->optrom_mutex); if (rval != QLA_SUCCESS) { ql_log(ql_log_warn, vha, 0x7077, "Unable to read XGMAC data (%x).\n", rval); @@ -842,13 +885,16 @@ qla2x00_sysfs_read_dcbx_tlv(struct file *filp, struct kobject *kobj, if (ha->dcbx_tlv) goto do_read; - - if (qla2x00_chip_is_down(vha)) + mutex_lock(&vha->hw->optrom_mutex); + if (qla2x00_chip_is_down(vha)) { + mutex_unlock(&vha->hw->optrom_mutex); return 0; + } ha->dcbx_tlv = dma_alloc_coherent(&ha->pdev->dev, DCBX_TLV_DATA_SIZE, &ha->dcbx_tlv_dma, GFP_KERNEL); if (!ha->dcbx_tlv) { + mutex_unlock(&vha->hw->optrom_mutex); ql_log(ql_log_warn, vha, 0x7078, "Unable to allocate memory for DCBX TLV read-data.\n"); return -ENOMEM; @@ -859,6 +905,9 @@ qla2x00_sysfs_read_dcbx_tlv(struct file *filp, struct kobject *kobj, rval = qla2x00_get_dcbx_params(vha, ha->dcbx_tlv_dma, DCBX_TLV_DATA_SIZE); + + mutex_unlock(&vha->hw->optrom_mutex); + if (rval != QLA_SUCCESS) { ql_log(ql_log_warn, vha, 0x7079, "Unable to read DCBX TLV (%x).\n", rval); @@ -1184,15 +1233,17 @@ qla2x00_beacon_store(struct device *dev, struct device_attribute *attr, if (IS_QLA2100(ha) || IS_QLA2200(ha)) return -EPERM; + if (sscanf(buf, "%d", &val) != 1) + return -EINVAL; + + mutex_lock(&vha->hw->optrom_mutex); if (qla2x00_chip_is_down(vha)) { + mutex_unlock(&vha->hw->optrom_mutex); ql_log(ql_log_warn, vha, 0x707a, "Abort ISP active -- ignoring beacon request.\n"); return -EBUSY; } - if (sscanf(buf, "%d", &val) != 1) - return -EINVAL; - if (val) rval = ha->isp_ops->beacon_on(vha); else @@ -1201,6 +1252,8 @@ qla2x00_beacon_store(struct device *dev, struct device_attribute *attr, if (rval != QLA_SUCCESS) count = 0; + mutex_unlock(&vha->hw->optrom_mutex); + return count; } @@ -1370,18 +1423,24 @@ qla2x00_thermal_temp_show(struct device *dev, { scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); uint16_t temp = 0; + int rc; + mutex_lock(&vha->hw->optrom_mutex); if (qla2x00_chip_is_down(vha)) { + mutex_unlock(&vha->hw->optrom_mutex); ql_log(ql_log_warn, vha, 0x70dc, "ISP reset active.\n"); goto done; } if (vha->hw->flags.eeh_busy) { + mutex_unlock(&vha->hw->optrom_mutex); ql_log(ql_log_warn, vha, 0x70dd, "PCI EEH busy.\n"); goto done; } - if (qla2x00_get_thermal_temp(vha, &temp) == QLA_SUCCESS) + rc = qla2x00_get_thermal_temp(vha, &temp); + mutex_unlock(&vha->hw->optrom_mutex); + if (rc == QLA_SUCCESS) return scnprintf(buf, PAGE_SIZE, "%d\n", temp); done: @@ -1402,13 +1461,24 @@ qla2x00_fw_state_show(struct device *dev, struct device_attribute *attr, return scnprintf(buf, PAGE_SIZE, "0x%x\n", pstate); } - if (qla2x00_chip_is_down(vha)) + mutex_lock(&vha->hw->optrom_mutex); + if (qla2x00_chip_is_down(vha)) { + mutex_unlock(&vha->hw->optrom_mutex); ql_log(ql_log_warn, vha, 0x707c, "ISP reset active.\n"); - else if (!vha->hw->flags.eeh_busy) - rval = qla2x00_get_firmware_state(vha, state); - if (rval != QLA_SUCCESS) + goto out; + } else if (vha->hw->flags.eeh_busy) { + mutex_unlock(&vha->hw->optrom_mutex); + goto out; + } + + rval = qla2x00_get_firmware_state(vha, state); + mutex_unlock(&vha->hw->optrom_mutex); +out: + if (rval != QLA_SUCCESS) { memset(state, -1, sizeof(state)); + rval = qla2x00_get_firmware_state(vha, state); + } return scnprintf(buf, PAGE_SIZE, "0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n", state[0], state[1], state[2], state[3], state[4], state[5]); diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index c73039916c03..9d5e320fc1bc 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -189,7 +189,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) goto premature_exit; } - ha->flags.mbox_busy = 1; + /* Save mailbox command for debug */ ha->mcp = mcp; @@ -198,12 +198,13 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) spin_lock_irqsave(&ha->hardware_lock, flags); - if (ha->flags.purge_mbox || chip_reset != ha->chip_reset) { + if (ha->flags.purge_mbox || chip_reset != ha->chip_reset || + ha->flags.mbox_busy) { rval = QLA_ABORTED; - ha->flags.mbox_busy = 0; spin_unlock_irqrestore(&ha->hardware_lock, flags); goto premature_exit; } + ha->flags.mbox_busy = 1; /* Load mailbox registers. */ if (IS_P3P_TYPE(ha)) @@ -254,9 +255,10 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) if (IS_P3P_TYPE(ha)) { if (RD_REG_DWORD(®->isp82.hint) & HINT_MBX_INT_PENDING) { + ha->flags.mbox_busy = 0; spin_unlock_irqrestore(&ha->hardware_lock, flags); - ha->flags.mbox_busy = 0; + atomic_dec(&ha->num_pend_mbx_stage2); ql_dbg(ql_dbg_mbx, vha, 0x1010, "Pending mailbox timeout, exiting.\n"); @@ -274,6 +276,16 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) atomic_inc(&ha->num_pend_mbx_stage3); if (!wait_for_completion_timeout(&ha->mbx_intr_comp, mcp->tov * HZ)) { + if (chip_reset != ha->chip_reset) { + spin_lock_irqsave(&ha->hardware_lock, flags); + ha->flags.mbox_busy = 0; + spin_unlock_irqrestore(&ha->hardware_lock, + flags); + atomic_dec(&ha->num_pend_mbx_stage2); + atomic_dec(&ha->num_pend_mbx_stage3); + rval = QLA_ABORTED; + goto premature_exit; + } ql_dbg(ql_dbg_mbx, vha, 0x117a, "cmd=%x Timeout.\n", command); spin_lock_irqsave(&ha->hardware_lock, flags); @@ -282,7 +294,9 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) } else if (ha->flags.purge_mbox || chip_reset != ha->chip_reset) { + spin_lock_irqsave(&ha->hardware_lock, flags); ha->flags.mbox_busy = 0; + spin_unlock_irqrestore(&ha->hardware_lock, flags); atomic_dec(&ha->num_pend_mbx_stage2); atomic_dec(&ha->num_pend_mbx_stage3); rval = QLA_ABORTED; @@ -300,9 +314,9 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) if (IS_P3P_TYPE(ha)) { if (RD_REG_DWORD(®->isp82.hint) & HINT_MBX_INT_PENDING) { + ha->flags.mbox_busy = 0; spin_unlock_irqrestore(&ha->hardware_lock, flags); - ha->flags.mbox_busy = 0; atomic_dec(&ha->num_pend_mbx_stage2); ql_dbg(ql_dbg_mbx, vha, 0x1012, "Pending mailbox timeout, exiting.\n"); @@ -320,7 +334,10 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) while (!ha->flags.mbox_int) { if (ha->flags.purge_mbox || chip_reset != ha->chip_reset) { + spin_lock_irqsave(&ha->hardware_lock, flags); ha->flags.mbox_busy = 0; + spin_unlock_irqrestore(&ha->hardware_lock, + flags); atomic_dec(&ha->num_pend_mbx_stage2); rval = QLA_ABORTED; goto premature_exit; @@ -363,7 +380,10 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags); if (IS_P3P_TYPE(ha) && ha->flags.isp82xx_fw_hung) { + spin_lock_irqsave(&ha->hardware_lock, flags); ha->flags.mbox_busy = 0; + spin_unlock_irqrestore(&ha->hardware_lock, flags); + /* Setting Link-Down error */ mcp->mb[0] = MBS_LINK_DOWN_ERROR; ha->mcp = NULL; @@ -436,7 +456,10 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) * then only PCI ERR flag would be set. * we will do premature exit for above case. */ + spin_lock_irqsave(&ha->hardware_lock, flags); ha->flags.mbox_busy = 0; + spin_unlock_irqrestore(&ha->hardware_lock, + flags); rval = QLA_FUNCTION_TIMEOUT; goto premature_exit; } @@ -451,8 +474,9 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) rval = QLA_FUNCTION_TIMEOUT; } } - + spin_lock_irqsave(&ha->hardware_lock, flags); ha->flags.mbox_busy = 0; + spin_unlock_irqrestore(&ha->hardware_lock, flags); /* Clean up */ ha->mcp = NULL; diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 396c8a6d502c..29fbb0aad489 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -1491,27 +1491,14 @@ int qlt_stop_phase1(struct qla_tgt *tgt) struct qla_hw_data *ha = tgt->ha; unsigned long flags; + mutex_lock(&ha->optrom_mutex); mutex_lock(&qla_tgt_mutex); - if (!vha->fc_vport) { - struct Scsi_Host *sh = vha->host; - struct fc_host_attrs *fc_host = shost_to_fc_host(sh); - bool npiv_vports; - - spin_lock_irqsave(sh->host_lock, flags); - npiv_vports = (fc_host->npiv_vports_inuse); - spin_unlock_irqrestore(sh->host_lock, flags); - - if (npiv_vports) { - mutex_unlock(&qla_tgt_mutex); - ql_dbg(ql_dbg_tgt_mgt, vha, 0xf021, - "NPIV is in use. Can not stop target\n"); - return -EPERM; - } - } + if (tgt->tgt_stop || tgt->tgt_stopped) { ql_dbg(ql_dbg_tgt_mgt, vha, 0xf04e, "Already in tgt->tgt_stop or tgt_stopped state\n"); mutex_unlock(&qla_tgt_mutex); + mutex_unlock(&ha->optrom_mutex); return -EPERM; } @@ -1549,6 +1536,8 @@ int qlt_stop_phase1(struct qla_tgt *tgt) /* Wait for sessions to clear out (just in case) */ wait_event_timeout(tgt->waitQ, test_tgt_sess_count(tgt), 10*HZ); + mutex_unlock(&ha->optrom_mutex); + return 0; } EXPORT_SYMBOL(qlt_stop_phase1); @@ -6595,6 +6584,9 @@ qlt_enable_vha(struct scsi_qla_host *vha) qlt_set_mode(vha); spin_unlock_irqrestore(&ha->hardware_lock, flags); + mutex_lock(&ha->optrom_mutex); + ql_dbg(ql_dbg_tgt_mgt, vha, 0xf021, + "%s.\n", __func__); if (vha->vp_idx) { qla24xx_disable_vp(vha); qla24xx_enable_vp(vha); @@ -6603,6 +6595,7 @@ qlt_enable_vha(struct scsi_qla_host *vha) qla2xxx_wake_dpc(base_vha); qla2x00_wait_for_hba_online(base_vha); } + mutex_unlock(&ha->optrom_mutex); } EXPORT_SYMBOL(qlt_enable_vha); From patchwork Tue Sep 4 21:19:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10587977 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 DC02A920 for ; Tue, 4 Sep 2018 21:19:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C938328F76 for ; Tue, 4 Sep 2018 21:19:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BAEC32A127; Tue, 4 Sep 2018 21:19:32 +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,DKIM_SIGNED, DKIM_VALID,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 0581F28F76 for ; Tue, 4 Sep 2018 21:19:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727425AbeIEBqZ (ORCPT ); Tue, 4 Sep 2018 21:46:25 -0400 Received: from mail-co1nam03on0053.outbound.protection.outlook.com ([104.47.40.53]:4576 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727174AbeIEBqZ (ORCPT ); Tue, 4 Sep 2018 21:46:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iwK0dUdVG0/niFbTph9pCSvXYZdOVqh5sAUUNWyAdFA=; b=RpxLIY1sxrRk7TN+kc6RmGCy78QIIWFRqhGtUx0KZ8s1XiOLa+xwN5K03KZ3OGm+R+HIzl40s4h8koYFcBA8rEzVLUhwn2+l3sZI9L25QNEnWWFjhKwsE8exgUhbDs39JiTz0ycJJWP2rUEiAAKBD3Wa6OMAiSkGAyhJ8dCOvvM= Received: from DM5PR07CA0075.namprd07.prod.outlook.com (2603:10b6:4:ad::40) by DM6PR07MB4666.namprd07.prod.outlook.com (2603:10b6:5:a0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.15; Tue, 4 Sep 2018 21:19:27 +0000 Received: from CO1NAM05FT049.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::208) by DM5PR07CA0075.outlook.office365.com (2603:10b6:4:ad::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.14 via Frontend Transport; Tue, 4 Sep 2018 21:19:27 +0000 Authentication-Results: spf=pass (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by CO1NAM05FT049.mail.protection.outlook.com (10.152.96.164) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1143.1 via Frontend Transport; Tue, 4 Sep 2018 21:19:26 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 4 Sep 2018 14:19:20 -0700 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 w84LJLWB031970; Tue, 4 Sep 2018 14:19:21 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w84LJLd8031969; Tue, 4 Sep 2018 14:19:21 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 02/13] qla2xxx: Fix deadlock between ATIO and HW lock Date: Tue, 4 Sep 2018 14:19:10 -0700 Message-ID: <20180904211921.31927-3-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180904211921.31927-1-himanshu.madhani@cavium.com> References: <20180904211921.31927-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(376002)(346002)(39860400002)(396003)(2980300002)(438002)(199004)(189003)(6666003)(336012)(5660300001)(16586007)(42186006)(316002)(11346002)(446003)(54906003)(80596001)(47776003)(50466002)(106002)(44832011)(8676002)(476003)(2616005)(126002)(110136005)(50226002)(486006)(48376002)(69596002)(8936002)(14444005)(36756003)(4326008)(106466001)(1076002)(305945005)(2906002)(86362001)(356003)(186003)(76176011)(81156014)(51416003)(72206003)(26005)(81166006)(87636003)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR07MB4666;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT049;1:3a65hpIPjJI7L6Zf6+j9qmd/qKwGuJokXXjdA13ZVkS9pOokbbBH3GRtPXjMlDn8hTqk7KKIuD3pFFKQkvTnnXYZyijnMIY42stC6eG7riABlLDnEuDoUL3L999wxFw/ X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bad17feb-a705-4079-f4b8-08d612ac1832 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM6PR07MB4666; X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4666;3:crETeORnVwZiUk/yFiMEVes5P4z1W/Fa7OMG6nYKJvrqMBzOXnSd1/9nal0bfYmFQl5WgAv6MA4eChc4jywa3fHDpkFPrEh2yeWcgMbxh/0oRsKp4/9LV8cdtQyINBQP+B1AE+dQQeAHQj+CvakwAfglhvLBpoBoov1oXivKJHpPVn1G2TWpGtunoi73Gr2oEZUgCjwUHU499W56U9xfOP10hazE/9c8bgLNnMHVmG+XmoSRYmYXJIRiG6MAHg59uzGvBCbDOza19K0/6XG86ph/83ojxuIyHsvHhMpiwPCJKAZbqX1zq78hdeqit3ykcD9Y73d99pwkASU4ugp+mrLlpGvzy1LKcgtsHOFkUsc=;25:sDQzrFAWnlFqUqXWh4le7rJxLfNiaBhCUUybj9+XbPRkE8jKDIiEZylDQGqt2l1aI9giMH6z7w+wPe2afXHzs5ZNFPhmUfuIdKUKp5j0qpnf3Y+o7WcxY2knwAYIGcuf7CXQbq3lPioYKimNx41dNVQeWuwPxPRPkPHDQ4/EDosOLdZdiHhbssA5VVhfdJtO6vGHBHPoFUHEr7w43a6WEFI203gEFadDRCK4NI/pSJ+A68oJw8YzplIF77pejITINIpM8aPs9KYgN4GF4rgmGcxPBBrNzRtYW7EFnuCTWtBl2noKIJ4aWy1X35LDU9fvw8DMNjPPftTkvrnn/Zkzfw== X-MS-TrafficTypeDiagnostic: DM6PR07MB4666: X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4666;31:CPNxohiosuQjeKiX5XxwtrzojNFOFbTbLRK5K5yBIfCkEikf2jGhuabzRnijmmu7aLMGYxmtoYmsqttYHE7CplEZlVIB3GEsUB/r1zKzdqYcRTg6tEJY+SB1LUKp69pvV9yXDVvGhk+Yo5OptE8wbCKiR2mR7U60LcSCaE8ua0J/RpJ64//pNV5dPeMHLy1dqqCHt/2AOhZRejS1k2+wj/eCg3ZsrdVYmAGjnTKbmDs=;20:/GV4EgsmqF88YbFN2sPWQnd1SrLxv9b48pkicqHWp+sqVAc1Ge1I621hfFClf4fhLsZ63Am7lazceUWB0Bh0yx/iaJxpqXGSlRgWltc8ucnnbNIOIW5KkSkV7K8cz+8QstbKRaTccuFw7mFr/O4Ob1s7PN8jUJoELnTlMqKFIhE4cT5uDrN2Th+dd9JsX3D8DRaOgn3PzaReqTCsy+a3UDXVuLXfmkulSBvz6jUOJWgkwcK4x5nea0nKTHs0PvTGi87b5keSPsHMeQaKtHiPZN7Nl8H6qCLJzThKhoL+IKMsr7O3zmsNqZ9THOlZf7kW84Y8BUuT7pCMzbuPdpXRsgFxmMSGfv/V7ZA4G7tsQqNMmBVDm2cBBblqlK86XWXW5d09gRRVur1A3Y9//kpD8s7hVxIzMiFYMsClljbxBEKcrxYcJhXbhU1yLtc5tgwmjAufLvM7a4fmOvVsjjsa22iYzXwE2ZS/UJVy/5z9+pkq5IbQJEes1d3NUY9IkKy1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(209352067349851); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93004095)(10201501046)(149027)(150027)(6041310)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:DM6PR07MB4666;BCL:0;PCL:0;RULEID:;SRVR:DM6PR07MB4666; X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4666;4:SHm6F02tfE6iqj53JSS5KCWMi8gn+j1nxfhzmjRTw5gyvgmyV2Xl94O5IGaggemTI6pZ4SggsvZCfqQDWYA7N1ZxlN6KGf2e2t1Vo691bq2ZHPY4iLvfd0qFyAAER0xwVmcIBBPxmlaRC/dDr+t8S9OB5ZZRm1jv3Qdi5RCPmK0KGyAPDK/SX+DSzjYxXpLbe35/F82UpQGqMV5qhFQR/COT9m5G6PJJjBC4VmHT0hQDt2gsid5oyFRiroBkfK0Jc132pw70Rwdslx20O3g6sGHK2QXfvG/17j+s9N2kqbNr4HdqP5ouY3mMXbvlBwPN X-Forefront-PRVS: 0785459C39 X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4666;23:CTSstoTGI5kOPhHUy61PYJThNYGAr5Ts60DsDtwOSjuS5OccCA4jn41aMY6F4nalw/HYnTWck3F9uHtE4UTO/p2kfa3zVt2RCLjzafkKJataKPD+6lAUmrTs6DmBA/zz0/Yi7DsmeoAA+yIaL11eGD2iayXAlJhvR7gtaf2ZX18iK3Bc9BK7F5+tvEW87qh6hrsKBJdg9BMQBJEIO8j/HeAdkr36Vb5rl0mGvCjFbcka7GfPO1z9tSvYl6sMMQtTToFP8VR2DNTtM8MjXHqPNtEhrOJaMkc5J4IRueToxZ0Qaphsb6KtK6om+B91GHAC5ZL9NZzwOZ9k66KYuSuV3WGJBiWPsDWiJ1EkCTROGgujSNpaF0zfoyO7PbLxYR+x5r62XJgx/LjmhPyMy6WwqM5tSR2ziO5TO1dJRoWih4SKGll6yPS+vkHtJmbXUpHfeNg39jWyoHD76YjRMXbkdYfw+8/rjr51k9jv7zAOxPn1U19EfcH28eDhgSjurVAOhVyYwYWLP42SMhJUeAVH6Z8Boyc4knzbOPj5gzmlRvLwmcfGXuG0rK8G0TBcf1z7ff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RloCNbN5BsEOlKzmkMf2fqxc57Xet61h0UiaGkFgPD/rSyxSTCUcH2cA7keb6fg02zb+4APyq6zCJJ9KK8I10PXsaAHt/QsRUQrDwOqipRDjY2+OvfBUxP7lIZJpwiZI+AWUjOlsIUMFEy/eAoEI27YbCizp+rMVdgoJw+SFKcPhQceS4GFcyTT3Csbhmdi9R6nHbhNAjhvb3/DdcxUEH+74u7mxDU27BwfUoz+WkdarU+I3NxuauuSQWOeZh7al/gxAFoxT/lkZ8/sokosZqvd2+ek1WTzzpwTYpTioRpjcShzdj1zxeNoZ1jNhSH3w08IxpXkOAGB9OTc1C3P13l8bzDjuz/jqmUkpuPBynT5LbUzmKHCvBv1x7EjpEOA==;5:l3er43BL4c0IREhPBCzh1l026WcFufrAmGNzIfpWaMMaZgIgOMFNWjURcnqrsCITrUhE4EAp+iFO0bYIoE5AHcqsemsD7qa9H79SeBcgJpCgN4lTBZl9FXMac9dXT3v1ahIDYf2Xy6hvQR7E/C3XEXrqnLrZ4DXuAlh8w5dl3yg=;7:qEgWIzxU65ME5xXu69nxTJWszg+Mz5rPlZfH3gjfSidgtBaoV2wKRRq5/NrSKTgPzG0Zob0uyl175tjdPXTP3RcdbBnaJHIEj8BpRKJyRaMGHrg6z2P+R+vRdAvdJfp6GCKqR+Rb1zTM/jWMFJyRs2IMB8ndrkoC7hFiK8/h9RIPvJNfdjTiwoXk+yT0GYDKdLcJaKSzdsHbDk3D8BgEjtyIUCjDecUq5piSb3yJZT1v/lvL3wzCNR0/ooSwQy0i SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 21:19:26.6671 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bad17feb-a705-4079-f4b8-08d612ac1832 X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB4666 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 Move ATIO queue processing out of hardware_lock to prevent deadlock. Fixes: 3bb67df5b5f8 ("qla2xxx: Check for online flag instead of active reset when transmitting responses") Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 17 ++++----------- drivers/scsi/qla2xxx/qla_isr.c | 48 +++++++++++++++++++---------------------- 2 files changed, 26 insertions(+), 39 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index f8f55184f542..c3c7ab6fe6e1 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -4859,19 +4859,10 @@ qla2x00_configure_loop(scsi_qla_host_t *vha) */ if (qla_tgt_mode_enabled(vha) || qla_dual_mode_enabled(vha)) { - if (IS_QLA27XX(ha) || IS_QLA83XX(ha)) { - spin_lock_irqsave(&ha->tgt.atio_lock, - flags); - qlt_24xx_process_atio_queue(vha, 0); - spin_unlock_irqrestore( - &ha->tgt.atio_lock, flags); - } else { - spin_lock_irqsave(&ha->hardware_lock, - flags); - qlt_24xx_process_atio_queue(vha, 1); - spin_unlock_irqrestore( - &ha->hardware_lock, flags); - } + spin_lock_irqsave(&ha->tgt.atio_lock, flags); + qlt_24xx_process_atio_queue(vha, 0); + spin_unlock_irqrestore(&ha->tgt.atio_lock, + flags); } } } diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 36cbb29c84f6..bc97e3a1bef7 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -3121,6 +3121,7 @@ qla24xx_intr_handler(int irq, void *dev_id) uint16_t mb[8]; struct rsp_que *rsp; unsigned long flags; + bool process_atio = false; rsp = (struct rsp_que *) dev_id; if (!rsp) { @@ -3181,22 +3182,13 @@ qla24xx_intr_handler(int irq, void *dev_id) qla24xx_process_response_queue(vha, rsp); break; case INTR_ATIO_QUE_UPDATE_27XX: - case INTR_ATIO_QUE_UPDATE:{ - unsigned long flags2; - spin_lock_irqsave(&ha->tgt.atio_lock, flags2); - qlt_24xx_process_atio_queue(vha, 1); - spin_unlock_irqrestore(&ha->tgt.atio_lock, flags2); + case INTR_ATIO_QUE_UPDATE: + process_atio = true; break; - } - case INTR_ATIO_RSP_QUE_UPDATE: { - unsigned long flags2; - spin_lock_irqsave(&ha->tgt.atio_lock, flags2); - qlt_24xx_process_atio_queue(vha, 1); - spin_unlock_irqrestore(&ha->tgt.atio_lock, flags2); - + case INTR_ATIO_RSP_QUE_UPDATE: + process_atio = true; qla24xx_process_response_queue(vha, rsp); break; - } default: ql_dbg(ql_dbg_async, vha, 0x504f, "Unrecognized interrupt type (%d).\n", stat * 0xff); @@ -3210,6 +3202,12 @@ qla24xx_intr_handler(int irq, void *dev_id) qla2x00_handle_mbx_completion(ha, status); spin_unlock_irqrestore(&ha->hardware_lock, flags); + if (process_atio) { + spin_lock_irqsave(&ha->tgt.atio_lock, flags); + qlt_24xx_process_atio_queue(vha, 0); + spin_unlock_irqrestore(&ha->tgt.atio_lock, flags); + } + return IRQ_HANDLED; } @@ -3256,6 +3254,7 @@ qla24xx_msix_default(int irq, void *dev_id) uint32_t hccr; uint16_t mb[8]; unsigned long flags; + bool process_atio = false; rsp = (struct rsp_que *) dev_id; if (!rsp) { @@ -3312,22 +3311,13 @@ qla24xx_msix_default(int irq, void *dev_id) qla24xx_process_response_queue(vha, rsp); break; case INTR_ATIO_QUE_UPDATE_27XX: - case INTR_ATIO_QUE_UPDATE:{ - unsigned long flags2; - spin_lock_irqsave(&ha->tgt.atio_lock, flags2); - qlt_24xx_process_atio_queue(vha, 1); - spin_unlock_irqrestore(&ha->tgt.atio_lock, flags2); + case INTR_ATIO_QUE_UPDATE: + process_atio = true; break; - } - case INTR_ATIO_RSP_QUE_UPDATE: { - unsigned long flags2; - spin_lock_irqsave(&ha->tgt.atio_lock, flags2); - qlt_24xx_process_atio_queue(vha, 1); - spin_unlock_irqrestore(&ha->tgt.atio_lock, flags2); - + case INTR_ATIO_RSP_QUE_UPDATE: + process_atio = true; qla24xx_process_response_queue(vha, rsp); break; - } default: ql_dbg(ql_dbg_async, vha, 0x5051, "Unrecognized interrupt type (%d).\n", stat & 0xff); @@ -3338,6 +3328,12 @@ qla24xx_msix_default(int irq, void *dev_id) qla2x00_handle_mbx_completion(ha, status); spin_unlock_irqrestore(&ha->hardware_lock, flags); + if (process_atio) { + spin_lock_irqsave(&ha->tgt.atio_lock, flags); + qlt_24xx_process_atio_queue(vha, 0); + spin_unlock_irqrestore(&ha->tgt.atio_lock, flags); + } + return IRQ_HANDLED; } From patchwork Tue Sep 4 21:19:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10587979 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 BE01B920 for ; Tue, 4 Sep 2018 21:19:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD26E28F76 for ; Tue, 4 Sep 2018 21:19:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A12982A127; Tue, 4 Sep 2018 21:19:33 +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,DKIM_SIGNED, DKIM_VALID,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 31BA028F76 for ; Tue, 4 Sep 2018 21:19:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727438AbeIEBq1 (ORCPT ); Tue, 4 Sep 2018 21:46:27 -0400 Received: from mail-co1nam03on0074.outbound.protection.outlook.com ([104.47.40.74]:36476 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727320AbeIEBq0 (ORCPT ); Tue, 4 Sep 2018 21:46:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OYdwcQ8p7FnNssGdJRfPPu/PVUHTe6fQE0fzEhoniAo=; b=V9+kdTHzv5Z7nYJO5m4XLNElTuOIgW2xUhoXsXFO8ErJrReppORU+ZNukHlEQkR8bK6h8RzMGJeBjnS6ItIheXqdC8Pmr5IOsnYEmplRrIp1tTaz6Ia2WSnaoAN4pTnrrFzOgSwCpWnh+lz1woAdDf3hqN7vqGDd2oZOwI4Cc10= Received: from DM5PR07CA0082.namprd07.prod.outlook.com (2603:10b6:4:ad::47) by SN6PR07MB4399.namprd07.prod.outlook.com (2603:10b6:805:58::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.18; Tue, 4 Sep 2018 21:19:29 +0000 Received: from CO1NAM05FT006.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::209) by DM5PR07CA0082.outlook.office365.com (2603:10b6:4:ad::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.16 via Frontend Transport; Tue, 4 Sep 2018 21:19:29 +0000 Authentication-Results: spf=pass (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by CO1NAM05FT006.mail.protection.outlook.com (10.152.96.111) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1143.1 via Frontend Transport; Tue, 4 Sep 2018 21:19:29 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 4 Sep 2018 14:19:20 -0700 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 w84LJL7o031974; Tue, 4 Sep 2018 14:19:21 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w84LJLrH031973; Tue, 4 Sep 2018 14:19:21 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 03/13] qla2xxx: Add appropriate debug info for invalid RX_ID Date: Tue, 4 Sep 2018 14:19:11 -0700 Message-ID: <20180904211921.31927-4-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180904211921.31927-1-himanshu.madhani@cavium.com> References: <20180904211921.31927-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39850400004)(346002)(396003)(136003)(376002)(2980300002)(438002)(189003)(199004)(2906002)(48376002)(14444005)(76176011)(186003)(4326008)(36756003)(51416003)(26005)(6666003)(47776003)(8676002)(356003)(50466002)(1076002)(5660300001)(476003)(126002)(486006)(50226002)(305945005)(72206003)(575784001)(11346002)(446003)(2616005)(87636003)(44832011)(478600001)(86362001)(106002)(42186006)(316002)(110136005)(54906003)(106466001)(69596002)(16586007)(81156014)(336012)(8936002)(80596001)(81166006);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR07MB4399;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT006;1:sjMWkarqU1dxeUSxDSMyNzXqcFB0VZxIfqZcyq5W0xjzksNP06mgQiSliPnPMn6QKuGsW01y5Xy9u71Up6BkLWmrbLKVHRN/RgNcnLsndjKh7AazBVOZse+v0e1YxKQ3 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 251e7f5f-4c32-4a30-a7a1-08d612ac19b8 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:SN6PR07MB4399; X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4399;3:X+43zHzarBWGx4Ix5St6qnKxK30JK8ngmZ7WPjoI61mtyOKhf9LVRpQ1O2iGWXCtAukmy7IAK6lAfZx7sD4H4/uhIbMDzo1DHJaWZ/xv+CcqPx0UvjXTbXxR46s8Tp9ovUdNLyOLVjsKgfUDJxikPHGw6KdgeMA+26Xga6giKkjW0zc9fm7EqKropvk5IR472hh5d5gcemwJT+nP/DtTjp+72xNNExrqoBZ/SdeDtq3mR14wgShKdjoy4CY2foC7u6u8C5ys/IqnZVQ9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mQTvD4KYmzR1/78ibNh1sZjL0aBf6JtkSMeQ4pwySlSkOTHzwiT4SiTkzhp15JNTkFMY30IP4LKdjlNI6XNP9E5HqYIMzBoX46cBau7f2dlLKPI77my25jJklZuZWQYdwfcIAPqy0dM8ox73Avpjr+M1mvGQq5oWNJHfNo0xrCLjrk X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93004095)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:SN6PR07MB4399;BCL:0;PCL:0;RULEID:;SRVR:SN6PR07MB4399; X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4399;4:YWm4jrdcdX8H6MrBbJe4EFqQKNm/c5LbhARM7oGRdlFdQFM7lYYIvV6rsMD3k2ezO3pCZCXAjyjHq+eojJQ/2kaOAwrf0uq4Pm9laLFDLMVkdLd2hcdBFucs1tW763pAfA5usRCCTFXFlEr4C1DGMDpvc5kSlqwnS1lj+bRdXQVL4Q7/eWhBSvDjAQm/0M6uL+Z2QYAz73KtzxpJsFiCJc/v7bh71wQoK0rN9owfGRF5Ad61qaoMU0gcx3XCTnTElstzS03juMkRU3BKpNZCgA== X-Forefront-PRVS: 0785459C39 X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4399;23:65901JU3sOgZk+zr4YOUwbm9Bz8YckcjT5IRAcEGgW/cUWjBKJfwQQDzDTK9pprFgUVG3HHo5ZuCVYXE6mrEbZbRXb7RP7ZajwcMppQYW8e4dLKrS9mmTb+QFilCdtstweSYVAOsxoBbE+MviWh/eoGrVKeLoA4rSNdi6cm+zGNzViiCaRIy5ERT5oRhiPVIMdM+hlzL5K49we4P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PZZS/ZKPllTnyTlWQgBAoZmCfu6pbfCS/Z1Rk+fM04zB1XKfKBOY2rIael3dyv2ZRNrlAvp2rxlaLB2qB1VrMzxJNDtL79U/qO7PxQdogPeLdhHMpDgzQ7UglqdR SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 21:19:29.2054 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 251e7f5f-4c32-4a30-a7a1-08d612ac19b8 X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4399 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 When driver detect CTIO_INVALID_RX_ID status for CTIO, print message with correct information to help with debugging. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_target.c | 12 +++++++++++- drivers/scsi/qla2xxx/qla_target.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 29fbb0aad489..3796525aec71 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -3291,6 +3291,7 @@ int qlt_xmit_response(struct qla_tgt_cmd *cmd, int xmit_type, cmd->state = QLA_TGT_STATE_PROCESSED; /* Mid-level is done processing */ cmd->cmd_sent_to_fw = 1; + cmd->ctio_flags = le16_to_cpu(pkt->u.status0.flags); /* Memory Barrier */ wmb(); @@ -3369,6 +3370,7 @@ int qlt_rdy_to_xfer(struct qla_tgt_cmd *cmd) cmd->state = QLA_TGT_STATE_NEED_DATA; cmd->cmd_sent_to_fw = 1; + cmd->ctio_flags = le16_to_cpu(pkt->u.status0.flags); /* Memory Barrier */ wmb(); @@ -3942,12 +3944,20 @@ static void qlt_do_ctio_completion(struct scsi_qla_host *vha, if (unlikely(status != CTIO_SUCCESS)) { switch (status & 0xFFFF) { + case CTIO_INVALID_RX_ID: + if (printk_ratelimit()) + dev_info(&vha->hw->pdev->dev, + "qla_target(%d): CTIO with INVALID_RX_ID ATIO attr %x CTIO Flags %x|%x\n", + vha->vp_idx, cmd->atio.u.isp24.attr, + ((cmd->ctio_flags >> 9) & 0xf), + cmd->ctio_flags); + + break; case CTIO_LIP_RESET: case CTIO_TARGET_RESET: case CTIO_ABORTED: /* driver request abort via Terminate exchange */ case CTIO_TIMEOUT: - case CTIO_INVALID_RX_ID: /* They are OK */ ql_dbg(ql_dbg_tgt_mgt, vha, 0xf058, "qla_target(%d): CTIO with " diff --git a/drivers/scsi/qla2xxx/qla_target.h b/drivers/scsi/qla2xxx/qla_target.h index fecf96f0225c..cda41f2074cf 100644 --- a/drivers/scsi/qla2xxx/qla_target.h +++ b/drivers/scsi/qla2xxx/qla_target.h @@ -908,6 +908,7 @@ struct qla_tgt_cmd { u64 unpacked_lun; enum dma_data_direction dma_data_direction; + uint16_t ctio_flags; uint16_t vp_idx; uint16_t loop_id; /* to save extra sess dereferences */ struct qla_tgt *tgt; /* to save extra sess dereferences */ From patchwork Tue Sep 4 21:19:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10587981 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 2AAAD920 for ; Tue, 4 Sep 2018 21:19:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19AB228F76 for ; Tue, 4 Sep 2018 21:19:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D7D92A127; Tue, 4 Sep 2018 21:19:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 631B628F76 for ; Tue, 4 Sep 2018 21:19:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727442AbeIEBq3 (ORCPT ); Tue, 4 Sep 2018 21:46:29 -0400 Received: from mail-co1nam03on0069.outbound.protection.outlook.com ([104.47.40.69]:55520 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727174AbeIEBq3 (ORCPT ); Tue, 4 Sep 2018 21:46:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=78OCRIHthbvOrLLN4jL5ZORV+dcBkq/LyDJ/5H8YjqQ=; b=kFz0nEGN9HTM8me2oQjygCct0d32tezVR3jv8jPk1vUCogJDeh5zibcQe9ctEEVMIMv3vb3//Yd1bqUYg37geUGe8vg47o7F7M5XEak31mS33mLJKvn2tgzZ9JsYUXQW8yXX/KpcC1g59ShW12YmDOr6K6txRmhDoAfOLV2xfM0= Received: from DM5PR07CA0075.namprd07.prod.outlook.com (2603:10b6:4:ad::40) by DM6PR07MB4666.namprd07.prod.outlook.com (2603:10b6:5:a0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.15; Tue, 4 Sep 2018 21:19:30 +0000 Received: from CO1NAM05FT049.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::208) by DM5PR07CA0075.outlook.office365.com (2603:10b6:4:ad::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.14 via Frontend Transport; Tue, 4 Sep 2018 21:19:30 +0000 Authentication-Results: spf=pass (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by CO1NAM05FT049.mail.protection.outlook.com (10.152.96.164) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1143.1 via Frontend Transport; Tue, 4 Sep 2018 21:19:30 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 4 Sep 2018 14:19:20 -0700 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 w84LJMPs031978; Tue, 4 Sep 2018 14:19:22 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w84LJMpK031977; Tue, 4 Sep 2018 14:19:22 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 04/13] qla2xxx: Add logic to detect ABTS hang and response completion Date: Tue, 4 Sep 2018 14:19:12 -0700 Message-ID: <20180904211921.31927-5-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180904211921.31927-1-himanshu.madhani@cavium.com> References: <20180904211921.31927-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(376002)(346002)(39860400002)(396003)(2980300002)(438002)(199004)(189003)(6666003)(336012)(5660300001)(16586007)(42186006)(316002)(11346002)(446003)(54906003)(80596001)(47776003)(50466002)(106002)(44832011)(8676002)(476003)(2616005)(126002)(110136005)(50226002)(486006)(48376002)(69596002)(8936002)(14444005)(36756003)(4326008)(106466001)(1076002)(305945005)(2906002)(86362001)(356003)(186003)(76176011)(81156014)(51416003)(72206003)(26005)(81166006)(87636003)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR07MB4666;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT049;1:UTPy+WkOxkdd9NZnduyDI1G9q9jqf6RDdu0+/s3uYj4yX/se5G6h6KAODz+9zKCz/x4wJ2FNdIiERgjMkx2+48OtYrYEDT/IBA6z6GFiYs86qrLhUbsaoQMjfBAsDjs2 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 38c207d2-96ef-4f79-8f5a-08d612ac1a52 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM6PR07MB4666; X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4666;3:bHcIdenFaWHd/v7oy88vivbzDUjC0ifd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+tsGeI8b8hD5/ZoZV1fGxQfCAFk6IZHY8pHrsfso0VG0SzyrzFGUDgRe8+TdQ9bUWZnBd5OKGwjgo+dpxWr3elYgFpoyOktPsddGRg1PNjeuzms33fBVsmgcAvGzXZYvIlodWPi/yAuTyCY/KU5G1IVHWtdLlzzsnmse18gmyxnQt1wPSxQ1YIwc4Q4yh7QePtR246LJqyFMX2vWznyFU8R4ohdjp+plq+6hXmRG+Ge1tacCH0kjQB1mUtcy4c6XftSN5dfaa9xggNJFpQm9KsNm2u4AgMePA9NjxSnX/N7wRdfhHpICkbGS6gUvqx2LSRDMrm4lFc1uL+cKLAhs+07GvPxevdx+afuIO0IKaGr1naWCgN9ezHutAnHALS02wc8Wt6leJ/v/5+JlrOEwlLXwQVo6ZTzBLw X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93004095)(10201501046)(149027)(150027)(6041310)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:DM6PR07MB4666;BCL:0;PCL:0;RULEID:;SRVR:DM6PR07MB4666; X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4666;4:ikQ+ateoeUcmd4hgBZ32evDt7tRwXZpWjXBIRaMhxtn4pPqjuAtyfyplBiSa6Jan86MMuJhWcOWnHloEi4Og3Pi3nslXYGiazXTmc8asxbOPYHayXC60csT795d5/CauwkpuNPRbsrl27d59YV4SUhNRf8XtVPSkOm6TO7eZeKq6XMdbkpu/rW3FHugOy071vJ4BRhl+Y3rd6af5NlIYaMNxfcMMBsJb5ZObZPvZpK18D0xd/G7WW7ix7MZmmOt9p+OnxOo/tvtV0YVKx7pEhQ== X-Forefront-PRVS: 0785459C39 X-Micro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HcWDqnlunrGnqBpoOTKWveX8EFA6QXoiYPv8DpiZb7g/aeQ5/PFVVQcvX9T2Llvb2QqFrfXCwQm0NCc6XdalA=;7:ybqdNzChun2kgr6BCTc2sVnf0GAciEAYkH7auvA1891Soh2M5uQvC2oidtv1xDwkOkHSxL9GLQiQiCAi6AUEG5AvJTZ3onK2ZxKxp7WhKC7hFveqK2u2CkpJmZGrcDRUA6R3hnCIKTzTlTidn4YQU51zaqPzWP27hTKGatGzc2b/tNAf/s2HTLzAfVsj41gDVvlMzlnyoaxPO4GfJkLeZigrgBeYDE5XZU/yrdiS6bvOo7SpWUpz3q6Jk8JnKxDC SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 21:19:30.2297 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 38c207d2-96ef-4f79-8f5a-08d612ac1a52 X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB4666 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 ABTS error completion can trigger an exchange cleanup from the driver and another ABTS response will be generated. This retry of ABTS response can cause loop between driver trying to send ABTS and firmware returning error. This patch fixes this issue by adding logic to check for unresolved exchanges and clean up before ABTS is retried. This patch also addes the fix to use the same qpair as the ABTS completion for the terminatation of exchange as well as retry of ABTS response. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 3 ++ drivers/scsi/qla2xxx/qla_os.c | 1 + drivers/scsi/qla2xxx/qla_target.c | 72 ++++++++++++++++++++++++++++++++++----- 3 files changed, 67 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 16dd59bcd60a..8722abff7061 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -3485,6 +3485,9 @@ struct qla_qpair { struct list_head qp_list_elem; /* vha->qp_list */ struct list_head hints_list; uint16_t cpuid; + uint16_t retry_term_cnt; + uint32_t retry_term_exchg_addr; + uint64_t retry_term_jiff; struct qla_tgt_counters tgt_counters; }; diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 9628fe4a967f..f3787fc48533 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -391,6 +391,7 @@ static void qla_init_base_qpair(struct scsi_qla_host *vha, struct req_que *req, struct qla_hw_data *ha = vha->hw; rsp->qpair = ha->base_qpair; rsp->req = req; + ha->base_qpair->hw = ha; ha->base_qpair->req = req; ha->base_qpair->rsp = rsp; ha->base_qpair->vha = vha; diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 3796525aec71..954d5fa1374c 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -1800,15 +1800,15 @@ static void qlt_24xx_send_abts_resp(struct qla_qpair *qpair, * ha->hardware_lock supposed to be held on entry. Might drop it, then reaquire */ static void qlt_24xx_retry_term_exchange(struct scsi_qla_host *vha, - struct abts_resp_from_24xx_fw *entry) + struct qla_qpair *qpair, struct abts_resp_from_24xx_fw *entry) { struct ctio7_to_24xx *ctio; + u16 tmp; ql_dbg(ql_dbg_tgt, vha, 0xe007, "Sending retry TERM EXCH CTIO7 (ha=%p)\n", vha->hw); - ctio = (struct ctio7_to_24xx *)qla2x00_alloc_iocbs_ready( - vha->hw->base_qpair, NULL); + ctio = (struct ctio7_to_24xx *)qla2x00_alloc_iocbs_ready(qpair, NULL); if (ctio == NULL) { ql_dbg(ql_dbg_tgt, vha, 0xe04b, "qla_target(%d): %s failed: unable to allocate " @@ -1831,16 +1831,21 @@ static void qlt_24xx_retry_term_exchange(struct scsi_qla_host *vha, ctio->initiator_id[1] = entry->fcp_hdr_le.d_id[1]; ctio->initiator_id[2] = entry->fcp_hdr_le.d_id[2]; ctio->exchange_addr = entry->exchange_addr_to_abort; - ctio->u.status1.flags = cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_1 | - CTIO7_FLAGS_TERMINATE); + tmp = (CTIO7_FLAGS_STATUS_MODE_1 | CTIO7_FLAGS_TERMINATE); + if (qpair->retry_term_cnt & 1) + tmp |= (0x4 << 9); + ctio->u.status1.flags = cpu_to_le16(tmp); + ctio->u.status1.ox_id = cpu_to_le16(entry->fcp_hdr_le.ox_id); /* Memory Barrier */ wmb(); - qla2x00_start_iocbs(vha, vha->req); + if (qpair->reqq_start_iocbs) + qpair->reqq_start_iocbs(qpair); + else + qla2x00_start_iocbs(vha, qpair->req); - qlt_24xx_send_abts_resp(vha->hw->base_qpair, - (struct abts_recv_from_24xx *)entry, + qlt_24xx_send_abts_resp(qpair, (struct abts_recv_from_24xx *)entry, FCP_TMF_CMPL, true); } @@ -5667,6 +5672,52 @@ static void qlt_24xx_atio_pkt(struct scsi_qla_host *vha, tgt->atio_irq_cmd_count--; } +/* + * qpair lock is assume to be held + * rc = 0 : send terminate & abts respond + * rc != 0: do not send term & abts respond + */ +static int qlt_chk_unresolv_exchg(struct scsi_qla_host *vha, + struct qla_qpair *qpair, struct abts_resp_from_24xx_fw *entry) +{ + struct qla_hw_data *ha = vha->hw; + int rc = 0; + + /* + * Detect unresolved exchange. If the same ABTS is unable + * to terminate an existing command and the same ABTS loops + * between FW & Driver, then force FW dump. Under 1 jiff, + * we should see multiple loops. + */ + if (qpair->retry_term_exchg_addr == entry->exchange_addr_to_abort && + qpair->retry_term_jiff == jiffies) { + /* found existing exchange */ + qpair->retry_term_cnt++; + if (qpair->retry_term_cnt >= 5) { + rc = EIO; + qpair->retry_term_cnt = 0; + ql_log(ql_log_warn, vha, 0xffff, + "Unable to send ABTS Respond. Dumping firmware.\n"); + ql_dump_buffer(ql_dbg_tgt_mgt + ql_dbg_buffer, + vha, 0xffff, (uint8_t *)entry, sizeof(*entry)); + + if (qpair == ha->base_qpair) + ha->isp_ops->fw_dump(vha, 1); + else + ha->isp_ops->fw_dump(vha, 0); + + set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); + qla2xxx_wake_dpc(vha); + } + } else if (qpair->retry_term_jiff != jiffies) { + qpair->retry_term_exchg_addr = entry->exchange_addr_to_abort; + qpair->retry_term_cnt = 0; + qpair->retry_term_jiff = jiffies; + } + + return rc; +} + /* ha->hardware_lock supposed to be held on entry */ /* called via callback from qla2xxx */ static void qlt_response_pkt(struct scsi_qla_host *vha, @@ -5824,8 +5875,11 @@ static void qlt_response_pkt(struct scsi_qla_host *vha, * (re)terminate the exchange and retry * the abort response. */ + if (qlt_chk_unresolv_exchg(vha, + rsp->qpair, entry)) + break; qlt_24xx_retry_term_exchange(vha, - entry); + rsp->qpair, entry); } else ql_dbg(ql_dbg_tgt, vha, 0xe063, "qla_target(%d): ABTS_RESP_24XX " From patchwork Tue Sep 4 21:19:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10588021 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 9AF6014E0 for ; Tue, 4 Sep 2018 21:23:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88C8629B42 for ; Tue, 4 Sep 2018 21:23:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CD1B29EFC; Tue, 4 Sep 2018 21:23: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,DKIM_SIGNED, DKIM_VALID,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 31C5629B42 for ; Tue, 4 Sep 2018 21:23:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726507AbeIEBuh (ORCPT ); Tue, 4 Sep 2018 21:50:37 -0400 Received: from mail-cys01nam02on0050.outbound.protection.outlook.com ([104.47.37.50]:6496 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727156AbeIEBug (ORCPT ); Tue, 4 Sep 2018 21:50:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qVHYNjXt9GDi8+Aaz9L/SuE1pPMPy2sqhDGHYs9Rl74=; b=FTJOdgLcryQjL6e3LW60GQ72Tn2lH5Sw2n1msrj4e/S2Xhw075qq2XT0SbyWk2SSYWRouiaCfEnYVHEAji5gqN+Ksr06o3KG2AYUlmY+kRqH0BCNzbT3ORtuEfUl6VDKoAA+Z/A++L29tazWqS+e3rwH7MXrRHcGNrrTLRIdkTs= Received: from DM5PR07CA0075.namprd07.prod.outlook.com (2603:10b6:4:ad::40) by BN7PR07MB4659.namprd07.prod.outlook.com (2603:10b6:406:f1::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.14; Tue, 4 Sep 2018 21:19:31 +0000 Received: from CO1NAM05FT049.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::208) by DM5PR07CA0075.outlook.office365.com (2603:10b6:4:ad::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.14 via Frontend Transport; Tue, 4 Sep 2018 21:19:31 +0000 Authentication-Results: spf=pass (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by CO1NAM05FT049.mail.protection.outlook.com (10.152.96.164) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1143.1 via Frontend Transport; Tue, 4 Sep 2018 21:19:31 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 4 Sep 2018 14:19:20 -0700 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 w84LJMTd031982; Tue, 4 Sep 2018 14:19:22 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w84LJM8N031981; Tue, 4 Sep 2018 14:19:22 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 05/13] qla2xxx: Fix out of order Termination and ABTS response Date: Tue, 4 Sep 2018 14:19:13 -0700 Message-ID: <20180904211921.31927-6-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180904211921.31927-1-himanshu.madhani@cavium.com> References: <20180904211921.31927-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(396003)(376002)(39860400002)(346002)(136003)(2980300002)(438002)(199004)(189003)(106002)(80596001)(14444005)(26005)(86362001)(69596002)(575784001)(1076002)(5660300001)(2906002)(186003)(76176011)(51416003)(87636003)(16586007)(316002)(110136005)(54906003)(478600001)(42186006)(4326008)(36756003)(50466002)(48376002)(72206003)(106466001)(8936002)(8676002)(47776003)(6666003)(81156014)(126002)(305945005)(486006)(356003)(446003)(44832011)(11346002)(476003)(81166006)(2616005)(336012)(50226002);DIR:OUT;SFP:1101;SCL:1;SRVR:BN7PR07MB4659;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT049;1:mmv4Z8m7NZI2UkIamYJ1xJKTs0NI1406HrxOPGPOyziuSBLcBznho0adYsCbgRG7FjJyldF1SSzVaUefIsHyZ96fMcO93OgHhDb0bVVbaEzz+JDaFIXM3e0gpr/Jag4Q X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fee82590-7bf5-48b2-b188-08d612ac1ad5 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BN7PR07MB4659; X-Microsoft-Exchange-Diagnostics: 1;BN7PR07MB4659;3:c6HTLZALJL7hD1kASePyVxPmB9DfuI8Y5xfQsnQRh0e0jkfX1N5w3qHCASqlfnQXvhzJc3LSfGP3hqMuJ1B7rKSgxfpSZCDFHdG6Brtqjq92wWGm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WUvFtpCPhO2fXLQeioMkNB4YV+eBPBYTkPszWkOS8ytmqZFQTFBlCwbcQEJwSZWyBoOpXHMjSMZIMI0dKahQ4m61Kj1PQilFyGfjLlQra5FXrsAHfO+mkocZddQVSr3FHM6FWmh40isy5onCGvuvpl9zgCFRH+lmn85L3gxBDr+VCUysR1vaQg6XF20Uy62pZIbf73rll3z6QsZItYrpbkk/94WSmjWGthWa5nd9RJKqrndS8BisYwPrLRxsVSDNnKxOo08LWDiUv2WRT/h/O4MX1xgTMBx3ArD5sqJVfYW2rMVAiLXtd0DYa+fvzozASbJyFFvl73X20wnYk+s3TnaT0x2OxNh X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93004095)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:BN7PR07MB4659;BCL:0;PCL:0;RULEID:;SRVR:BN7PR07MB4659; X-Microsoft-Exchange-Diagnostics: 1;BN7PR07MB4659;4:tK1XoZHkw82//wMKvjx5jC1R3EEfoCN1df0TQnyz6Ev1S1UwGWrqsPI+tDXiX3mMM5u0v3wpxRvXXOVk48y8h5jG/bZb9W9sGvoF6RunYWtHiRc7K3IP/STcBb4P/b6W9C4Qb0o7EZldY3yFjpHMhnTTOd1/x8FTdDQaaZIGmbm5DI+0yZlz++smbNU6klDAQpiWAnHkWZuACRg/ST2+EfdOILKgJZXX6WNWSicwk3PYEtG3XUJ4D8CbfUvZ2as8jeWpV38RENHoPz2XZdir0w== X-Forefront-PRVS: 0785459C39 X-Microsoft-Exchange-Diagnostics: 1;BN7PR07MB4659;23:GcBEZM9VK671tx6al5Etd7IgMZEtk4HJDQelItdirKB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S6gUeYFr2tBWfITY4ggZVuxWxmo=;7:7X0nOANnOwR5oVkf/dzEciSsMbCk9Kydix8jIeXtW+UpLxY2iNlYdqOsBM9v2qln3p7ckvxIPkJNX/03DqgGUCRJfc1SXq6Hi+jjZjQzhPCigj81DwPuShznvPxLMCn3m5SR7U+krPzFHKid4fnwTX0otP7DsY/bJnpfK+r7cmJ7V6n0P2d1ZBzKC1NIomDuTQ+L5ChqzFiy6ixQTNcxFZjeholVxPfqoJo4YWHIYLAMGEfpltWOya9B9ZKOou4T SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 21:19:31.0890 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fee82590-7bf5-48b2-b188-08d612ac1ad5 X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR07MB4659 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 Following changes are added by this patch - Prevent ABTS Response from getting in front of Termination of exchange. Firmware requires driver to cleanup exchanges before ABTS response can be sent. This reduces ABTS response error which triggers extra command re-termination and re-sending of ABTS response. - Add bits in driver and tracks CTIO/ATIO attribute bits for proper command Termination. A copy of the ATTR bits will be kept in the ABTS task management command as a back up copy, if an ABTS response encounters an error. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 1 + drivers/scsi/qla2xxx/qla_os.c | 130 ++++++++++------- drivers/scsi/qla2xxx/qla_target.c | 300 +++++++++++++++++++++++++------------- drivers/scsi/qla2xxx/qla_target.h | 6 +- 4 files changed, 277 insertions(+), 160 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 8722abff7061..8cbfbeb0751c 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -519,6 +519,7 @@ struct srb_iocb { enum { TYPE_SRB, TYPE_TGT_CMD, + TYPE_TGT_TMCMD, /* task management */ }; typedef struct srb { diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index f3787fc48533..d0d5e332bafc 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -1732,64 +1732,84 @@ __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res) sp = req->outstanding_cmds[cnt]; if (sp) { req->outstanding_cmds[cnt] = NULL; - if (sp->cmd_type == TYPE_SRB) { - if (sp->type == SRB_NVME_CMD || - sp->type == SRB_NVME_LS) { - sp_get(sp); - spin_unlock_irqrestore(qp->qp_lock_ptr, - flags); - qla_nvme_abort(ha, sp, res); - spin_lock_irqsave(qp->qp_lock_ptr, - flags); - } else if (GET_CMD_SP(sp) && - !ha->flags.eeh_busy && - (!test_bit(ABORT_ISP_ACTIVE, - &vha->dpc_flags)) && - (sp->type == SRB_SCSI_CMD)) { - /* - * Don't abort commands in - * adapter during EEH - * recovery as it's not - * accessible/responding. - * - * Get a reference to the sp - * and drop the lock. The - * reference ensures this - * sp->done() call and not the - * call in qla2xxx_eh_abort() - * ends the SCSI command (with - * result 'res'). - */ - sp_get(sp); - spin_unlock_irqrestore(qp->qp_lock_ptr, - flags); - status = qla2xxx_eh_abort( - GET_CMD_SP(sp)); - spin_lock_irqsave(qp->qp_lock_ptr, - flags); + switch (sp->cmd_type) { + case TYPE_SRB: + if (sp->cmd_type == TYPE_SRB) { + if (sp->type == SRB_NVME_CMD || + sp->type == SRB_NVME_LS) { + sp_get(sp); + spin_unlock_irqrestore + (qp->qp_lock_ptr, + flags); + qla_nvme_abort(ha, sp, res); + spin_lock_irqsave + (qp->qp_lock_ptr, + flags); + } else if (GET_CMD_SP(sp) && + !ha->flags.eeh_busy && + (!test_bit(ABORT_ISP_ACTIVE, + &vha->dpc_flags)) && + (sp->type == SRB_SCSI_CMD)) { + /* + * Don't abort commands in + * adapter during EEH + * recovery as it's not + * accessible/responding. + * + * Get a reference to the sp + * and drop the lock. The + * reference ensures this + * sp->done() call and not the + * call in qla2xxx_eh_abort() + * ends the SCSI command (with + * result 'res'). + */ + sp_get(sp); + spin_unlock_irqrestore + (qp->qp_lock_ptr, + flags); + status = qla2xxx_eh_abort( + GET_CMD_SP(sp)); + spin_lock_irqsave + (qp->qp_lock_ptr, + flags); + /* + * Get rid of extra reference + * if immediate exit from + * ql2xxx_eh_abort + */ + if (status == FAILED && + (qla2x00_isp_reg_stat(ha))) + atomic_dec( + &sp->ref_count); + } + sp->done(sp, res); + break; + case TYPE_TGT_CMD: + if (!vha->hw->tgt.tgt_ops || + !tgt || qla_ini_mode_enabled(vha)) { + if (!trace) + ql_dbg(ql_dbg_tgt_mgt, + vha, 0xf003, + "HOST-ABORT-HNDLR: dpc_flags=%lx. Target mode disabled\n", + vha->dpc_flags); + continue; + } + cmd = (struct qla_tgt_cmd *)sp; + qlt_abort_cmd_on_host_reset(cmd->vha, + cmd); + break; + case TYPE_TGT_TMCMD: /* - * Get rid of extra reference - * if immediate exit from - * ql2xxx_eh_abort + * Currently, only ABTS response gets on + * the outstanding_cmds[] */ - if (status == FAILED && - (qla2x00_isp_reg_stat(ha))) - atomic_dec( - &sp->ref_count); - } - sp->done(sp, res); - } else { - if (!vha->hw->tgt.tgt_ops || !tgt || - qla_ini_mode_enabled(vha)) { - if (!trace) - ql_dbg(ql_dbg_tgt_mgt, - vha, 0xf003, - "HOST-ABORT-HNDLR: dpc_flags=%lx. Target mode disabled\n", - vha->dpc_flags); - continue; + ha->tgt.tgt_ops->free_mcmd( + (struct qla_tgt_mgmt_cmd *)sp); + break; + default: + break; } - cmd = (struct qla_tgt_cmd *)sp; - qlt_abort_cmd_on_host_reset(cmd->vha, cmd); } } } diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 954d5fa1374c..c2076758a4b6 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -141,6 +141,8 @@ static void qlt_24xx_handle_abts(struct scsi_qla_host *, struct abts_recv_from_24xx *); static void qlt_send_busy(struct qla_qpair *, struct atio_from_isp *, uint16_t); +static int qlt_check_reserve_free_req(struct qla_qpair *qpair, uint32_t); +static inline uint32_t qlt_make_handle(struct qla_qpair *); /* * Global Variables @@ -541,7 +543,6 @@ void qlt_response_pkt_all_vps(struct scsi_qla_host *vha, qlt_response_pkt(host, rsp, pkt); break; } - default: qlt_response_pkt(vha, rsp, pkt); break; @@ -1716,6 +1717,94 @@ static void qlt_send_notify_ack(struct qla_qpair *qpair, qla2x00_start_iocbs(vha, qpair->req); } +static int qlt_build_abts_resp_iocb(struct qla_tgt_mgmt_cmd *mcmd) +{ + struct scsi_qla_host *vha = mcmd->vha; + struct qla_hw_data *ha = vha->hw; + struct abts_resp_to_24xx *resp; + uint32_t f_ctl, h; + uint8_t *p; + int rc; + struct abts_recv_from_24xx *abts = &mcmd->orig_iocb.abts; + struct qla_qpair *qpair = mcmd->qpair; + + ql_dbg(ql_dbg_tgt, vha, 0xe006, + "Sending task mgmt ABTS response (ha=%p, status=%x)\n", + ha, mcmd->fc_tm_rsp); + + rc = qlt_check_reserve_free_req(qpair, 1); + if (rc) { + ql_dbg(ql_dbg_tgt, vha, 0xe04a, + "qla_target(%d): %s failed: unable to allocate request packet\n", + vha->vp_idx, __func__); + return -EAGAIN; + } + + resp = (struct abts_resp_to_24xx *)qpair->req->ring_ptr; + memset(resp, 0, sizeof(*resp)); + + h = qlt_make_handle(qpair); + if (unlikely(h == QLA_TGT_NULL_HANDLE)) { + /* + * CTIO type 7 from the firmware doesn't provide a way to + * know the initiator's LOOP ID, hence we can't find + * the session and, so, the command. + */ + return -EAGAIN; + } else { + qpair->req->outstanding_cmds[h] = (srb_t *)mcmd; + } + + resp->handle = MAKE_HANDLE(qpair->req->id, h); + resp->entry_type = ABTS_RESP_24XX; + resp->entry_count = 1; + resp->nport_handle = abts->nport_handle; + resp->vp_index = vha->vp_idx; + resp->sof_type = abts->sof_type; + resp->exchange_address = abts->exchange_address; + resp->fcp_hdr_le = abts->fcp_hdr_le; + f_ctl = cpu_to_le32(F_CTL_EXCH_CONTEXT_RESP | + F_CTL_LAST_SEQ | F_CTL_END_SEQ | + F_CTL_SEQ_INITIATIVE); + p = (uint8_t *)&f_ctl; + resp->fcp_hdr_le.f_ctl[0] = *p++; + resp->fcp_hdr_le.f_ctl[1] = *p++; + resp->fcp_hdr_le.f_ctl[2] = *p; + + resp->fcp_hdr_le.d_id[0] = abts->fcp_hdr_le.s_id[0]; + resp->fcp_hdr_le.d_id[1] = abts->fcp_hdr_le.s_id[1]; + resp->fcp_hdr_le.d_id[2] = abts->fcp_hdr_le.s_id[2]; + resp->fcp_hdr_le.s_id[0] = abts->fcp_hdr_le.d_id[0]; + resp->fcp_hdr_le.s_id[1] = abts->fcp_hdr_le.d_id[1]; + resp->fcp_hdr_le.s_id[2] = abts->fcp_hdr_le.d_id[2]; + + resp->exchange_addr_to_abort = abts->exchange_addr_to_abort; + if (mcmd->fc_tm_rsp == FCP_TMF_CMPL) { + resp->fcp_hdr_le.r_ctl = R_CTL_BASIC_LINK_SERV | R_CTL_B_ACC; + resp->payload.ba_acct.seq_id_valid = SEQ_ID_INVALID; + resp->payload.ba_acct.low_seq_cnt = 0x0000; + resp->payload.ba_acct.high_seq_cnt = 0xFFFF; + resp->payload.ba_acct.ox_id = abts->fcp_hdr_le.ox_id; + resp->payload.ba_acct.rx_id = abts->fcp_hdr_le.rx_id; + } else { + resp->fcp_hdr_le.r_ctl = R_CTL_BASIC_LINK_SERV | R_CTL_B_RJT; + resp->payload.ba_rjt.reason_code = + BA_RJT_REASON_CODE_UNABLE_TO_PERFORM; + /* Other bytes are zero */ + } + + vha->vha_tgt.qla_tgt->abts_resp_expected++; + + /* Memory Barrier */ + wmb(); + if (qpair->reqq_start_iocbs) + qpair->reqq_start_iocbs(qpair); + else + qla2x00_start_iocbs(vha, qpair->req); + + return rc; +} + /* * ha->hardware_lock supposed to be held on entry. Might drop it, then reaquire */ @@ -1743,6 +1832,7 @@ static void qlt_24xx_send_abts_resp(struct qla_qpair *qpair, } resp->entry_type = ABTS_RESP_24XX; + resp->handle = QLA_TGT_SKIP_HANDLE; resp->entry_count = 1; resp->nport_handle = abts->nport_handle; resp->vp_index = vha->vp_idx; @@ -1800,13 +1890,11 @@ static void qlt_24xx_send_abts_resp(struct qla_qpair *qpair, * ha->hardware_lock supposed to be held on entry. Might drop it, then reaquire */ static void qlt_24xx_retry_term_exchange(struct scsi_qla_host *vha, - struct qla_qpair *qpair, struct abts_resp_from_24xx_fw *entry) + struct qla_qpair *qpair, response_t *pkt, struct qla_tgt_mgmt_cmd *mcmd) { struct ctio7_to_24xx *ctio; u16 tmp; - - ql_dbg(ql_dbg_tgt, vha, 0xe007, - "Sending retry TERM EXCH CTIO7 (ha=%p)\n", vha->hw); + struct abts_recv_from_24xx *entry; ctio = (struct ctio7_to_24xx *)qla2x00_alloc_iocbs_ready(qpair, NULL); if (ctio == NULL) { @@ -1816,6 +1904,13 @@ static void qlt_24xx_retry_term_exchange(struct scsi_qla_host *vha, return; } + if (mcmd) + /* abts from remote port */ + entry = &mcmd->orig_iocb.abts; + else + /* abts from this driver. */ + entry = (struct abts_recv_from_24xx *)pkt; + /* * We've got on entrance firmware's response on by us generated * ABTS response. So, in it ID fields are reversed. @@ -1827,16 +1922,34 @@ static void qlt_24xx_retry_term_exchange(struct scsi_qla_host *vha, ctio->handle = QLA_TGT_SKIP_HANDLE | CTIO_COMPLETION_HANDLE_MARK; ctio->timeout = cpu_to_le16(QLA_TGT_TIMEOUT); ctio->vp_index = vha->vp_idx; - ctio->initiator_id[0] = entry->fcp_hdr_le.d_id[0]; - ctio->initiator_id[1] = entry->fcp_hdr_le.d_id[1]; - ctio->initiator_id[2] = entry->fcp_hdr_le.d_id[2]; ctio->exchange_addr = entry->exchange_addr_to_abort; tmp = (CTIO7_FLAGS_STATUS_MODE_1 | CTIO7_FLAGS_TERMINATE); - if (qpair->retry_term_cnt & 1) - tmp |= (0x4 << 9); + + if (mcmd) { + ctio->initiator_id[0] = entry->fcp_hdr_le.s_id[0]; + ctio->initiator_id[1] = entry->fcp_hdr_le.s_id[1]; + ctio->initiator_id[2] = entry->fcp_hdr_le.s_id[2]; + + if (mcmd->flags & QLA24XX_MGMT_ABORT_IO_ATTR_VALID) + tmp |= (mcmd->abort_io_attr << 9); + else if (qpair->retry_term_cnt & 1) + tmp |= (0x4 << 9); + } else { + ctio->initiator_id[0] = entry->fcp_hdr_le.d_id[0]; + ctio->initiator_id[1] = entry->fcp_hdr_le.d_id[1]; + ctio->initiator_id[2] = entry->fcp_hdr_le.d_id[2]; + + if (qpair->retry_term_cnt & 1) + tmp |= (0x4 << 9); + } ctio->u.status1.flags = cpu_to_le16(tmp); + ctio->u.status1.ox_id = entry->fcp_hdr_le.ox_id; - ctio->u.status1.ox_id = cpu_to_le16(entry->fcp_hdr_le.ox_id); + ql_dbg(ql_dbg_tgt, vha, 0xe007, + "Sending retry TERM EXCH CTIO7 flags %04xh oxid %04xh attr valid %x\n", + le16_to_cpu(ctio->u.status1.flags), + le16_to_cpu(ctio->u.status1.ox_id), + (mcmd && mcmd->flags & QLA24XX_MGMT_ABORT_IO_ATTR_VALID) ? 1 : 0); /* Memory Barrier */ wmb(); @@ -1845,43 +1958,12 @@ static void qlt_24xx_retry_term_exchange(struct scsi_qla_host *vha, else qla2x00_start_iocbs(vha, qpair->req); - qlt_24xx_send_abts_resp(qpair, (struct abts_recv_from_24xx *)entry, - FCP_TMF_CMPL, true); -} - -static int abort_cmd_for_tag(struct scsi_qla_host *vha, uint32_t tag) -{ - struct qla_tgt_sess_op *op; - struct qla_tgt_cmd *cmd; - unsigned long flags; - - spin_lock_irqsave(&vha->cmd_list_lock, flags); - list_for_each_entry(op, &vha->qla_sess_op_cmd_list, cmd_list) { - if (tag == op->atio.u.isp24.exchange_addr) { - op->aborted = true; - spin_unlock_irqrestore(&vha->cmd_list_lock, flags); - return 1; - } - } - - list_for_each_entry(op, &vha->unknown_atio_list, cmd_list) { - if (tag == op->atio.u.isp24.exchange_addr) { - op->aborted = true; - spin_unlock_irqrestore(&vha->cmd_list_lock, flags); - return 1; - } - } - - list_for_each_entry(cmd, &vha->qla_cmd_list, cmd_list) { - if (tag == cmd->atio.u.isp24.exchange_addr) { - cmd->aborted = 1; - spin_unlock_irqrestore(&vha->cmd_list_lock, flags); - return 1; - } - } - spin_unlock_irqrestore(&vha->cmd_list_lock, flags); + if (mcmd) + qlt_build_abts_resp_iocb(mcmd); + else + qlt_24xx_send_abts_resp(qpair, + (struct abts_recv_from_24xx *)entry, FCP_TMF_CMPL, true); - return 0; } /* drop cmds for the given lun @@ -1976,9 +2058,8 @@ static void qlt_do_tmr_work(struct work_struct *work) spin_lock_irqsave(mcmd->qpair->qp_lock_ptr, flags); switch (mcmd->tmr_func) { case QLA_TGT_ABTS: - qlt_24xx_send_abts_resp(mcmd->qpair, - &mcmd->orig_iocb.abts, - FCP_TMF_REJECTED, false); + mcmd->fc_tm_rsp = FCP_TMF_REJECTED; + qlt_build_abts_resp_iocb(mcmd); break; case QLA_TGT_LUN_RESET: case QLA_TGT_CLEAR_TS: @@ -2013,12 +2094,6 @@ static int __qlt_24xx_handle_abts(struct scsi_qla_host *vha, struct qla_tgt_mgmt_cmd *mcmd; struct qla_qpair_hint *h = &vha->vha_tgt.qla_tgt->qphints[0]; - if (abort_cmd_for_tag(vha, abts->exchange_addr_to_abort)) { - /* send TASK_ABORT response immediately */ - qlt_24xx_send_abts_resp(ha->base_qpair, abts, FCP_TMF_CMPL, false); - return 0; - } - ql_dbg(ql_dbg_tgt_mgt, vha, 0xf00f, "qla_target(%d): task abort (tag=%d)\n", vha->vp_idx, abts->exchange_addr_to_abort); @@ -2031,7 +2106,7 @@ static int __qlt_24xx_handle_abts(struct scsi_qla_host *vha, return -ENOMEM; } memset(mcmd, 0, sizeof(*mcmd)); - + mcmd->cmd_type = TYPE_TGT_TMCMD; mcmd->sess = sess; memcpy(&mcmd->orig_iocb.abts, abts, sizeof(mcmd->orig_iocb.abts)); mcmd->reset_count = ha->base_qpair->chip_reset; @@ -2053,6 +2128,8 @@ static int __qlt_24xx_handle_abts(struct scsi_qla_host *vha, if (abort_cmd && abort_cmd->qpair) { mcmd->qpair = abort_cmd->qpair; mcmd->se_cmd.cpuid = abort_cmd->se_cmd.cpuid; + mcmd->abort_io_attr = abort_cmd->atio.u.isp24.attr; + mcmd->flags = QLA24XX_MGMT_ABORT_IO_ATTR_VALID; } } @@ -2270,6 +2347,7 @@ void qlt_xmit_tm_rsp(struct qla_tgt_mgmt_cmd *mcmd) struct qla_hw_data *ha = vha->hw; unsigned long flags; struct qla_qpair *qpair = mcmd->qpair; + bool free_mcmd = true; ql_dbg(ql_dbg_tgt_mgt, vha, 0xf013, "TM response mcmd (%p) status %#x state %#x", @@ -2308,10 +2386,10 @@ void qlt_xmit_tm_rsp(struct qla_tgt_mgmt_cmd *mcmd) &mcmd->orig_iocb.imm_ntfy, 0, 0, 0, 0, 0, 0); } } else { - if (mcmd->orig_iocb.atio.u.raw.entry_type == ABTS_RECV_24XX) - qlt_24xx_send_abts_resp(qpair, &mcmd->orig_iocb.abts, - mcmd->fc_tm_rsp, false); - else + if (mcmd->orig_iocb.atio.u.raw.entry_type == ABTS_RECV_24XX) { + qlt_build_abts_resp_iocb(mcmd); + free_mcmd = false; + } else qlt_24xx_send_task_mgmt_ctio(qpair, mcmd, mcmd->fc_tm_rsp); } @@ -2323,7 +2401,9 @@ void qlt_xmit_tm_rsp(struct qla_tgt_mgmt_cmd *mcmd) * descriptor after TFO->queue_tm_rsp() -> tcm_qla2xxx_queue_tm_rsp() -> * qlt_xmit_tm_rsp() returns here.. */ - ha->tgt.tgt_ops->free_mcmd(mcmd); + if (free_mcmd) + ha->tgt.tgt_ops->free_mcmd(mcmd); + spin_unlock_irqrestore(qpair->qp_lock_ptr, flags); } EXPORT_SYMBOL(qlt_xmit_tm_rsp); @@ -3833,10 +3913,10 @@ static int qlt_term_ctio_exchange(struct qla_qpair *qpair, void *ctio, /* ha->hardware_lock supposed to be held on entry */ -static struct qla_tgt_cmd *qlt_ctio_to_cmd(struct scsi_qla_host *vha, +static void *qlt_ctio_to_cmd(struct scsi_qla_host *vha, struct rsp_que *rsp, uint32_t handle, void *ctio) { - struct qla_tgt_cmd *cmd = NULL; + void *cmd = NULL; struct req_que *req; int qid = GET_QID(handle); uint32_t h = handle & ~QLA_TGT_HANDLE_MASK; @@ -3865,7 +3945,7 @@ static struct qla_tgt_cmd *qlt_ctio_to_cmd(struct scsi_qla_host *vha, return NULL; } - cmd = (struct qla_tgt_cmd *)req->outstanding_cmds[h]; + cmd = (void *) req->outstanding_cmds[h]; if (unlikely(cmd == NULL)) { ql_dbg(ql_dbg_async, vha, 0xe053, "qla_target(%d): Suspicious: unable to find the command with handle %x req->id %d rsp->id %d\n", @@ -3938,7 +4018,7 @@ static void qlt_do_ctio_completion(struct scsi_qla_host *vha, return; } - cmd = qlt_ctio_to_cmd(vha, rsp, handle, ctio); + cmd = (struct qla_tgt_cmd *)qlt_ctio_to_cmd(vha, rsp, handle, ctio); if (cmd == NULL) return; @@ -5718,6 +5798,55 @@ static int qlt_chk_unresolv_exchg(struct scsi_qla_host *vha, return rc; } + +static void qlt_handle_abts_completion(struct scsi_qla_host *vha, + struct rsp_que *rsp, response_t *pkt) +{ + struct abts_resp_from_24xx_fw *entry = + (struct abts_resp_from_24xx_fw *)pkt; + u32 h = pkt->handle & ~QLA_TGT_HANDLE_MASK; + struct qla_tgt_mgmt_cmd *mcmd; + struct qla_hw_data *ha = vha->hw; + + mcmd = (struct qla_tgt_mgmt_cmd *)qlt_ctio_to_cmd(vha, rsp, + pkt->handle, pkt); + if (mcmd == NULL && h != QLA_TGT_SKIP_HANDLE) { + ql_dbg(ql_dbg_async, vha, 0xe064, + "qla_target(%d): ABTS Comp without mcmd\n", + vha->vp_idx); + return; + } + + if (mcmd) + vha = mcmd->vha; + vha->vha_tgt.qla_tgt->abts_resp_expected--; + + ql_dbg(ql_dbg_tgt, vha, 0xe038, + "ABTS_RESP_24XX: compl_status %x\n", + entry->compl_status); + + if (le16_to_cpu(entry->compl_status) != ABTS_RESP_COMPL_SUCCESS) { + if ((entry->error_subcode1 == 0x1E) && + (entry->error_subcode2 == 0)) { + if (qlt_chk_unresolv_exchg(vha, rsp->qpair, entry)) { + ha->tgt.tgt_ops->free_mcmd(mcmd); + return; + } + qlt_24xx_retry_term_exchange(vha, rsp->qpair, + pkt, mcmd); + } else { + ql_dbg(ql_dbg_tgt, vha, 0xe063, + "qla_target(%d): ABTS_RESP_24XX failed %x (subcode %x:%x)", + vha->vp_idx, entry->compl_status, + entry->error_subcode1, + entry->error_subcode2); + ha->tgt.tgt_ops->free_mcmd(mcmd); + } + } else { + ha->tgt.tgt_ops->free_mcmd(mcmd); + } +} + /* ha->hardware_lock supposed to be held on entry */ /* called via callback from qla2xxx */ static void qlt_response_pkt(struct scsi_qla_host *vha, @@ -5850,44 +5979,7 @@ static void qlt_response_pkt(struct scsi_qla_host *vha, case ABTS_RESP_24XX: if (tgt->abts_resp_expected > 0) { - struct abts_resp_from_24xx_fw *entry = - (struct abts_resp_from_24xx_fw *)pkt; - ql_dbg(ql_dbg_tgt, vha, 0xe038, - "ABTS_RESP_24XX: compl_status %x\n", - entry->compl_status); - tgt->abts_resp_expected--; - if (le16_to_cpu(entry->compl_status) != - ABTS_RESP_COMPL_SUCCESS) { - if ((entry->error_subcode1 == 0x1E) && - (entry->error_subcode2 == 0)) { - /* - * We've got a race here: aborted - * exchange not terminated, i.e. - * response for the aborted command was - * sent between the abort request was - * received and processed. - * Unfortunately, the firmware has a - * silly requirement that all aborted - * exchanges must be explicitely - * terminated, otherwise it refuses to - * send responses for the abort - * requests. So, we have to - * (re)terminate the exchange and retry - * the abort response. - */ - if (qlt_chk_unresolv_exchg(vha, - rsp->qpair, entry)) - break; - qlt_24xx_retry_term_exchange(vha, - rsp->qpair, entry); - } else - ql_dbg(ql_dbg_tgt, vha, 0xe063, - "qla_target(%d): ABTS_RESP_24XX " - "failed %x (subcode %x:%x)", - vha->vp_idx, entry->compl_status, - entry->error_subcode1, - entry->error_subcode2); - } + qlt_handle_abts_completion(vha, rsp, pkt); } else { ql_dbg(ql_dbg_tgt, vha, 0xe064, "qla_target(%d): Unexpected ABTS_RESP_24XX " diff --git a/drivers/scsi/qla2xxx/qla_target.h b/drivers/scsi/qla2xxx/qla_target.h index cda41f2074cf..6a59c99a63da 100644 --- a/drivers/scsi/qla2xxx/qla_target.h +++ b/drivers/scsi/qla2xxx/qla_target.h @@ -957,16 +957,20 @@ struct qla_tgt_sess_work_param { }; struct qla_tgt_mgmt_cmd { + uint8_t cmd_type; + uint8_t pad[3]; uint16_t tmr_func; uint8_t fc_tm_rsp; + uint8_t abort_io_attr; struct fc_port *sess; struct qla_qpair *qpair; struct scsi_qla_host *vha; struct se_cmd se_cmd; struct work_struct free_work; unsigned int flags; +#define QLA24XX_MGMT_SEND_NACK BIT_0 +#define QLA24XX_MGMT_ABORT_IO_ATTR_VALID BIT_1 uint32_t reset_count; -#define QLA24XX_MGMT_SEND_NACK 1 struct work_struct work; uint64_t unpacked_lun; union { From patchwork Tue Sep 4 21:19:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10587985 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 A25B3175A for ; Tue, 4 Sep 2018 21:19:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 916122A124 for ; Tue, 4 Sep 2018 21:19:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 856F92A128; Tue, 4 Sep 2018 21:19:38 +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,DKIM_SIGNED, DKIM_VALID,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 C004B2A127 for ; Tue, 4 Sep 2018 21:19:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727443AbeIEBqb (ORCPT ); Tue, 4 Sep 2018 21:46:31 -0400 Received: from mail-by2nam01on0055.outbound.protection.outlook.com ([104.47.34.55]:30752 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727320AbeIEBqa (ORCPT ); Tue, 4 Sep 2018 21:46:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OqK6ZNnYjJSPIZMLiojoMtgrn1C3Gv5pmO9g2c3X2S0=; b=KDZTF/ax8CpBySZQU4KDmwjfo6Be97qRxJVQX0JAHWDf4iiwmRt0j5W5AkdBPOIg6zHCvf76ABPO/8KB0uEkMmpd2thUg8GQULcQAt5gVcBFLZd5ol2Ai96VvI7QN+xSpqatHClKgfp/ra6TkwEHhK96oyXoCoa1jwOFuO0ERqQ= Received: from DM5PR07CA0075.namprd07.prod.outlook.com (2603:10b6:4:ad::40) by DM6PR07MB4395.namprd07.prod.outlook.com (2603:10b6:5:bf::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.14; Tue, 4 Sep 2018 21:19:33 +0000 Received: from CO1NAM05FT049.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::208) by DM5PR07CA0075.outlook.office365.com (2603:10b6:4:ad::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.14 via Frontend Transport; Tue, 4 Sep 2018 21:19:33 +0000 Authentication-Results: spf=pass (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by CO1NAM05FT049.mail.protection.outlook.com (10.152.96.164) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1143.1 via Frontend Transport; Tue, 4 Sep 2018 21:19:32 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 4 Sep 2018 14:19:20 -0700 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 w84LJMJF031986; Tue, 4 Sep 2018 14:19:22 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w84LJMn1031985; Tue, 4 Sep 2018 14:19:22 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 06/13] qla2xxx: Add support for ZIO6 interrupt threshold Date: Tue, 4 Sep 2018 14:19:14 -0700 Message-ID: <20180904211921.31927-7-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180904211921.31927-1-himanshu.madhani@cavium.com> References: <20180904211921.31927-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(376002)(346002)(136003)(396003)(39860400002)(2980300002)(438002)(189003)(199004)(476003)(2616005)(446003)(336012)(575784001)(86362001)(486006)(106466001)(11346002)(87636003)(44832011)(478600001)(1076002)(81156014)(126002)(47776003)(2906002)(186003)(26005)(36756003)(14444005)(6666003)(106002)(8936002)(50226002)(8676002)(16586007)(110136005)(54906003)(72206003)(69596002)(356003)(5660300001)(4326008)(316002)(42186006)(51416003)(76176011)(305945005)(80596001)(50466002)(48376002)(81166006);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR07MB4395;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT049;1:PwiUUnowUGlWvsvv/F0k8f0uuBD4y64RvC4XFCPG1lvQU1QGilb5hfbl7exBB5l1LFALpoBCyaIDg481w30U1Z4ceBJCrQ100c3IbRtE2+WoJL1VJABu+X6fhczIVLlF X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9c8c09a9-eb03-41a0-a71b-08d612ac1bcd X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM6PR07MB4395; X-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t9675+13j+fRCf8uD0QWdIWCrDKSFmh+M7WvY6yxzk6OZqQ2MqGygBKOyCSj00Z4uFyw0RzzKDmk0nDm6EhPmLT5BYEz6xKjamMHEvjPRIsNlgwLaXIgo6bp9WDvlHmdxyuVFOcJeVrBZX/F67Xjt+1iLoTrnPWgOctSW40B1Flafj9hzYdeyRGvU0K+Tup87KHag5SzIhoFghoSOiuVClmLhWEWREyNH1ruBlaZxWSDVEIGTpP+HZhuB94dMDV89v3zwiK64BLsKUGizESX+tPPKQLla1u90iIrStrNxVrLRbgASZbDOBPkRjcxBwKtx3qHozZwdARUCZshoanDe7k6XtrASUXy8u5TpiKVBfwzViRbvnWModuVwkTcB6vbHaQUEKyvz7B+VCBVhFEREemOhX+SEUlS+3CrFWh24sHoFCcgSKbb85QuySOGgN4qP3vQHwl9/hKuX5qvZyQB4+Yu3K6ZpcJc03VuWIb X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93004095)(10201501046)(149027)(150027)(6041310)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:DM6PR07MB4395;BCL:0;PCL:0;RULEID:;SRVR:DM6PR07MB4395; X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4395;4:7CmT6Djv8qtb8+KZfFbNZo3I7nHZg2PooAiDfryNmcKlW2HfMZXgw8+XoQfClZ5QyA0tQjqauAbLLUM+uhjeT7wh3yxJ3np79YQLw5XIWbaOF2G8nPHCjQK4i3jFXVswAksPoK5KURFj7IBjiNspOWQSIDgxgRnSzFLwGZWVVF0fVQBAQJmdzHlm+cTfm/DjyHpm0dCrIMBOnhwRhc3lJrn7SVGlcEsgw6gPmF3e5T3Z4X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QSUc8WgRnHo3dwz6/hHy1G4rCJpPar9ywQprTxyvtaM4xhRR8Kz5HRDrOvR2R4IW6gHAbNQ0NcmWT8+y0JKnDArAZEf61tl2bcH7CDysNR0m5NMsqB3gfVSvYI1T7KDVdsQhMaA/8auDQHOYvpy+5xDxGMx+b9wkH9wsh+lFWc=;7:2Jvcieyf5kJ2/GQg8GEE1NW6syE6RPMjZ2AleEpQW6+5hFahql1RF9l2/Raic6J04qvHrR9bzPVh7NrLNOLAoQRuVugxzsI/dEqY/H80bentGiLlcOIMSHYiCfzJhPyww+RJDXe2GwptDkU3bjSVsKIZi0hQdfVeAtdYhBwqId7zpbCCd0UFYENoNu/rMLv+bzwnph8n87HIuV3ddjroP4iv6Hwp8bW7J+gv6CzpsdxmNxW0prrGQquydbW4eiyS SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 21:19:32.7141 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c8c09a9-eb03-41a0-a71b-08d612ac1bcd X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB4395 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 SysFS support to control zio6 interrupt threshold. Using this SysFS hook user can set when to generate intrrupts. This value will be used to tell firmware to generate interrupt at a cetratin interval. If the number of exchanges/commands fall below defiened setting, then the interrupt will be generated immediately by the firmware. By default ZIO6 will coalesce interrupts to a specified interval regardless of low traffic or high traffic. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_attr.c | 32 +++++++++++++++++++++++++++++ drivers/scsi/qla2xxx/qla_def.h | 7 ++++++- drivers/scsi/qla2xxx/qla_init.c | 5 +++++ drivers/scsi/qla2xxx/qla_mbx.c | 1 + drivers/scsi/qla2xxx/qla_os.c | 42 ++++++++++++++++++++++++++++++--------- drivers/scsi/qla2xxx/qla_target.c | 17 ---------------- 6 files changed, 77 insertions(+), 27 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 14c496bab280..e1ae880d5b68 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -1208,6 +1208,34 @@ qla2x00_zio_timer_store(struct device *dev, struct device_attribute *attr, } static ssize_t +qla_zio_threshold_show(struct device *dev, struct device_attribute *attr, + char *buf) +{ + scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); + + return scnprintf(buf, PAGE_SIZE, "%d exchanges\n", + vha->hw->last_zio_threshold); +} + +static ssize_t +qla_zio_threshold_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) +{ + scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); + int val = 0; + + if (vha->hw->zio_mode != QLA_ZIO_MODE_6) + return -EINVAL; + if (sscanf(buf, "%d", &val) != 1) + return -EINVAL; + if (val > 256) + return -ERANGE; + + atomic_set(&vha->hw->zio_threshold, val); + return strlen(buf); +} + +static ssize_t qla2x00_beacon_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -1651,6 +1679,9 @@ static DEVICE_ATTR(allow_cna_fw_dump, S_IRUGO | S_IWUSR, static DEVICE_ATTR(pep_version, S_IRUGO, qla2x00_pep_version_show, NULL); static DEVICE_ATTR(min_link_speed, S_IRUGO, qla2x00_min_link_speed_show, NULL); static DEVICE_ATTR(max_speed_sup, S_IRUGO, qla2x00_max_speed_sup_show, NULL); +static DEVICE_ATTR(zio_threshold, 0644, + qla_zio_threshold_show, + qla_zio_threshold_store); struct device_attribute *qla2x00_host_attrs[] = { &dev_attr_driver_version, @@ -1687,6 +1718,7 @@ struct device_attribute *qla2x00_host_attrs[] = { &dev_attr_pep_version, &dev_attr_min_link_speed, &dev_attr_max_speed_sup, + &dev_attr_zio_threshold, NULL, }; diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 8cbfbeb0751c..3a03fe217ac2 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -4190,6 +4190,10 @@ struct qla_hw_data { atomic_t nvme_active_aen_cnt; uint16_t nvme_last_rptd_aen; /* Last recorded aen count */ + + atomic_t zio_threshold; + uint16_t last_zio_threshold; +#define DEFAULT_ZIO_THRESHOLD 64 }; #define FW_ABILITY_MAX_SPEED_MASK 0xFUL @@ -4269,10 +4273,11 @@ typedef struct scsi_qla_host { #define FX00_CRITEMP_RECOVERY 25 #define FX00_HOST_INFO_RESEND 26 #define QPAIR_ONLINE_CHECK_NEEDED 27 -#define SET_ZIO_THRESHOLD_NEEDED 28 +#define SET_NVME_ZIO_THRESHOLD_NEEDED 28 #define DETECT_SFP_CHANGE 29 #define N2N_LOGIN_NEEDED 30 #define IOCB_WORK_ACTIVE 31 +#define SET_ZIO_THRESHOLD_NEEDED 32 unsigned long pci_flags; #define PFLG_DISCONNECTED 0 /* PCI device removed */ diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index c3c7ab6fe6e1..fbbf530a38e0 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -3532,6 +3532,11 @@ qla2x00_setup_chip(scsi_qla_host_t *vha) if (rval == QLA_SUCCESS) { qla24xx_detect_sfp(vha); + if ((IS_QLA83XX(ha) || IS_QLA27XX(ha)) && + (ha->zio_mode == QLA_ZIO_MODE_6)) + qla27xx_set_zio_threshold(vha, + ha->last_zio_threshold); + rval = qla2x00_set_exlogins_buffer(vha); if (rval != QLA_SUCCESS) goto failed; diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 9d5e320fc1bc..3213017658a6 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -60,6 +60,7 @@ static struct rom_cmd { { MBC_GET_ADAPTER_LOOP_ID }, { MBC_READ_SFP }, { MBC_GET_RNID_PARAMS }, + { MBC_GET_SET_ZIO_THRESHOLD }, }; static int is_rom_cmd(uint16_t cmd) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index d0d5e332bafc..6fa321a4229d 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -2840,6 +2840,8 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) atomic_set(&ha->num_pend_mbx_stage1, 0); atomic_set(&ha->num_pend_mbx_stage2, 0); atomic_set(&ha->num_pend_mbx_stage3, 0); + atomic_set(&ha->zio_threshold, DEFAULT_ZIO_THRESHOLD); + ha->last_zio_threshold = DEFAULT_ZIO_THRESHOLD; /* Assign ISP specific operations. */ if (IS_QLA2100(ha)) { @@ -6224,17 +6226,28 @@ qla2x00_do_dpc(void *data) mutex_unlock(&ha->mq_lock); } - if (test_and_clear_bit(SET_ZIO_THRESHOLD_NEEDED, &base_vha->dpc_flags)) { + if (test_and_clear_bit(SET_NVME_ZIO_THRESHOLD_NEEDED, + &base_vha->dpc_flags)) { ql_log(ql_log_info, base_vha, 0xffffff, "nvme: SET ZIO Activity exchange threshold to %d.\n", ha->nvme_last_rptd_aen); - if (qla27xx_set_zio_threshold(base_vha, ha->nvme_last_rptd_aen)) { + if (qla27xx_set_zio_threshold(base_vha, + ha->nvme_last_rptd_aen)) { ql_log(ql_log_info, base_vha, 0xffffff, - "nvme: Unable to SET ZIO Activity exchange threshold to %d.\n", - ha->nvme_last_rptd_aen); + "nvme: Unable to SET ZIO Activity exchange threshold to %d.\n", + ha->nvme_last_rptd_aen); } } + if (test_and_clear_bit(SET_ZIO_THRESHOLD_NEEDED, + &base_vha->dpc_flags)) { + ql_log(ql_log_info, base_vha, 0xffffff, + "SET ZIO Activity exchange threshold to %d.\n", + ha->last_zio_threshold); + qla27xx_set_zio_threshold(base_vha, + ha->last_zio_threshold); + } + if (!IS_QLAFX00(ha)) qla2x00_do_dpc_all_vps(base_vha); @@ -6447,13 +6460,24 @@ qla2x00_timer(struct timer_list *t) * FC-NVME * see if the active AEN count has changed from what was last reported. */ - if (!vha->vp_idx && - atomic_read(&ha->nvme_active_aen_cnt) != ha->nvme_last_rptd_aen && - ha->zio_mode == QLA_ZIO_MODE_6) { + if (!vha->vp_idx && (atomic_read(&ha->nvme_active_aen_cnt) != + ha->nvme_last_rptd_aen) && ha->zio_mode == QLA_ZIO_MODE_6) { ql_log(ql_log_info, vha, 0x3002, - "nvme: Sched: Set ZIO exchange threshold to %d.\n", - ha->nvme_last_rptd_aen); + "nvme: Sched: Set ZIO exchange threshold to %d.\n", + ha->nvme_last_rptd_aen); ha->nvme_last_rptd_aen = atomic_read(&ha->nvme_active_aen_cnt); + set_bit(SET_NVME_ZIO_THRESHOLD_NEEDED, &vha->dpc_flags); + start_dpc++; + } + + if (!vha->vp_idx && + (atomic_read(&ha->zio_threshold) != ha->last_zio_threshold) && + (ha->zio_mode == QLA_ZIO_MODE_6) && + (IS_QLA83XX(ha) || IS_QLA27XX(ha))) { + ql_log(ql_log_info, vha, 0x3002, + "Sched: Set ZIO exchange threshold to %d.\n", + ha->last_zio_threshold); + ha->last_zio_threshold = atomic_read(&ha->zio_threshold); set_bit(SET_ZIO_THRESHOLD_NEEDED, &vha->dpc_flags); start_dpc++; } diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index c2076758a4b6..79c290fc36dd 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -7052,14 +7052,6 @@ qlt_24xx_config_nvram_stage2(struct scsi_qla_host *vha, memcpy(icb->node_name, ha->tgt.tgt_node_name, WWN_SIZE); icb->firmware_options_1 |= cpu_to_le32(BIT_14); } - - /* disable ZIO at start time. */ - if (!vha->flags.init_done) { - uint32_t tmp; - tmp = le32_to_cpu(icb->firmware_options_2); - tmp &= ~(BIT_3 | BIT_2 | BIT_1 | BIT_0); - icb->firmware_options_2 = cpu_to_le32(tmp); - } } void @@ -7163,15 +7155,6 @@ qlt_81xx_config_nvram_stage2(struct scsi_qla_host *vha, memcpy(icb->node_name, ha->tgt.tgt_node_name, WWN_SIZE); icb->firmware_options_1 |= cpu_to_le32(BIT_14); } - - /* disable ZIO at start time. */ - if (!vha->flags.init_done) { - uint32_t tmp; - tmp = le32_to_cpu(icb->firmware_options_2); - tmp &= ~(BIT_3 | BIT_2 | BIT_1 | BIT_0); - icb->firmware_options_2 = cpu_to_le32(tmp); - } - } void From patchwork Tue Sep 4 21:19:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10587987 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 2B37F920 for ; Tue, 4 Sep 2018 21:19:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AE7D28F76 for ; Tue, 4 Sep 2018 21:19:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F0542A127; Tue, 4 Sep 2018 21:19:39 +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,DKIM_SIGNED, DKIM_VALID,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 6149A28F76 for ; Tue, 4 Sep 2018 21:19:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727320AbeIEBqc (ORCPT ); Tue, 4 Sep 2018 21:46:32 -0400 Received: from mail-dm3nam03on0050.outbound.protection.outlook.com ([104.47.41.50]:21561 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727361AbeIEBqb (ORCPT ); Tue, 4 Sep 2018 21:46:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zd6QmUk6mB2BojEHKhz4Nz9zCnLKFvrdnFzIbyffjA8=; b=gz4aTzebfBAeEJ2eGt2blsap3zqwZ45Kw+Td57t0Uf8yESSE1VstoLPF37RRQyQiIA6lTZjd3W/zBYea6UogMQbXcuWQjcGpJ/9XgWTuSpU+Cxl1Cp2rpF6146pHMGJJfgSlk/CcOnizQqCaJ+lUzDlQXKCnxlhpsbMOt0iuxvk= Received: from DM5PR07CA0077.namprd07.prod.outlook.com (2603:10b6:4:ad::42) by SN6PR07MB4397.namprd07.prod.outlook.com (2603:10b6:805:58::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.18; Tue, 4 Sep 2018 21:19:33 +0000 Received: from CO1NAM05FT006.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::200) by DM5PR07CA0077.outlook.office365.com (2603:10b6:4:ad::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.16 via Frontend Transport; Tue, 4 Sep 2018 21:19:33 +0000 Authentication-Results: spf=pass (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by CO1NAM05FT006.mail.protection.outlook.com (10.152.96.111) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1143.1 via Frontend Transport; Tue, 4 Sep 2018 21:19:32 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 4 Sep 2018 14:19:21 -0700 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 w84LJMR6031990; Tue, 4 Sep 2018 14:19:22 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w84LJMKB031989; Tue, 4 Sep 2018 14:19:22 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 07/13] qla2xxx: Move {get|rel}_sp to base_qpair struct Date: Tue, 4 Sep 2018 14:19:15 -0700 Message-ID: <20180904211921.31927-8-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180904211921.31927-1-himanshu.madhani@cavium.com> References: <20180904211921.31927-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(376002)(136003)(346002)(39860400002)(396003)(2980300002)(438002)(189003)(199004)(6666003)(336012)(2616005)(476003)(8676002)(5660300001)(51416003)(110136005)(87636003)(76176011)(54906003)(106002)(86362001)(11346002)(126002)(2906002)(186003)(446003)(1076002)(69596002)(356003)(36756003)(80596001)(4326008)(486006)(305945005)(81166006)(81156014)(44832011)(50226002)(47776003)(106466001)(14444005)(72206003)(50466002)(478600001)(316002)(26005)(42186006)(16586007)(8936002)(48376002);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR07MB4397;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT006;1:fHZRAvOkHGDH4h5nsOzdzO959Qbcu9OkEY9YGhLMuwMbppDmD6d1alraV9xIjpsr+Gh+cOoWV/3edYZa1iOLNeqByu29j3GRjD1UWwd+WnuHYfePWq1Zjdd9O1YyObki X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 14269aa9-5fef-4de1-cbf7-08d612ac1be1 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:SN6PR07MB4397; X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4397;3:WtX6zMV/GD76cXWqRHqHjSKc//ChZ7jPXKH+KwEEPM697637+qGWepR1FcDrS3QB6K/XfQ+WaQ9qjOCyvg+WxO48jXZSmYvZvfIfFWQyP9+8n1cBpwAtGn8M6Px5BTZd4guNnfbSMDs0mrAJbcKMY8LBky5CJUWe6REM0G5ooVEtLh9QiC98pz9+1skMycTD++3hsNbeF7B2kCaf4TWzdpMYrmtHCGOuXldjOnYks1JpAGZZBQUqePuss3q+nfPElprrBPdY+pFv38CfA4HocOhBVn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1V0Pbj1Zmr9DpUPWKyO9LK+RzxT2oMmsUR371pz+ioJ9V/hQq8ABIaN9NUWMqkRaLr/s5PfIEHBLh1Fa5CKP0Fijfp755tmMRx7vGfLxfiI8mYImHnhL3Iuq+/f8yfQdBgzBHrAPetDCYEN3UO5Cu6m4SVBD+4uEr+4nHOYF+7WySbV5uWU+/gF2y X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93004095)(3231311)(944501410)(52105095)(10201501046)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:SN6PR07MB4397;BCL:0;PCL:0;RULEID:;SRVR:SN6PR07MB4397; X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4397;4:go2SC9s2j3iZUQ4fq3jN8COirdDsxsix1FA0TnvcJmRpa7nT03yL2SOLaM5Vx6EDG2HDvyxFWbJmFvl9PfETUPD3743PDR0jnyTn3TsJ01aEFJarg0riJ4LinXEnnWtfGV75fY7j7jS9LrJZ0QnUdYBy5pYlMFbbRi0ImSyXySQphqaxEt5lK0C2tQ4XEEt5/KYhESYLlzrjiinQTwarMSZ/h2WsX72o+R/QDr/QHQrOrynG8eJ98pOdrhLl3xj0B+mg0/mVK5xy5bPJzzT4Bw== X-Forefront-PRVS: 0785459C39 X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4397;23:pVWFKhXPILmM+TQCRdydz964JLEhCKuqa0e+SFGHaICaPoMW3vnpdVamdwEqYHD4qI5kbdCu9eR0Q4b44gjUR40FPrUTzNWzZd8bdtgTK1HxCb5KvjdcnI7zXghhuSTnsA9mE6i8VzusT8YN2pAxiGyKyLMSiXB+1quks1xdm3diT+6qon2oDfDbn6q1d7Gp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PG0Qxc8agNkC9hfM4nkRjhQH7U0u8zFzFCWkT1Pd7OHagp5g+by11F2Lwq4k0xzyDCIif+bpGjdkZOj8gYKqDJ7ZOSc3xiFUtQtkj8rkxPMngrpy41sXy8URHkjJd7odh SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 21:19:32.8461 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 14269aa9-5fef-4de1-cbf7-08d612ac1be1 X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4397 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 Currently, qla2x00_[get_sp|rel_sp] routines does {get|release} of srb resource/srb_mempool directly from qla_hw_data. qla2x00_start_sp() is used to issue management commands thorugh the default Request Q 0 & Response Q 0 or base_qpair. This patch moves access of these resources through base_qpair. Instead of having knowledge of specific Q number and lock to rsp/req queue, this change will key off the qpair that is assigned to the srb resource. This lays the ground work for other routines to see this resource through the qpair. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_gs.c | 1 - drivers/scsi/qla2xxx/qla_init.c | 3 ++- drivers/scsi/qla2xxx/qla_inline.h | 17 +++++++++-------- drivers/scsi/qla2xxx/qla_iocb.c | 9 +++++---- drivers/scsi/qla2xxx/qla_nvme.c | 2 +- drivers/scsi/qla2xxx/qla_os.c | 3 ++- 6 files changed, 19 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 902106f97020..385c46f2576e 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -4157,7 +4157,6 @@ static void qla2x00_async_gpnft_gnnft_sp_done(void *s, int res) if (rc) { /* Cleanup here to prevent memory leak */ qla24xx_sp_unmap(vha, sp); - sp->free(sp); } spin_lock_irqsave(&vha->work_lock, flags); diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index fbbf530a38e0..49c8f0119620 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1761,7 +1761,8 @@ qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait) srb_t *sp; int rval = QLA_FUNCTION_FAILED; - sp = qla2xxx_get_qpair_sp(cmd_sp->qpair, cmd_sp->fcport, GFP_KERNEL); + sp = qla2xxx_get_qpair_sp(cmd_sp->vha, cmd_sp->qpair, cmd_sp->fcport, + GFP_KERNEL); if (!sp) goto done; diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h index 4351736b2426..bf9a6f01fd9f 100644 --- a/drivers/scsi/qla2xxx/qla_inline.h +++ b/drivers/scsi/qla2xxx/qla_inline.h @@ -209,7 +209,8 @@ qla2x00_chip_is_down(scsi_qla_host_t *vha) } static inline srb_t * -qla2xxx_get_qpair_sp(struct qla_qpair *qpair, fc_port_t *fcport, gfp_t flag) +qla2xxx_get_qpair_sp(scsi_qla_host_t *vha, struct qla_qpair *qpair, + fc_port_t *fcport, gfp_t flag) { srb_t *sp = NULL; uint8_t bail; @@ -225,7 +226,9 @@ qla2xxx_get_qpair_sp(struct qla_qpair *qpair, fc_port_t *fcport, gfp_t flag) memset(sp, 0, sizeof(*sp)); sp->fcport = fcport; sp->iocbs = 1; - sp->vha = qpair->vha; + sp->vha = vha; + sp->qpair = qpair; + sp->cmd_type = TYPE_SRB; INIT_LIST_HEAD(&sp->elem); done: @@ -246,19 +249,17 @@ qla2x00_get_sp(scsi_qla_host_t *vha, fc_port_t *fcport, gfp_t flag) { srb_t *sp = NULL; uint8_t bail; + struct qla_qpair *qpair; QLA_VHA_MARK_BUSY(vha, bail); if (unlikely(bail)) return NULL; - sp = mempool_alloc(vha->hw->srb_mempool, flag); + qpair = vha->hw->base_qpair; + sp = qla2xxx_get_qpair_sp(vha, qpair, fcport, flag); if (!sp) goto done; - memset(sp, 0, sizeof(*sp)); - sp->fcport = fcport; - sp->cmd_type = TYPE_SRB; - sp->iocbs = 1; sp->vha = vha; done: if (!sp) @@ -270,7 +271,7 @@ static inline void qla2x00_rel_sp(srb_t *sp) { QLA_VHA_MARK_NOT_BUSY(sp->vha); - mempool_free(sp, sp->vha->hw->srb_mempool); + qla2xxx_rel_qpair_sp(sp->qpair, sp); } static inline void diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index c699bbb8485b..6335b8ce5fbd 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -3440,12 +3440,13 @@ qla2x00_start_sp(srb_t *sp) int rval; scsi_qla_host_t *vha = sp->vha; struct qla_hw_data *ha = vha->hw; + struct qla_qpair *qp = sp->qpair; void *pkt; unsigned long flags; rval = QLA_FUNCTION_FAILED; - spin_lock_irqsave(&ha->hardware_lock, flags); - pkt = qla2x00_alloc_iocbs(vha, sp); + spin_lock_irqsave(qp->qp_lock_ptr, flags); + pkt = __qla2x00_alloc_iocbs(sp->qpair, sp); if (!pkt) { ql_log(ql_log_warn, vha, 0x700c, "qla2x00_alloc_iocbs failed.\n"); @@ -3523,9 +3524,9 @@ qla2x00_start_sp(srb_t *sp) } wmb(); - qla2x00_start_iocbs(vha, ha->req_q_map[0]); + qla2x00_start_iocbs(vha, qp->req); done: - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(qp->qp_lock_ptr, flags); return rval; } diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index 8dc7a5c64800..ad923965be3c 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -506,7 +506,7 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport, return -EBUSY; /* Alloc SRB structure */ - sp = qla2xxx_get_qpair_sp(qpair, fcport, GFP_ATOMIC); + sp = qla2xxx_get_qpair_sp(vha, qpair, fcport, GFP_ATOMIC); if (!sp) return -EBUSY; diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 6fa321a4229d..210e5c2999f4 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -398,6 +398,7 @@ static void qla_init_base_qpair(struct scsi_qla_host *vha, struct req_que *req, ha->base_qpair->qp_lock_ptr = &ha->hardware_lock; ha->base_qpair->use_shadow_reg = IS_SHADOW_REG_CAPABLE(ha) ? 1 : 0; ha->base_qpair->msix = &ha->msix_entries[QLA_MSIX_RSP_Q]; + ha->base_qpair->srb_mempool = ha->srb_mempool; INIT_LIST_HEAD(&ha->base_qpair->hints_list); ha->base_qpair->enable_class_2 = ql2xenableclass2; /* init qpair to this cpu. Will adjust at run time. */ @@ -1013,7 +1014,7 @@ qla2xxx_mqueuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd, else goto qc24_target_busy; - sp = qla2xxx_get_qpair_sp(qpair, fcport, GFP_ATOMIC); + sp = qla2xxx_get_qpair_sp(vha, qpair, fcport, GFP_ATOMIC); if (!sp) goto qc24_host_busy; From patchwork Tue Sep 4 21:19:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10587989 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 6756B14E0 for ; Tue, 4 Sep 2018 21:19:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5675628F76 for ; Tue, 4 Sep 2018 21:19:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4ABCB2A127; Tue, 4 Sep 2018 21:19:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 8AAC928F76 for ; Tue, 4 Sep 2018 21:19:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727447AbeIEBqd (ORCPT ); Tue, 4 Sep 2018 21:46:33 -0400 Received: from mail-sn1nam01on0061.outbound.protection.outlook.com ([104.47.32.61]:25376 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726869AbeIEBqc (ORCPT ); Tue, 4 Sep 2018 21:46:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6njvopa9PxyH0aQT2fkjhjiVRUwv/fqJiVpYrzdcClE=; b=FFQ8yED3XdB86xqn8aTLC1ebj+2Rjg0y/445BZnARP1GTlF4VGhpIx7V+R9djo8AQ1ygMxVvP6LaF78YonaUaQUO432nNbQAZSGtfl4AVZSZwnHrqnHQn1ELQ2R96j2i+PxeUeXxMxzMUfDCcORiza4pjXsoaXc9L0yoNFspN0o= Received: from DM5PR07CA0077.namprd07.prod.outlook.com (2603:10b6:4:ad::42) by DM6PR07MB5499.namprd07.prod.outlook.com (2603:10b6:5:30::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.18; Tue, 4 Sep 2018 21:19:34 +0000 Received: from CO1NAM05FT006.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::200) by DM5PR07CA0077.outlook.office365.com (2603:10b6:4:ad::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.16 via Frontend Transport; Tue, 4 Sep 2018 21:19:34 +0000 Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by CO1NAM05FT006.mail.protection.outlook.com (10.152.96.111) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1143.1 via Frontend Transport; Tue, 4 Sep 2018 21:19:33 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 4 Sep 2018 14:19:21 -0700 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 w84LJMev031994; Tue, 4 Sep 2018 14:19:22 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w84LJM0E031993; Tue, 4 Sep 2018 14:19:22 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 08/13] qla2xxx: Reduce holding sess_lock to prevent CPU lock-up Date: Tue, 4 Sep 2018 14:19:16 -0700 Message-ID: <20180904211921.31927-9-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180904211921.31927-1-himanshu.madhani@cavium.com> References: <20180904211921.31927-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(396003)(136003)(39860400002)(376002)(346002)(2980300002)(438002)(199004)(189003)(186003)(305945005)(106002)(42186006)(316002)(16586007)(54906003)(110136005)(50466002)(76176011)(2906002)(8676002)(6346003)(48376002)(1076002)(356003)(51416003)(26005)(86362001)(14444005)(478600001)(5660300001)(72206003)(8936002)(81156014)(106466001)(81166006)(50226002)(87636003)(6666003)(44832011)(47776003)(80596001)(486006)(336012)(4326008)(69596002)(446003)(36756003)(476003)(2616005)(126002)(11346002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR07MB5499;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT006;1:VXaEu5netEBfId5v2pyUf97o/ReffgognjkkSOXyQZ2AW8M3vyX2YMdH9l0YI0hkSvW+zhrBTpIt18PSmAi8h8BPFTgRA0aBX40WCrfjQmWGFVGDJjQjjUA4ggwYcABh X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5bf3f22e-818f-4fe4-5062-08d612ac1c67 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM6PR07MB5499; X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB5499;3:8xzA/AJp34N18gTY0veFsDWMriHO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kZ7ohm/G3s0Z17eEpDoNkNjzOVEpx98eTw4xHIaxwv2hbeveN6hIPzm2wfiBDvG6UZcnjGHWffJp1of+ZERJUsT7TtdoXG8NV5/WXpC3jdSs1OceWRvL9AyAo5bXig7f4GVhX//HspRD7n5XZjx0qQFxH8w1LLP27sPzI/m3UxjrHXcPqNlVnKj/bqhaIsbLSZdzZnDCwOnl6XjnBFGOcwe4B8fTjecD27s6A4vvespTO9cLnErULbX7Z4weNDAsrXD+rsc7YrHxNJbQQRewDmKP+bUqsdq31Opq+yESWGQRTXdo4uI86OF3LTmm7vCweJGXozFqPsJnJnv2OcdrLQ2UlBdq2PjMQ6PHawfFMmpCdiZPcPRZXPthydTMcycfXqZRfcNERMCp4kmEpICvUkYvoE1eDC3howxmqvPrDEO9Jz X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93004095)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:DM6PR07MB5499;BCL:0;PCL:0;RULEID:;SRVR:DM6PR07MB5499; X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB5499;4:zirW1g/SStGpAodw7aUNqGYN7oklpqxYHu30GiwxkT40Aro/IWMebKoU/NnhCgEzExJFe5h8P0IkbsoGY5cHTAJJw9WYJcCMDdhkSztTU+NzDuM9Bu2jxg3Y9e5y2vVCvitWBQS41faYEjwsWf0zZPpAvC5tMO6HXuswmlv6ID08o0rFF9GHCShE/CU7j8MX5UqAmuBvwTNabp5EOFuRytHqxzkaVtbAVLdMPpX5sDi5VfjM9pc6zY3PZrfQ5K2nGDaD80Y/OeyhXg/k7FbkIA== X-Forefront-PRVS: 0785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ETMLRan09M++KICB6Kz1Y7UlZPUEpufFPV23i6puQWqp9y/paeD5spdWzu09hAxlOmjk62AS/oOghgqVSqvrxoUAkyDi34fzEEw/W1c17IQtfkeO3ckZULfmVnKM7Hz/ X-Microsoft-Antispam-Message-Info: SwQQUV608Yiub8p4kCqz9B4NhCmNpLE15d06HZyyj+bhvGr11gMxjaQJU0sVffWVN53JXsfoSQEFKuDEC85sNvnW4xtYFXtQUEKl0Kx3XKe7On4weGwKianMqahUgBg1elw0AFjH3/yNbl7Vy6zzP94pvivxmk/9m6CIj8J5g9BDPo7KwYhk9J6zKn8DMXdDXsuupvTKvEgfOVUTRzB2BPi3ndHYhZpRqEqN6zcJjOvpcLV6F7Tx3FBJtG9TBulwzMmSEzutOsLGPMHcs4N6S8V+3HVczgjfQirgb387WImGLZNf4FsnraESdTLMW7IqWTQlh/7J9h/dndKTGkjv5qb+RzGrKBLbKRjDwivcuBU= X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB5499;6:nXE75Dxx7W6gGoORQuHGiUnidczvIEYHewX09NqReE1eQJJ8eW+jdfpcN+q6bT1tHsWnhkoSVLVlWiIbA5lXzXoRJpojKL0P8jfyc48uPPxb8UA6P8I8POsyvTDie3okvQAK4whrPpRau+3RaJ5hEOY11eTJ1IIktYxpPod0K5H0pjHCI/US9zIv9BCUhOd0etzjC34AdixTYLgoKB54A6a7VOI6pMI/X6phCVKY/qt/C2UVAsSULikT4n1K3ScnqIYlR9Y/fj4IAWkb/UqTlWVe+fDu6SbVqNTJbWnTvOZw8dg5ysWFoEIZZWzuHC8gkhmJqCWRwMidolOInkNOavj2TmPd81DXe/8JQWxvl43B2ZWQsXQWTapSagDtCM9wVUTC2VHRBiP7C5Jnmcko278kFjp7bOLTUsHghmtBc7lfOmqCqI+T1FYwIOtxbqOT/Wt2D6+lrjiD3mLc8IF4YA==;5:niAHm9vmZCnoP+6Rdje55LftgMFui1VH4m1V7/rFMdfXSmW6HfAPS0vogGjJhKxXBbJLcmLDiz0PIH54f+ENsaCHjRSnBumzeQw21Px3htSsad6Q3YszdTDZnEIvVm03Rk0/XIPIbhl3Sm5ppHCgcJYkJJWkap2xP1UtxJLQdos=;7:RkQqw1Ugt+p29QVJCG5fk+Qzd02v9sZzfIyaJABSn8HTBftZ95UCF3EYr38HhYUWXWRjMv1ec7POioCLF+yTy1Xw9ZJdR7QxkuDNoCIWvwUU4xpWpUF3TjNesxJJP0zzdeEAljSvglAIrqhAR6iSVf/2nqe+8j5A6cKNqJNEUUKE1O+a9HeAkeCNvShZVdzoafdkYOB0bzUNYO72tCZ+f9H7Q3Rnx+glYt115cuAd7FakhM8l09HhW4saSNxcW3J SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 21:19:33.7055 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5bf3f22e-818f-4fe4-5062-08d612ac1c67 X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB5499 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 - Reduce sess_lock holding to prevent CPU Lock up. sess_lock was held across fc_port registration and deletion. These calls can be blocked by upper layer. Sess_lock is also being accessed by interrupt thread. - reduce number of loops in processing work_list to prevent kernel complain of CPU lockup or holding sess_lock. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 2 +- drivers/scsi/qla2xxx/qla_gs.c | 18 ++++++++++++------ drivers/scsi/qla2xxx/qla_init.c | 33 +++++++++++++++++---------------- drivers/scsi/qla2xxx/qla_os.c | 3 +-- drivers/scsi/qla2xxx/qla_target.c | 2 ++ 5 files changed, 33 insertions(+), 25 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 3a03fe217ac2..8b8c7c8db1ca 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -262,8 +262,8 @@ struct name_list_extended { struct get_name_list_extended *l; dma_addr_t ldma; struct list_head fcports; - spinlock_t fcports_lock; u32 size; + u8 sent; }; /* * Timeout timer counts in seconds diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 385c46f2576e..3c8882a3e6bc 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -3946,11 +3946,10 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp) if ((qla_dual_mode_enabled(vha) || qla_ini_mode_enabled(vha)) && atomic_read(&fcport->state) == FCS_ONLINE) { - qla2x00_mark_device_lost(vha, fcport, - ql2xplogiabsentdevice, 0); + if (fcport->loop_id != FC_NO_LOOP_ID) { + if (fcport->flags & FCF_FCP2_DEVICE) + fcport->logout_on_delete = 0; - if (fcport->loop_id != FC_NO_LOOP_ID && - (fcport->flags & FCF_FCP2_DEVICE) == 0) { ql_dbg(ql_dbg_disc, vha, 0x20f0, "%s %d %8phC post del sess\n", __func__, __LINE__, @@ -4188,12 +4187,13 @@ static void qla2x00_async_gpnft_gnnft_sp_done(void *s, int res) sp->rc = res; rc = qla2x00_post_nvme_gpnft_done_work(vha, sp, QLA_EVT_GPNFT); - if (!rc) { + if (rc) { qla24xx_sp_unmap(vha, sp); set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); return; } + return; } if (cmd == GPN_FT_CMD) { @@ -4243,6 +4243,8 @@ static int qla24xx_async_gnnft(scsi_qla_host_t *vha, struct srb *sp, vha->scan.scan_flags &= ~SF_SCANNING; spin_unlock_irqrestore(&vha->work_lock, flags); WARN_ON(1); + set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); + set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); goto done_free_sp; } @@ -4276,8 +4278,12 @@ static int qla24xx_async_gnnft(scsi_qla_host_t *vha, struct srb *sp, sp->done = qla2x00_async_gpnft_gnnft_sp_done; rval = qla2x00_start_sp(sp); - if (rval != QLA_SUCCESS) + if (rval != QLA_SUCCESS) { + spin_lock_irqsave(&vha->work_lock, flags); + vha->scan.scan_flags &= ~SF_SCANNING; + spin_unlock_irqrestore(&vha->work_lock, flags); goto done_free_sp; + } ql_dbg(ql_dbg_disc, vha, 0xffff, "Async-%s hdl=%x FC4Type %x.\n", sp->name, diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 49c8f0119620..c675066b080e 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -790,6 +790,7 @@ qla24xx_async_gnl_sp_done(void *s, int res) sp->name, res, sp->u.iocb_cmd.u.mbx.in_mb[1], sp->u.iocb_cmd.u.mbx.in_mb[2]); + sp->fcport->flags &= ~(FCF_ASYNC_SENT|FCF_ASYNC_ACTIVE); memset(&ea, 0, sizeof(ea)); ea.sp = sp; ea.rc = res; @@ -817,25 +818,24 @@ qla24xx_async_gnl_sp_done(void *s, int res) (loop_id & 0x7fff)); } - spin_lock_irqsave(&vha->gnl.fcports_lock, flags); + spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); INIT_LIST_HEAD(&h); fcport = tf = NULL; if (!list_empty(&vha->gnl.fcports)) list_splice_init(&vha->gnl.fcports, &h); + spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); list_for_each_entry_safe(fcport, tf, &h, gnl_entry) { list_del_init(&fcport->gnl_entry); - spin_lock(&vha->hw->tgt.sess_lock); + spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); - spin_unlock(&vha->hw->tgt.sess_lock); + spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); ea.fcport = fcport; qla2x00_fcport_event_handler(vha, &ea); } - spin_unlock_irqrestore(&vha->gnl.fcports_lock, flags); - spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); /* create new fcport if fw has knowledge of new sessions */ for (i = 0; i < n; i++) { port_id_t id; @@ -868,6 +868,8 @@ qla24xx_async_gnl_sp_done(void *s, int res) } } + spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); + vha->gnl.sent = 0; spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); sp->free(sp); @@ -887,27 +889,24 @@ int qla24xx_async_gnl(struct scsi_qla_host *vha, fc_port_t *fcport) ql_dbg(ql_dbg_disc, vha, 0x20d9, "Async-gnlist WWPN %8phC \n", fcport->port_name); - spin_lock_irqsave(&vha->gnl.fcports_lock, flags); - if (!list_empty(&fcport->gnl_entry)) { - spin_unlock_irqrestore(&vha->gnl.fcports_lock, flags); - rval = QLA_SUCCESS; - goto done; - } - - spin_lock(&vha->hw->tgt.sess_lock); + spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); + fcport->flags |= FCF_ASYNC_SENT; fcport->disc_state = DSC_GNL; fcport->last_rscn_gen = fcport->rscn_gen; fcport->last_login_gen = fcport->login_gen; - spin_unlock(&vha->hw->tgt.sess_lock); list_add_tail(&fcport->gnl_entry, &vha->gnl.fcports); - spin_unlock_irqrestore(&vha->gnl.fcports_lock, flags); + if (vha->gnl.sent) { + spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); + return QLA_SUCCESS; + } + vha->gnl.sent = 1; + spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); if (!sp) goto done; - fcport->flags |= FCF_ASYNC_SENT; sp->type = SRB_MB_IOCB; sp->name = "gnlist"; sp->gen1 = fcport->rscn_gen; @@ -1185,7 +1184,9 @@ void __qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) vha->fcport_count++; ea->fcport->login_succ = 1; + spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); qla24xx_sched_upd_fcport(ea->fcport); + spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); } else if (ea->fcport->login_succ) { /* * We have an existing session. A late RSCN delivery diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 210e5c2999f4..b8b7415bc59d 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -2730,7 +2730,7 @@ static void qla2x00_iocb_work_fn(struct work_struct *work) struct scsi_qla_host, iocb_work); struct qla_hw_data *ha = vha->hw; struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); - int i = 20; + int i = 2; unsigned long flags; if (test_bit(UNLOADING, &base_vha->dpc_flags)) @@ -4603,7 +4603,6 @@ struct scsi_qla_host *qla2x00_create_host(struct scsi_host_template *sht, spin_lock_init(&vha->work_lock); spin_lock_init(&vha->cmd_list_lock); - spin_lock_init(&vha->gnl.fcports_lock); init_waitqueue_head(&vha->fcport_waitQ); init_waitqueue_head(&vha->vref_waitq); diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 79c290fc36dd..d5f6ce8c86df 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -601,7 +601,9 @@ void qla2x00_async_nack_sp_done(void *s, int res) sp->fcport->login_succ = 1; vha->fcport_count++; + spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); qla24xx_sched_upd_fcport(sp->fcport); + spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); } else { sp->fcport->login_retry = 0; sp->fcport->disc_state = DSC_LOGIN_COMPLETE; From patchwork Tue Sep 4 21:19:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10587993 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 C88EE920 for ; Tue, 4 Sep 2018 21:19:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5E4428F76 for ; Tue, 4 Sep 2018 21:19:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9CBA2A128; Tue, 4 Sep 2018 21:19:41 +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,DKIM_SIGNED, DKIM_VALID,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 7846228F76 for ; Tue, 4 Sep 2018 21:19:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727450AbeIEBqe (ORCPT ); Tue, 4 Sep 2018 21:46:34 -0400 Received: from mail-co1nam03on0083.outbound.protection.outlook.com ([104.47.40.83]:15168 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727195AbeIEBqd (ORCPT ); Tue, 4 Sep 2018 21:46:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g+KGsyQy9pKBfDXYjNSzAJIuq7fm+g3ONlwHpVTSWts=; b=EP9WIlCt/hmIWeFnfkJHprr0xiheDCC0E+bT2tNIJ1PdaSyJb3C9lYtGCM6a6iW+nolvu+BeCzp5tuM1fN2/VxDXAegepc+D3T9KkNlQuOdwtKSC5dBnrNCn3195T8kWuBEDf0NJHkqdCCA0hYqbsXcChYcjOD52+JhMYy7sYi0= Received: from DM5PR07CA0082.namprd07.prod.outlook.com (2603:10b6:4:ad::47) by SN6PR07MB4399.namprd07.prod.outlook.com (2603:10b6:805:58::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.18; Tue, 4 Sep 2018 21:19:35 +0000 Received: from CO1NAM05FT006.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::209) by DM5PR07CA0082.outlook.office365.com (2603:10b6:4:ad::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.16 via Frontend Transport; Tue, 4 Sep 2018 21:19:34 +0000 Authentication-Results: spf=pass (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by CO1NAM05FT006.mail.protection.outlook.com (10.152.96.111) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1143.1 via Frontend Transport; Tue, 4 Sep 2018 21:19:34 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 4 Sep 2018 14:19:21 -0700 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 w84LJNQc031998; Tue, 4 Sep 2018 14:19:23 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w84LJNJp031997; Tue, 4 Sep 2018 14:19:23 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 09/13] qla2xxx: Remove ASYNC GIDPN switch command Date: Tue, 4 Sep 2018 14:19:17 -0700 Message-ID: <20180904211921.31927-10-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180904211921.31927-1-himanshu.madhani@cavium.com> References: <20180904211921.31927-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39850400004)(346002)(396003)(136003)(376002)(2980300002)(438002)(189003)(199004)(2906002)(48376002)(14444005)(76176011)(186003)(4326008)(36756003)(51416003)(26005)(6666003)(217873002)(47776003)(8676002)(356003)(50466002)(1076002)(5660300001)(476003)(126002)(486006)(50226002)(305945005)(72206003)(11346002)(446003)(2616005)(87636003)(44832011)(478600001)(86362001)(106002)(42186006)(316002)(110136005)(54906003)(106466001)(69596002)(16586007)(81156014)(336012)(8936002)(80596001)(81166006);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR07MB4399;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT006;1:JQTnWubKFFkcoVUyTUcd6aK1bMCdadP+FiBNpZHJ5tOGMWiFS8vuqXB8K1SHLhjSkMK0cRdRPtr/wKk+9l14frKq4yG1XauWdSDUTGySE5cLax9jkc8HOJWoIrsophfU X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a98a74fb-6f24-45a3-fd14-08d612ac1cd4 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:SN6PR07MB4399; X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4399;3:Jv5cQBs20nfiikYFaueYELDUAwi2apyTrwnB3OOynZYTpI/+FzpIICmMGjvw+pgVt5Yxls3vlDRBvnxn+L0CLPXb3w2gTz9u5Nld37odR2kfJ26xN7IVof0adr2Jvnms4ONugO72P8+og+bOM4GsIcSd8pfsPcNuglKl/RFJ4cMhHZ0YbxtVyRIw8s0Ds/ZxSjmbX3fn8gszm9+OjJBmjrml9mkIH6JwJQuaqrDIEC77NQ4lzhtqIxkq5oXt+sdsk+Be/ssNXWh9FeZzOeAs7tJPRDBWJqEZovMZacQ/Ijh/4s3quAwSQTkIDtx9AeAlTQ2ktKJq3o3A/51EpP9NcSO8rA0AbQjlP3H5UOCmdfI=;25:zK68A8bFtoZZSslzpfk0s3BUxHtKTg+DPCq4QTi3ZBq3MkIi/pCWnTwFyJtXHHSHezLNuw3458N3WWq1I2S7rZzZ2gTABdlqPpw20pPGfPMCwhY1IqCLAmgDN7jw6COLdx3a9tmYq/WzATHsFkIv/9Uciy9oXJRppcoin67C4jsZqj7sqF6C2h5WCu5qfi5nZBs2P008XOJixLlv2vDYgpCGHXku4b1fWxPyv5euKN7IkhQzCzzQADBIlK1qnInAQduioSMPHorSRsLzDd6Lu2TN9qXfGskNqLmEZi3fm/QRDOf4LfQWaUdA7eCXoxp2ZSDX1c2ghU8D9kWUq89SPQ== X-MS-TrafficTypeDiagnostic: SN6PR07MB4399: X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4399;31:DaPO7lbF/cCEmCiW8It5kl0yN4ZyjR+2ZrXAR8uooCjXh+jqNBvWuZr2W8epjHWNWB1lhaZSds6qOY2Wf4E0pIOTDpi7KbK0MlpCpRek9UcpcpoSD0L3PY4LqcC2jb3Ipy/9DldiOQdrV9KiOs3VJaq2couehygJ8YQ2lHdxALClmvs7/+xpbhEVtDnCsLvMgogT8/fjuaUbEY4iKpdnI1O6q16qucq5NCbDVsQWO8Y=;20:S9eezzVEikOT4kTjyxDrUgqmuQtGcDkzuVXYLDn6EHHwasaKuDcX5cfFSNFcbmQU63jy6izu9SXvc0PzUtl//tGeNsfud1Edu45gdkC4nOji75n5iSVVYoY32/Uy8aRO7y9GXwEGuh8gq3MRzRKm3E6FH1wTRkPyRlQm9l8dS7L1xP54nrgKfzu4Ao2FMuw90QmvH+qF0p+irhyd0hYNABULv2q7ebmuaB7DksOfHb88lJvLzrWqKSeaXgCLZ9El43Hv7TPAGDKX73XoDyIjN0Nw5FP1l5Syb6kZ46TOqsDcsRdDSrFp+NnlS2FWc3NWFZetH5A0+SHo4sg+aQkx9Rm8k3OPmd+VyqAC4STG/oCwkX4gnoKQF07H6irqDAZ6DnhqWVQquY7v0KyjYj0/eXlqhLADMc872SeSNegqoWRfwD/D+HaQE7QVEw9pC6Qmuc9uMms5KANVqGtw/H0yUNyxPjYFfwCc0n1mipn55acp6vdCLZhp4spw9373siW6 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(209352067349851)(269456686620040)(163750095850); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93004095)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:SN6PR07MB4399;BCL:0;PCL:0;RULEID:;SRVR:SN6PR07MB4399; X-Microsoft-Exchange-Diag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+JnZF8gkbE/lWOubKrtBxNdS2mw2rAfzfmqhm/LA45gxdUoBLIf2y3/XEMrz+qfnFODknwwj+l1xHMkcjZd+KJTHGb2WRUQQy9twL9Ol3L5kn+RNQTVIa9bpItIPDVQsxQNymbeB1oKr93xvgAWm9kyAdacra6RxbFXZLDEEzRK/+C3aAR0E1myweb04mblvubtgB3YNcc18Eaq1FN/CGpIyP3yhu2+R9ykYj71qBAO7WbFn0rRFl6oe8JF7JsxE8PjeiH22jzy11aNQ8wEmryUv7ic+asgyZAF/r80YeHXnN0GvUdTatPGi5iovU1eqPIy13gOik3rgmikmM0jq/Lt4WkpVM1ypqAxJAq4zGVhHQ/hjFul3dvM4ZjAM/UxMQ==;5:1gMwJoS5e75BpJr9VpnK1MGmilEcht95+QWMPFNWU2lRMg9Ihje8LNQ+JlQAnA36JoQt9rwDypOKUs4/AXLWT3LXElH40OE1yxI1mMo94gLyiFEcQOqwox3iNW6Co1dmKDITG58ou0HKebcZmFBKqtUHwg0ln7yjGm2FvZlyhmc=;7:62EpL/SKj15x5daCnJXyCKbbvEbFo/milAKmcA3qj/dlefCbb8mFTrLqUK5u/Ad9KgUdneZrmLKhsjh79Gd/LbUpD6c08+ZGULr0PEVHzExAK4U3Z13GurNLZQAt1CBrslnAA1NUQiBX86NKl2fJELoRWsDnu02QSeN9cfHQ4kU2Ucs8+JiiC5F/MIXsJa+ZiS0ueXFi4i5b3c5FGx3mc/5NeE+RI29f9qexWTijL2wc4C73CNhkxwS3nao+hFhW SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 21:19:34.4399 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a98a74fb-6f24-45a3-fd14-08d612ac1cd4 X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4399 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 Using GPNFT/GNNFT command will be able to cover switch database with less number of scans. This patch removes Get NportID with provided WWPN/GIDPN switch command. By making this change, In large fabric with lots of remote port or NPIV ports with noisy SAN, the number of GIDPN commands issued by a port when it detects large number of remote ports going away or coming back, can overwhelmn the switch and it can becomde unresponsive. In a case where the fabric has not change, GIDPN is not required. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 3 - drivers/scsi/qla2xxx/qla_gbl.h | 5 +- drivers/scsi/qla2xxx/qla_gs.c | 238 +--------------------------------------- drivers/scsi/qla2xxx/qla_init.c | 90 +++++++++++---- drivers/scsi/qla2xxx/qla_os.c | 3 - 5 files changed, 73 insertions(+), 266 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 8b8c7c8db1ca..0a1cae0153b0 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2281,7 +2281,6 @@ struct ct_sns_desc { enum discovery_state { DSC_DELETED, DSC_GNN_ID, - DSC_GID_PN, DSC_GNL, DSC_LOGIN_PEND, DSC_LOGIN_FAILED, @@ -2306,7 +2305,6 @@ enum login_state { /* FW control Target side */ enum fcport_mgt_event { FCME_RELOGIN = 1, FCME_RSCN, - FCME_GIDPN_DONE, FCME_PLOGI_DONE, /* Initiator side sent LLIOCB */ FCME_PRLI_DONE, FCME_GNL_DONE, @@ -3219,7 +3217,6 @@ enum qla_work_type { QLA_EVT_ASYNC_ADISC_DONE, QLA_EVT_UEVENT, QLA_EVT_AENFX, - QLA_EVT_GIDPN, QLA_EVT_GPNID, QLA_EVT_UNMAP, QLA_EVT_NEW_SESS, diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index b8e4abe804d5..db642ea5358f 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -119,6 +119,8 @@ extern int qla2x00_post_async_prlo_done_work(struct scsi_qla_host *, int qla_post_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport); void qla_do_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport); int qla2x00_reserve_mgmt_server_loop_id(scsi_qla_host_t *); +void qla_rscn_replay(fc_port_t *fcport); + /* * Global Data in qla_os.c source file. */ @@ -645,9 +647,6 @@ extern void qla2x00_get_sym_node_name(scsi_qla_host_t *, uint8_t *, size_t); extern int qla2x00_chk_ms_status(scsi_qla_host_t *, ms_iocb_entry_t *, struct ct_sns_rsp *, const char *); extern void qla2x00_async_iocb_timeout(void *data); -extern int qla24xx_async_gidpn(scsi_qla_host_t *, fc_port_t *); -int qla24xx_post_gidpn_work(struct scsi_qla_host *, fc_port_t *); -void qla24xx_handle_gidpn_event(scsi_qla_host_t *, struct event_arg *); extern void qla2x00_free_fcport(fc_port_t *); diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 3c8882a3e6bc..56a80c6e50e3 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -2973,237 +2973,6 @@ qla2x00_gff_id(scsi_qla_host_t *vha, sw_info_t *list) } } -/* GID_PN completion processing. */ -void qla24xx_handle_gidpn_event(scsi_qla_host_t *vha, struct event_arg *ea) -{ - fc_port_t *fcport = ea->fcport; - - ql_dbg(ql_dbg_disc, vha, 0x201d, - "%s %8phC DS %d LS %d rc %d login %d|%d rscn %d|%d lid %d\n", - __func__, fcport->port_name, fcport->disc_state, - fcport->fw_login_state, ea->rc, fcport->login_gen, ea->sp->gen2, - fcport->rscn_gen, ea->sp->gen1, fcport->loop_id); - - if (fcport->disc_state == DSC_DELETE_PEND) - return; - - if (ea->sp->gen2 != fcport->login_gen) { - /* PLOGI/PRLI/LOGO came in while cmd was out.*/ - ql_dbg(ql_dbg_disc, vha, 0x201e, - "%s %8phC generation changed rscn %d|%d n", - __func__, fcport->port_name, fcport->last_rscn_gen, - fcport->rscn_gen); - return; - } - - if (!ea->rc) { - if (ea->sp->gen1 == fcport->rscn_gen) { - fcport->scan_state = QLA_FCPORT_FOUND; - fcport->flags |= FCF_FABRIC_DEVICE; - - if (fcport->d_id.b24 == ea->id.b24) { - /* cable plugged into the same place */ - switch (vha->host->active_mode) { - case MODE_TARGET: - if (fcport->fw_login_state == - DSC_LS_PRLI_COMP) { - u16 data[2]; - /* - * Late RSCN was delivered. - * Remote port already login'ed. - */ - ql_dbg(ql_dbg_disc, vha, 0x201f, - "%s %d %8phC post adisc\n", - __func__, __LINE__, - fcport->port_name); - data[0] = data[1] = 0; - qla2x00_post_async_adisc_work( - vha, fcport, data); - } - break; - case MODE_INITIATOR: - case MODE_DUAL: - default: - ql_dbg(ql_dbg_disc, vha, 0x201f, - "%s %d %8phC post %s\n", __func__, - __LINE__, fcport->port_name, - (atomic_read(&fcport->state) == - FCS_ONLINE) ? "adisc" : "gnl"); - - if (atomic_read(&fcport->state) == - FCS_ONLINE) { - u16 data[2]; - - data[0] = data[1] = 0; - qla2x00_post_async_adisc_work( - vha, fcport, data); - } else { - qla24xx_post_gnl_work(vha, - fcport); - } - break; - } - } else { /* fcport->d_id.b24 != ea->id.b24 */ - fcport->d_id.b24 = ea->id.b24; - fcport->id_changed = 1; - if (fcport->deleted != QLA_SESS_DELETED) { - ql_dbg(ql_dbg_disc, vha, 0x2021, - "%s %d %8phC post del sess\n", - __func__, __LINE__, fcport->port_name); - qlt_schedule_sess_for_deletion(fcport); - } - } - } else { /* ea->sp->gen1 != fcport->rscn_gen */ - ql_dbg(ql_dbg_disc, vha, 0x2022, - "%s %d %8phC post gidpn\n", - __func__, __LINE__, fcport->port_name); - /* rscn came in while cmd was out */ - qla24xx_post_gidpn_work(vha, fcport); - } - } else { /* ea->rc */ - /* cable pulled */ - if (ea->sp->gen1 == fcport->rscn_gen) { - if (ea->sp->gen2 == fcport->login_gen) { - ql_dbg(ql_dbg_disc, vha, 0x2042, - "%s %d %8phC post del sess\n", __func__, - __LINE__, fcport->port_name); - qlt_schedule_sess_for_deletion(fcport); - } else { - ql_dbg(ql_dbg_disc, vha, 0x2045, - "%s %d %8phC login\n", __func__, __LINE__, - fcport->port_name); - qla24xx_fcport_handle_login(vha, fcport); - } - } else { - ql_dbg(ql_dbg_disc, vha, 0x2049, - "%s %d %8phC post gidpn\n", __func__, __LINE__, - fcport->port_name); - qla24xx_post_gidpn_work(vha, fcport); - } - } -} /* gidpn_event */ - -static void qla2x00_async_gidpn_sp_done(void *s, int res) -{ - struct srb *sp = s; - struct scsi_qla_host *vha = sp->vha; - fc_port_t *fcport = sp->fcport; - u8 *id = fcport->ct_desc.ct_sns->p.rsp.rsp.gid_pn.port_id; - struct event_arg ea; - - fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); - - memset(&ea, 0, sizeof(ea)); - ea.fcport = fcport; - ea.id.b.domain = id[0]; - ea.id.b.area = id[1]; - ea.id.b.al_pa = id[2]; - ea.sp = sp; - ea.rc = res; - ea.event = FCME_GIDPN_DONE; - - if (res == QLA_FUNCTION_TIMEOUT) { - ql_dbg(ql_dbg_disc, sp->vha, 0xffff, - "Async done-%s WWPN %8phC timed out.\n", - sp->name, fcport->port_name); - qla24xx_post_gidpn_work(sp->vha, fcport); - sp->free(sp); - return; - } else if (res) { - ql_dbg(ql_dbg_disc, sp->vha, 0xffff, - "Async done-%s fail res %x, WWPN %8phC\n", - sp->name, res, fcport->port_name); - } else { - ql_dbg(ql_dbg_disc, vha, 0x204f, - "Async done-%s good WWPN %8phC ID %3phC\n", - sp->name, fcport->port_name, id); - } - - qla2x00_fcport_event_handler(vha, &ea); - - sp->free(sp); -} - -int qla24xx_async_gidpn(scsi_qla_host_t *vha, fc_port_t *fcport) -{ - int rval = QLA_FUNCTION_FAILED; - struct ct_sns_req *ct_req; - srb_t *sp; - - if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT)) - return rval; - - fcport->disc_state = DSC_GID_PN; - fcport->scan_state = QLA_FCPORT_SCAN; - sp = qla2x00_get_sp(vha, fcport, GFP_ATOMIC); - if (!sp) - goto done; - - fcport->flags |= FCF_ASYNC_SENT; - sp->type = SRB_CT_PTHRU_CMD; - sp->name = "gidpn"; - sp->gen1 = fcport->rscn_gen; - sp->gen2 = fcport->login_gen; - - qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); - - /* CT_IU preamble */ - ct_req = qla2x00_prep_ct_req(fcport->ct_desc.ct_sns, GID_PN_CMD, - GID_PN_RSP_SIZE); - - /* GIDPN req */ - memcpy(ct_req->req.gid_pn.port_name, fcport->port_name, - WWN_SIZE); - - /* req & rsp use the same buffer */ - sp->u.iocb_cmd.u.ctarg.req = fcport->ct_desc.ct_sns; - sp->u.iocb_cmd.u.ctarg.req_dma = fcport->ct_desc.ct_sns_dma; - sp->u.iocb_cmd.u.ctarg.rsp = fcport->ct_desc.ct_sns; - sp->u.iocb_cmd.u.ctarg.rsp_dma = fcport->ct_desc.ct_sns_dma; - sp->u.iocb_cmd.u.ctarg.req_size = GID_PN_REQ_SIZE; - sp->u.iocb_cmd.u.ctarg.rsp_size = GID_PN_RSP_SIZE; - sp->u.iocb_cmd.u.ctarg.nport_handle = NPH_SNS; - - sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; - sp->done = qla2x00_async_gidpn_sp_done; - - rval = qla2x00_start_sp(sp); - if (rval != QLA_SUCCESS) - goto done_free_sp; - - ql_dbg(ql_dbg_disc, vha, 0x20a4, - "Async-%s - %8phC hdl=%x loopid=%x portid %02x%02x%02x.\n", - sp->name, fcport->port_name, - sp->handle, fcport->loop_id, fcport->d_id.b.domain, - fcport->d_id.b.area, fcport->d_id.b.al_pa); - return rval; - -done_free_sp: - sp->free(sp); -done: - fcport->flags &= ~FCF_ASYNC_ACTIVE; - return rval; -} - -int qla24xx_post_gidpn_work(struct scsi_qla_host *vha, fc_port_t *fcport) -{ - struct qla_work_evt *e; - int ls; - - ls = atomic_read(&vha->loop_state); - if (((ls != LOOP_READY) && (ls != LOOP_UP)) || - test_bit(UNLOADING, &vha->dpc_flags)) - return 0; - - e = qla2x00_alloc_work(vha, QLA_EVT_GIDPN); - if (!e) - return QLA_FUNCTION_FAILED; - - e->u.fcport.fcport = fcport; - fcport->flags |= FCF_ASYNC_ACTIVE; - return qla2x00_post_work(vha, e); -} - int qla24xx_post_gpsc_work(struct scsi_qla_host *vha, fc_port_t *fcport) { struct qla_work_evt *e; @@ -3237,9 +3006,6 @@ void qla24xx_handle_gpsc_event(scsi_qla_host_t *vha, struct event_arg *ea) __func__, fcport->port_name); return; } else if (ea->sp->gen1 != fcport->rscn_gen) { - ql_dbg(ql_dbg_disc, vha, 0x20d4, "%s %d %8phC post gidpn\n", - __func__, __LINE__, fcport->port_name); - qla24xx_post_gidpn_work(vha, fcport); return; } @@ -3466,6 +3232,7 @@ void qla24xx_handle_gpnid_event(scsi_qla_host_t *vha, struct event_arg *ea) qlt_schedule_sess_for_deletion(conflict); } + fcport->scan_needed = 0; fcport->rscn_gen++; fcport->scan_state = QLA_FCPORT_FOUND; fcport->flags |= FCF_FABRIC_DEVICE; @@ -4607,9 +4374,6 @@ void qla24xx_handle_gfpnid_event(scsi_qla_host_t *vha, struct event_arg *ea) __func__, fcport->port_name); return; } else if (ea->sp->gen1 != fcport->rscn_gen) { - ql_dbg(ql_dbg_disc, vha, 0x20d4, "%s %d %8phC post gidpn\n", - __func__, __LINE__, fcport->port_name); - qla24xx_post_gidpn_work(vha, fcport); return; } diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index c675066b080e..3fdd4336017c 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -413,9 +413,7 @@ void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea) __func__, ea->fcport->port_name); return; } else if (ea->sp->gen1 != ea->fcport->rscn_gen) { - ql_dbg(ql_dbg_disc, vha, 0x20d4, "%s %d %8phC post gidpn\n", - __func__, __LINE__, ea->fcport->port_name); - qla24xx_post_gidpn_work(vha, ea->fcport); + qla_rscn_replay(fcport); return; } @@ -539,11 +537,7 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, } if (fcport->last_rscn_gen != fcport->rscn_gen) { - ql_dbg(ql_dbg_disc, vha, 0x20df, - "%s %8phC rscn gen changed rscn %d|%d \n", - __func__, fcport->port_name, - fcport->last_rscn_gen, fcport->rscn_gen); - qla24xx_post_gidpn_work(vha, fcport); + qla_rscn_replay(fcport); return; } else if (fcport->last_login_gen != fcport->login_gen) { ql_dbg(ql_dbg_disc, vha, 0x20e0, @@ -1226,6 +1220,18 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) else ls = pd->current_login_state & 0xf; + if (ea->sp->gen2 != fcport->login_gen) { + /* target side must have changed it. */ + + ql_dbg(ql_dbg_disc, vha, 0x20d3, + "%s %8phC generation changed\n", + __func__, fcport->port_name); + return; + } else if (ea->sp->gen1 != fcport->rscn_gen) { + qla_rscn_replay(fcport); + return; + } + switch (ls) { case PDS_PRLI_COMPLETE: __qla24xx_parse_gpdb(vha, fcport, pd); @@ -1414,7 +1420,7 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) if (N2N_TOPO(vha->hw)) qla_chk_n2n_b4_login(vha, fcport); else - qla24xx_post_gidpn_work(vha, fcport); + qlt_schedule_sess_for_deletion(fcport); break; case DSC_LOGIN_COMPLETE: @@ -1522,7 +1528,6 @@ void qla24xx_handle_relogin_event(scsi_qla_host_t *vha, ql_dbg(ql_dbg_disc, vha, 0x20e9, "%s %d %8phC post gidpn\n", __func__, __LINE__, fcport->port_name); - qla24xx_post_gidpn_work(vha, fcport); return; } @@ -1542,7 +1547,6 @@ void qla2x00_fcport_event_handler(scsi_qla_host_t *vha, struct event_arg *ea) { fc_port_t *f, *tf; uint32_t id = 0, mask, rid; - unsigned long flags; fc_port_t *fcport; switch (ea->event) { @@ -1557,6 +1561,10 @@ void qla2x00_fcport_event_handler(scsi_qla_host_t *vha, struct event_arg *ea) return; switch (ea->id.b.rsvd_1) { case RSCN_PORT_ADDR: +#define BIGSCAN 1 +#if defined BIGSCAN & BIGSCAN > 0 + { + unsigned long flags; fcport = qla2x00_find_fcport_by_nportid (vha, &ea->id, 1); if (fcport) { @@ -1572,7 +1580,26 @@ void qla2x00_fcport_event_handler(scsi_qla_host_t *vha, struct event_arg *ea) schedule_delayed_work(&vha->scan.scan_work, 5); } spin_unlock_irqrestore(&vha->work_lock, flags); - + } +#else + { + int rc; + fcport = qla2x00_find_fcport_by_nportid(vha, &ea->id, 1); + if (!fcport) { + /* cable moved */ + rc = qla24xx_post_gpnid_work(vha, &ea->id); + if (rc) { + ql_log(ql_log_warn, vha, 0xd044, + "RSCN GPNID work failed %06x\n", + ea->id.b24); + } + } else { + ea->fcport = fcport; + fcport->scan_needed = 1; + qla24xx_handle_rscn_event(fcport, ea); + } + } +#endif break; case RSCN_AREA_ADDR: case RSCN_DOM_ADDR: @@ -1608,9 +1635,6 @@ void qla2x00_fcport_event_handler(scsi_qla_host_t *vha, struct event_arg *ea) set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); } break; - case FCME_GIDPN_DONE: - qla24xx_handle_gidpn_event(vha, ea); - break; case FCME_GNL_DONE: qla24xx_handle_gnl_done_event(vha, ea); break; @@ -1650,6 +1674,36 @@ void qla2x00_fcport_event_handler(scsi_qla_host_t *vha, struct event_arg *ea) } } +/* + * RSCN(s) came in for this fcport, but the RSCN(s) was not able + * to be consumed by the fcport + */ +void qla_rscn_replay(fc_port_t *fcport) +{ + struct event_arg ea; + + switch (fcport->disc_state) { + case DSC_DELETE_PEND: + return; + default: + break; + } + + if (fcport->scan_needed) { + memset(&ea, 0, sizeof(ea)); + ea.event = FCME_RSCN; + ea.id = fcport->d_id; + ea.id.b.rsvd_1 = RSCN_PORT_ADDR; +#if defined BIGSCAN & BIGSCAN > 0 + qla2x00_fcport_event_handler(fcport->vha, &ea); +#else + qla24xx_post_gpnid_work(fcport->vha, &ea.id); +#endif + } else { + qla24xx_post_gnl_work(fcport->vha, fcport); + } +} + static void qla2x00_tmf_iocb_timeout(void *data) { @@ -1905,9 +1959,7 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) set_bit(RELOGIN_NEEDED, &vha->dpc_flags); return; } else if (ea->sp->gen1 != fcport->rscn_gen) { - ql_dbg(ql_dbg_disc, vha, 0x20d4, "%s %d %8phC post gidpn\n", - __func__, __LINE__, fcport->port_name); - qla24xx_post_gidpn_work(vha, fcport); + qla_rscn_replay(fcport); return; } @@ -1996,8 +2048,6 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) "%s %d %8phC NPortId %06x inuse with loopid 0x%x. post gidpn\n", __func__, __LINE__, ea->fcport->port_name, ea->fcport->d_id.b24, lid); - qla2x00_clear_loop_id(ea->fcport); - qla24xx_post_gidpn_work(vha, ea->fcport); } else { ql_dbg(ql_dbg_disc, vha, 0x20ed, "%s %d %8phC NPortId %06x inuse with loopid 0x%x. sched delete\n", diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index b8b7415bc59d..842456132e27 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -5032,9 +5032,6 @@ qla2x00_do_work(struct scsi_qla_host *vha) case QLA_EVT_AENFX: qlafx00_process_aen(vha, e); break; - case QLA_EVT_GIDPN: - qla24xx_async_gidpn(vha, e->u.fcport.fcport); - break; case QLA_EVT_GPNID: qla24xx_async_gpnid(vha, &e->u.gpnid.id); break; From patchwork Tue Sep 4 21:19:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10587991 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 80B7B14E0 for ; Tue, 4 Sep 2018 21:19:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71D6D2A124 for ; Tue, 4 Sep 2018 21:19:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65CE32A128; Tue, 4 Sep 2018 21:19:41 +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,DKIM_SIGNED, DKIM_VALID,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 05C512A124 for ; Tue, 4 Sep 2018 21:19:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727449AbeIEBqd (ORCPT ); Tue, 4 Sep 2018 21:46:33 -0400 Received: from mail-eopbgr710068.outbound.protection.outlook.com ([40.107.71.68]:36408 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727361AbeIEBqd (ORCPT ); Tue, 4 Sep 2018 21:46:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FMdUi7SSC8VTX1QODcCIPtDmmIri/Sy4UPZOEo47vBs=; b=kPWMHPD/iY5NpekinvklO+4MX7/JttiP6MVhgTMLBOumCRW/ot4SRDa0jdNv9qOTyz3sRgNkO1hE4AQAoVFPVXl7cR+MuU5S5WfHy79B4PZHUlZWOgGnpYveB/5WPUlb0PvQgCD4GI4qWXgMV7VjL5sKpX8dz5g8iTG8YKOidSY= Received: from DM5PR07CA0082.namprd07.prod.outlook.com (2603:10b6:4:ad::47) by SN6PR07MB4670.namprd07.prod.outlook.com (2603:10b6:805:3a::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.16; Tue, 4 Sep 2018 21:19:36 +0000 Received: from CO1NAM05FT006.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::209) by DM5PR07CA0082.outlook.office365.com (2603:10b6:4:ad::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.16 via Frontend Transport; Tue, 4 Sep 2018 21:19:36 +0000 Authentication-Results: spf=pass (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by CO1NAM05FT006.mail.protection.outlook.com (10.152.96.111) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1143.1 via Frontend Transport; Tue, 4 Sep 2018 21:19:35 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 4 Sep 2018 14:19:21 -0700 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 w84LJNc8032002; Tue, 4 Sep 2018 14:19:23 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w84LJNLG032001; Tue, 4 Sep 2018 14:19:23 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 10/13] qla2xxx: Fix Remote port registration Date: Tue, 4 Sep 2018 14:19:18 -0700 Message-ID: <20180904211921.31927-11-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180904211921.31927-1-himanshu.madhani@cavium.com> References: <20180904211921.31927-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(136003)(346002)(396003)(376002)(2980300002)(438002)(199004)(189003)(42186006)(6666003)(110136005)(54906003)(5660300001)(16586007)(44832011)(106002)(316002)(305945005)(2616005)(336012)(446003)(106466001)(36756003)(1076002)(11346002)(486006)(476003)(356003)(26005)(126002)(14444005)(50466002)(2906002)(47776003)(478600001)(8936002)(50226002)(51416003)(69596002)(87636003)(80596001)(48376002)(4326008)(72206003)(76176011)(81156014)(86362001)(81166006)(8676002)(186003);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR07MB4670;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT006;1:EE6bc5I853hIlB5lvS74q51YPbBU+A4lRaibHOSEWWSXkA3wIuQVuF8dmv3ugp50o8qapbBnbcujmqqLczF0qBJE1LbVnRdG7dW9x80lzPfrxZJ0hxyxE+ZTbGlYr1uA X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5f2b15b4-91ff-40d2-6acc-08d612ac1da4 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:SN6PR07MB4670; X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4670;3:N9v5JjhTcZtdhzlMNpUkRHpW0Ft5zHms5D5bg/Pbd+V7NoPYzhoalZWbbYl5B/DLznWfMIARadL5Vth2R6ivbdSu61TxbD+8J+GI4HamLSr/AXqmm/pY8McvRpsfF5CQSn5QvoV7h4Ttil2YMK97yK4haxATjkkS6mIMlcL1k0JisJK1Tu8D0mWvnUxzM44c8G/UIbgJ7OEdxhF9C6ZCrBpVYe3aXqZ/z9Biv9sPNaXb4A0SPq8MIto464dokV8B8EiBe1Iy8Ns/xT3ok2z7HQoTmrfDWDEsIEqokKWSP5yL365Spr7q0ighg0Vl4qWoq2vnJZ0Khs4mYvjkWLctkSQAqbzm+CeJO10Zcsj3FTs=;25:HblVR5wrKNFHy15LLdTPW4/Qw6eYzh6rfP7ZXxpUBR53ZcXi/FGFFvuY7Gn6HriLVis3qmVsPCvooCxHJedHNMJgdxZjrVzF6guoPiMLH8YvaRFDultReNgVbosdNAQdZTEVjzwNZhojtuLB2Z1DjZEUuDRDb4OhKeUy70fQ8hzK8n1mmMiMWNytOP+ejmkn+lyRBFiqSx1EkwRf3e+LoIpjmAM6i9htp2GglPIxdpEoGQ37TnZJi/rk1WUhPOdp8J3CuYDixlsE3XUsQdtDEqPVjL66mVSU4Or0t12armVwPoqwKA2Wl/+cSkpjXnphXgSYZA8CRwvMbmmoAsXRKg== X-MS-TrafficTypeDiagnostic: SN6PR07MB4670: X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4670;31:K2MAzv3c7i+qHM7BDmgp8erDQioznTe6uFPgpNG+61Ho3zx965MFio5MsJtnI+hVWkB0fvNgTInDyj6GRRUzzyHWcldpNynRuXjfnfSegI+/JLh6SZfm68Pbemt+tlJyx8jhx/x4z3CWGMyv3PeJ0HgUaJqV81OCQHDyg8PO3VF41pODB7JxjkTEJY8yoqK6GQ6qVaV3Ni+gPv+YYwCMv/TNTOYiLT0Ft4NL1x4ORYk=;20:SB6csSzKCIl0lnFigvEXilAwNL7J6AQsBwpu8LYojkC34+i4+GsrU7MGaB67xci8kgerKnpM1mNDmd7RNk24eVDxVnixpSfYmSz2f5TF9qftxagzuuqKIeoPCBiC9hhWnT1pDQIrUS1YPJhjQ9uiGOUmxE+w2XUs7K8eYOzXfag3xfaH7rzEnAPa8+w2JP13j2Fo5x5MjmD95Ah8Ea3DuLwn8PKGkvoil+LdEmvVZKQXTc4stCzKFq1+qQ0EVulpYLpukCmssWpI15dJkdsqRV4OrZc3/ZgKvASMPjWCub9PL7YzNeOhpfZ8K2mUwOddzPjW8b9rFhCJuC2COVD9SNIi48obJWSgKHg3GH1YmtQwnqCb1qW8Lr7d2syBp6JnZRtTwOyFWc3Yte8G9cJWJEV3Rq3LjPjYCyYgMS6m0cZPbvUQ8RruGRfV1/V1lO8tSylENjiO123+IENBHPKUGaOv6ZO4XlsmRyYrnH/m4liXlObGVHoV74vi4K2bhfm4 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231311)(944501410)(52105095)(10201501046)(93006095)(93004095)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:SN6PR07MB4670;BCL:0;PCL:0;RULEID:;SRVR:SN6PR07MB4670; X-Microsoft-Exchange-Diagn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EpmaGEgx2+e++ymnrp/eiLP/FfUUEQ2skIMTy+wD0APGzIptmifMVmpQfYAzmCmakqOmTSk0WfBRXcudxMPKX0r0DPVJnvvXCXQiSlaZSUOTrYXtAvVzyuBLtAjdZvKx9lB94KSS7nK7Df3/3n66CbewLSG8t5fcyXsBCT798qzw8kxxZ/c85ikQkUa1ngaUBBQGx8JPOEVXdNMnzLLuEjQzIOeCuzAd/A4wuIGJ04r6naeC+HZMNXdgTg==;5:8KCB7pDBOwHZ1fcLA82iQj4xUDGmlQzK/SWwZe/radgYEARbTpzP2VBWhvuZaYoM1cTqIChSqcosCXZ9Zn1MdxI4Pmu3XVKif6PKJPW1KzoxtS58kFGeXp0nCGlcF9FrNx2oNrF3DkBFkce27RabpR82NRUo7VAkpkSHNW+S5PQ=;7:gkDoat5svJsjTsWymqtTee4wq5VLkSIxMDfPdMOQQVAxoe/hO/Ylb35ypoU8REW6k41vfjk/b5fcu1PwiblZFLLt5wNco9R11piy9nsavX0zXT+u8NCEf7LBk1rzH11FL+/L6vyLzWYnAIBK7/FsHrWo9tsDGnFckCrk15wg2EhTlop2NkJMcflGmUT1wY+enSe+RigNa2LZtEbbrqOjGaaaOEFkWvlKlx8WcYxKBxf+Fs4ymyn+gVWi4256mv9Q SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 21:19:35.7993 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f2b15b4-91ff-40d2-6acc-08d612ac1da4 X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4670 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 Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 3fdd4336017c..e7de6f149e34 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -5291,8 +5291,6 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) fcport->login_retry = vha->hw->login_retry_count; fcport->n2n_chip_reset = fcport->n2n_link_reset_cnt = 0; - qla2x00_iidma_fcport(vha, fcport); - switch (vha->hw->current_topology) { case ISP_CFG_N: case ISP_CFG_NL: @@ -5302,6 +5300,8 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) break; } + qla2x00_iidma_fcport(vha, fcport); + if (fcport->fc4f_nvme) { qla_nvme_register_remote(vha, fcport); fcport->disc_state = DSC_LOGIN_COMPLETE; @@ -5330,6 +5330,8 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) break; } + qla2x00_set_fcport_state(fcport, FCS_ONLINE); + if (IS_IIDMA_CAPABLE(vha->hw) && vha->hw->flags.gpsc_supported) { if (fcport->id_changed) { fcport->id_changed = 0; @@ -5346,7 +5348,6 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) qla24xx_post_gpsc_work(vha, fcport); } } - qla2x00_set_fcport_state(fcport, FCS_ONLINE); fcport->disc_state = DSC_LOGIN_COMPLETE; } From patchwork Tue Sep 4 21:19:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10587995 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 36AEB175A for ; Tue, 4 Sep 2018 21:19:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 259C628F76 for ; Tue, 4 Sep 2018 21:19:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 19FC52A127; Tue, 4 Sep 2018 21:19:42 +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,DKIM_SIGNED, DKIM_VALID,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 979782A124 for ; Tue, 4 Sep 2018 21:19:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727438AbeIEBqf (ORCPT ); Tue, 4 Sep 2018 21:46:35 -0400 Received: from mail-eopbgr710068.outbound.protection.outlook.com ([40.107.71.68]:36408 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726864AbeIEBqf (ORCPT ); Tue, 4 Sep 2018 21:46:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3TBPMKrmNbTIUasND36swBZcN/BlGbYQ8rUokAsDnx4=; b=I+PDIVhQtb4FmseBHZ8yhZPCu7bZE7/AhaJ+AED/E9upupHQk35UW43DTW20ieivLkoDWaujfOSaecWcOBPcdEa6bDyREk2RKUFL3oQChYdw0w7gCDzTSQqqhBLLI9IlATOCJaDdGLwYXy3NIxyopziFmumC9/EgbKeuJWM4Lrw= Received: from DM5PR07CA0055.namprd07.prod.outlook.com (2603:10b6:4:ad::20) by SN6PR07MB4670.namprd07.prod.outlook.com (2603:10b6:805:3a::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.16; Tue, 4 Sep 2018 21:19:37 +0000 Received: from CO1NAM05FT006.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::207) by DM5PR07CA0055.outlook.office365.com (2603:10b6:4:ad::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.14 via Frontend Transport; Tue, 4 Sep 2018 21:19:37 +0000 Authentication-Results: spf=pass (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by CO1NAM05FT006.mail.protection.outlook.com (10.152.96.111) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1143.1 via Frontend Transport; Tue, 4 Sep 2018 21:19:36 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 4 Sep 2018 14:19:21 -0700 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 w84LJN2Y032006; Tue, 4 Sep 2018 14:19:23 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w84LJN0m032005; Tue, 4 Sep 2018 14:19:23 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 11/13] qla2xxx: Remove stale ADISC_DONE event Date: Tue, 4 Sep 2018 14:19:19 -0700 Message-ID: <20180904211921.31927-12-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180904211921.31927-1-himanshu.madhani@cavium.com> References: <20180904211921.31927-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(136003)(346002)(396003)(376002)(2980300002)(438002)(199004)(189003)(42186006)(6666003)(110136005)(54906003)(5660300001)(16586007)(44832011)(106002)(316002)(305945005)(2616005)(336012)(446003)(106466001)(36756003)(1076002)(11346002)(486006)(476003)(356003)(26005)(126002)(14444005)(50466002)(2906002)(47776003)(478600001)(8936002)(50226002)(51416003)(69596002)(87636003)(80596001)(48376002)(4326008)(72206003)(76176011)(81156014)(86362001)(81166006)(8676002)(186003);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR07MB4670;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT006;1:SMCGkZ1Hu+KhFjsX9xximM0EErIShFyx7R4EXqZ1iKEqsg0uhxiC1niMAtKUJWgyMTwUhRbpZOKgGklltpKS9xRUZ1Uy92OcLCgLaOYkPIt/8DB/V1kxajFeegJ9hGqw X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a3d0c558-fc0d-46c3-c6cb-08d612ac1e41 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:SN6PR07MB4670; X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4670;3:4kQJ0vLGXsZSYWuzlJSs1qywNUft3r/lznbmp9CCZ3jcgj8xM9Oex4CZm7FHKImHJexgvBIdfugB6agsziC4Lqo9PfhoZp4fkof2vGOIbpz5lwM+e580BcK+lqsdfx11WBYj3VDu+xepRBOnIyA84Sds2eAY3A7mN4J/MKhX+SktQrNBQjVBR3GMTnnXcANVUpeZwRw3A19eCrYg1Mnhtlssylnfwj23D91ZqzpBUgMFn47llp6YvW35ERa3FU3RX3o2gi+EyPW50nHi+8H7XjZcILtcoLanycm/zfUhHkEMoAFNkMGRK2xTij9zVFDIvK0jIeTDnzEaQFU4rqm2c/ooYsp2M1cSqSsiyI9I8xU=;25:RtDMWIFaEobHn9NHWKmhMtUNX1TRtd7X7CwWhpvtbCT7Q0Iw/h40xeIt7oYZruSy1aS1sjC+3KMmE6FHvAdbiAnFZZmWnQiKT0LM/lel2EhkavDaT0/cU/86cyuo3bZD9z3sceEpklD5cwPWg18Iv0jZWlA2nCi+bVdRU5NhFtgJjuM6VwqEyvK2t99JtHuEns7aP2s4DEuKs5agEGSoZA/7vbWUdRpnHfz7+ix85Ud8I34NYF97sL5hIMPSkJ1L1sdGgttt4u1TFJeGvdRb120lx5fdbAJGMSlj2MONf7SwSbQI0u+VGDdxC2ItYQsaj2jDVCOY3bneuJsgKBmTFA== X-MS-TrafficTypeDiagnostic: SN6PR07MB4670: X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4670;31:OMY4j4HrLPaNpqHisBWjOFQeVJEo5PvOUZMte/dCdlguoCX1zJ7tWk3XTcTNtZiTxCIltBFXYD7Bb8PU+8EZC9ftSYy1/Nbs96wW8Ng17H9RnrzBc9hvOHGJQUglgMArBLp+xMgb/Gmy+uJ8/jQO8eipnLXZ9jq6YikLmHRJo1NwCqHbnP314HWe0cU8C9hr3eNZqMMAmLivV39f9M+Qsr8LughCNrfSxoujJzMcI6M=;20:xBT+ByiNIfofHvfB03q5GmEfXnqQqIljHM7tJ2HxO1wJmvi7Pr6Ua5uDMYDgk3B8CGaHL1tyGNWT9EahF3NQLWv2/Kn/I+KYct+CSJ3AU5MvHiZh/BRENYMe8E++gc3UNPiJkB55aPgiYBbylEMNj6XwZJ49PujMrQP7ek07ZbmCkz2L9mcp2jSrkoE/dT8+1UUQO002rRDAnx0i93c+0HCT9bEkl7RelaR1gePjECAwR2H3XvO+sJBIy+icolztNiDY9Wq7TLGLy3pQ52f9HrRc3JrGaR0KVDaIDKGUmJIr+yerH8wVFSU/l7MY34NqciKrW51Djze7FFh2Nn4ri6MQePEA9ta+SVEjLIMUHuhU3chlGolYkPfGQtimsgJHKOTkF7PAypQRKtSEHs1QS1ZoChXrBjR2/ZoJxJWzrFsj/JP3YbDKbtVCYNlKhqYLPVtyfFFemxWm+j6A2ORcPsL3eSq0Rf16rAoGor8vQ9AI6Hzks7X+r4vKaz+wZ2cT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231311)(944501410)(52105095)(10201501046)(93006095)(93004095)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:SN6PR07MB4670;BCL:0;PCL:0;RULEID:;SRVR:SN6PR07MB4670; X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4670;4:z5dbk02bpzIZCkIheh59v3M77rKM90TYgB/hUAz0flOjPr4UfIILg7WhzCw2jPMd8ByuW7NtoLnTe8euWJyehHDR1Ws/v9cgRUA7StWfO1fc1w5kZC74j45zQo/s5ZbYhAZFb/8e/RPCXTA25Wv7MKLnJyk6V1KSOdFwGrnmAo+K796QDw+tq1nJFh0jM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aqbOPPHUxRWYhnvXq6R7doA==;5:1uYdGUHbaJZ0bQERH8Ty/CWW5bzIwDIQh3T2AJ1l96s5zeUf4Qha1qRgmAJ74wJoeXZlEl0oozIvwPeytOVfISFxuFiLmA8ur4pIGeDHcDkf+82tJdi231u3lZNyHeG2B6ra/rVB0iRPciHKEmM5/y/P+U6M77SJaNr3Wq7pkw4=;7:QeLRJKe1WjkTgiybl7HSFAM8mMWf8uTD8PeOqpdxQF8he5sNFoCGuzdtin0oZiuMBRJvqbUPbMvPq7E225EEYAwFFL24+4+GpolI7ULiKEABGS+duw8lxtz23d0KC+tu+udVlwUC3abrDUhcJLIc+GubVauZBSdX/o/0kd/B0I1BTi44KhzV8HffLFX3jc1s8iXdN6tEZzfThRj5LuFvc5ULgfoqhUH0bWU2W4cIDTjIYt6+jRP6FpRiF8D+uGMj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 21:19:36.8305 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a3d0c558-fc0d-46c3-c6cb-08d612ac1e41 X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4670 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_def.h | 1 - drivers/scsi/qla2xxx/qla_gbl.h | 2 -- drivers/scsi/qla2xxx/qla_init.c | 20 -------------------- drivers/scsi/qla2xxx/qla_os.c | 5 ----- 4 files changed, 28 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 0a1cae0153b0..8145636c759d 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -3214,7 +3214,6 @@ enum qla_work_type { QLA_EVT_ASYNC_LOGOUT, QLA_EVT_ASYNC_LOGOUT_DONE, QLA_EVT_ASYNC_ADISC, - QLA_EVT_ASYNC_ADISC_DONE, QLA_EVT_UEVENT, QLA_EVT_AENFX, QLA_EVT_GPNID, diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index db642ea5358f..7018067b5707 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -73,8 +73,6 @@ extern void qla2x00_async_login_done(struct scsi_qla_host *, fc_port_t *, uint16_t *); extern void qla2x00_async_logout_done(struct scsi_qla_host *, fc_port_t *, uint16_t *); -extern void qla2x00_async_adisc_done(struct scsi_qla_host *, fc_port_t *, - uint16_t *); struct qla_work_evt *qla2x00_alloc_work(struct scsi_qla_host *, enum qla_work_type); extern int qla24xx_async_gnl(struct scsi_qla_host *, fc_port_t *); diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index e7de6f149e34..245baf269656 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -2075,26 +2075,6 @@ qla2x00_async_logout_done(struct scsi_qla_host *vha, fc_port_t *fcport, return; } -void -qla2x00_async_adisc_done(struct scsi_qla_host *vha, fc_port_t *fcport, - uint16_t *data) -{ - fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); - if (data[0] == MBS_COMMAND_COMPLETE) { - qla2x00_update_fcport(vha, fcport); - - return; - } - - /* Retry login. */ - if (data[1] & QLA_LOGIO_LOGIN_RETRIED) - set_bit(RELOGIN_NEEDED, &vha->dpc_flags); - else - qla2x00_mark_device_lost(vha, fcport, 1, 0); - - return; -} - /****************************************************************************/ /* QLogic ISP2x00 Hardware Support Functions. */ /****************************************************************************/ diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 842456132e27..6ce5a7326932 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -4733,7 +4733,6 @@ qla2x00_post_async_work(login, QLA_EVT_ASYNC_LOGIN); qla2x00_post_async_work(logout, QLA_EVT_ASYNC_LOGOUT); qla2x00_post_async_work(logout_done, QLA_EVT_ASYNC_LOGOUT_DONE); qla2x00_post_async_work(adisc, QLA_EVT_ASYNC_ADISC); -qla2x00_post_async_work(adisc_done, QLA_EVT_ASYNC_ADISC_DONE); qla2x00_post_async_work(prlo, QLA_EVT_ASYNC_PRLO); qla2x00_post_async_work(prlo_done, QLA_EVT_ASYNC_PRLO_DONE); @@ -5022,10 +5021,6 @@ qla2x00_do_work(struct scsi_qla_host *vha) qla2x00_async_adisc(vha, e->u.logio.fcport, e->u.logio.data); break; - case QLA_EVT_ASYNC_ADISC_DONE: - qla2x00_async_adisc_done(vha, e->u.logio.fcport, - e->u.logio.data); - break; case QLA_EVT_UEVENT: qla2x00_uevent_emit(vha, e->u.uevent.code); break; From patchwork Tue Sep 4 21:19:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10587997 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 A9F2014E0 for ; Tue, 4 Sep 2018 21:19:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9899B28F76 for ; Tue, 4 Sep 2018 21:19:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CB942A127; Tue, 4 Sep 2018 21:19: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,DKIM_SIGNED, DKIM_VALID,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 595A328F76 for ; Tue, 4 Sep 2018 21:19:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727453AbeIEBqg (ORCPT ); Tue, 4 Sep 2018 21:46:36 -0400 Received: from mail-eopbgr700047.outbound.protection.outlook.com ([40.107.70.47]:12864 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727195AbeIEBqf (ORCPT ); Tue, 4 Sep 2018 21:46:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=binkdMVPHb2m/1quKLlUjOYX/um06P5VTQN3xc1kXqQ=; b=j8TcXFJ4TzzjE6BMbQ/ixSIOgLMyvpJnLx8mY3GqR3w+b8PNI6TytxJMZ4Cf00NQ8k3VnQyUcQY2MJixvI5ntlrxWqokc6lxZJqCQyefElfxdBphIve0as57Pj8nwI0ADEZU6TcQjMAtD+/jb6pVAQmEaKGyG7BZJ1KSU+CbB00= Received: from DM5PR07CA0055.namprd07.prod.outlook.com (2603:10b6:4:ad::20) by BYAPR07MB4391.namprd07.prod.outlook.com (2603:10b6:a02:c0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.18; Tue, 4 Sep 2018 21:19:38 +0000 Received: from CO1NAM05FT006.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::207) by DM5PR07CA0055.outlook.office365.com (2603:10b6:4:ad::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.14 via Frontend Transport; Tue, 4 Sep 2018 21:19:38 +0000 Authentication-Results: spf=pass (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by CO1NAM05FT006.mail.protection.outlook.com (10.152.96.111) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1143.1 via Frontend Transport; Tue, 4 Sep 2018 21:19:37 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 4 Sep 2018 14:19:22 -0700 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 w84LJNtx032010; Tue, 4 Sep 2018 14:19:23 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w84LJNUT032009; Tue, 4 Sep 2018 14:19:23 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 12/13] qla2xxx: Move ABTS code behind qpair Date: Tue, 4 Sep 2018 14:19:20 -0700 Message-ID: <20180904211921.31927-13-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180904211921.31927-1-himanshu.madhani@cavium.com> References: <20180904211921.31927-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(346002)(376002)(39860400002)(396003)(136003)(2980300002)(438002)(199004)(189003)(50466002)(80596001)(69596002)(14444005)(2616005)(486006)(446003)(11346002)(476003)(44832011)(126002)(48376002)(2906002)(51416003)(336012)(316002)(16586007)(106002)(54906003)(110136005)(42186006)(76176011)(1076002)(4326008)(50226002)(81166006)(87636003)(478600001)(72206003)(5660300001)(81156014)(8936002)(106466001)(356003)(26005)(186003)(8676002)(86362001)(305945005)(36756003)(47776003);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR07MB4391;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT006;1:h+RESUIC4HmvCPyTLa4CXSTZMmDIWRRBuYTnnNjy7zz3GV8ln9LWOcG0n8yID+0qIIpF1g4ceFR2XA7Idn8aDeq4NB9MBwx35lpPKGDynC68C3npYukGAXEyvfMONhpg X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2658fde6-0fa1-42dd-2410-08d612ac1ec0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BYAPR07MB4391; X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4391;3:6i3jYzGzZgugblBsQnVRyVJ8vmnqOJzlG6OmcQjA2ROb4YTdG+aEq7HrLXnz5y+kXpQDjb/IiCO5EfwlCtA20FLaMo5bHWkp2JUHxwecgVDz9wu5MzVWojunnqKkvLU+dNlaJER+clsO8c9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ladtiU0LF5uO3RGmlN0b9t0R3/l/JLfQtt5lIHkonmW2iT0lIc/b/U7nnsq8TRKStoUc7lTjMss7Q4aTNPVOPrgJUFQAjiabttiD7CEGNIXAG+sbvP3O7kK1iXIyQCqmzWvQP4AS+9oIFtwYvLGRFR7yKuv/FibGz9cF8JmHCBh2j7WoSR7P9vaAr5KIyS1nTroKmKAyNUMZt3hil/lpHmihbPwv1WCjJ4OfmMTgGcqs3CBgcIsGMdsc7gODiv4OsfdbN4quv9YZfXIWcEX3uXDOKGLhVRvuj6kD9BXAVPIr4WxW8qY X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93004095)(10201501046)(149027)(150027)(6041310)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:BYAPR07MB4391;BCL:0;PCL:0;RULEID:;SRVR:BYAPR07MB4391; X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4391;4:zFdLtwQwwDU1Ch1rvzX2BMZOvIY4GKVINPPVySZHu0a9KI6rP1DqUODsjzWnIm5y1lggl6GYFaHJw3k1ysP2n/N3/aIGQeovLXIxEUuuPacevjQiy+GaEYcVdtypHdZXOMft0oL/PlaEwc6lbVgoRLoE/Up03S+JEjMBMgt9c5qLz45lT3GekdlGzzMKC9wKAp92RibLwpOSKuv/y2UJzO99f2949WU/RJhr6VNI6gf/UmLcP37T+2y1QHbQDfXWwMTN6bFGJmUHopM+U5ivrA== X-Forefront-PRVS: 0785459C39 X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4391;23:wqZQWy5gLaUxinhYfvgDzJ0OlEAj8QQT9jbDsWHjXw/Ja9W4fFV1xMG6veBla6T55Ab6GW1F31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GMQudp+UempPnDJ/H45yM9RDfNbpY/9Qz0V6XiJMaTh5W2Y56aouv+R9bjxuCod1OrlKsA6jGtJOpKHnWWtfK9XFsFVur9CACVcv0Hw0FkWrhrV5qiYMH4fwGBNUtapj//+tk1TjA9sPIk8y9JPE5ED41L2A7Y9FBlPRMmG3sE3vnUQkaZI9NzuuDX57uyf6G9TDSxaJ+VeOms63PMzwiUd5FJnG7bXMHnzjBpuCUy7DWAR9/MB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 21:19:37.6431 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2658fde6-0fa1-42dd-2410-08d612ac1ec0 X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB4391 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 abort code default to legacy single queue where hardware_lock is used to protect command search. This patch move this code behind the QPair where the qp_lock_ptr will reference the appropriate lock for either legacy/single queue or MQ. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 12 ++- drivers/scsi/qla2xxx/qla_mbx.c | 7 +- drivers/scsi/qla2xxx/qla_os.c | 178 ++++++++++++++++++++++------------------ 3 files changed, 107 insertions(+), 90 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 245baf269656..cb2538a91f4c 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1864,19 +1864,17 @@ qla24xx_async_abort_command(srb_t *sp) uint32_t handle; fc_port_t *fcport = sp->fcport; + struct qla_qpair *qpair = sp->qpair; struct scsi_qla_host *vha = fcport->vha; - struct qla_hw_data *ha = vha->hw; - struct req_que *req = vha->req; - - if (vha->flags.qpairs_available && sp->qpair) - req = sp->qpair->req; + struct req_que *req = qpair->req; - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(qpair->qp_lock_ptr, flags); for (handle = 1; handle < req->num_outstanding_cmds; handle++) { if (req->outstanding_cmds[handle] == sp) break; } - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(qpair->qp_lock_ptr, flags); + if (handle == req->num_outstanding_cmds) { /* Command not found. */ return QLA_FUNCTION_FAILED; diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 3213017658a6..e016ee9c6d8e 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -3097,22 +3097,25 @@ qla24xx_abort_command(srb_t *sp) struct scsi_qla_host *vha = fcport->vha; struct qla_hw_data *ha = vha->hw; struct req_que *req = vha->req; + struct qla_qpair *qpair = sp->qpair; ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x108c, "Entered %s.\n", __func__); if (vha->flags.qpairs_available && sp->qpair) req = sp->qpair->req; + else + return QLA_FUNCTION_FAILED; if (ql2xasynctmfenable) return qla24xx_async_abort_command(sp); - spin_lock_irqsave(&ha->hardware_lock, flags); + spin_lock_irqsave(qpair->qp_lock_ptr, flags); for (handle = 1; handle < req->num_outstanding_cmds; handle++) { if (req->outstanding_cmds[handle] == sp) break; } - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(qpair->qp_lock_ptr, flags); if (handle == req->num_outstanding_cmds) { /* Command not found. */ return QLA_FUNCTION_FAILED; diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 6ce5a7326932..8a2ba6bb5d1b 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -14,6 +14,8 @@ #include #include #include +#include + #include #include #include @@ -1214,10 +1216,14 @@ qla2x00_wait_for_chip_reset(scsi_qla_host_t *vha) return return_status; } -static void +static int sp_get(struct srb *sp) { - atomic_inc(&sp->ref_count); + if (!refcount_inc_not_zero((refcount_t*)&sp->ref_count)) + /* kref get fail */ + return ENXIO; + else + return 0; } #define ISP_REG_DISCONNECT 0xffffffffU @@ -1275,38 +1281,51 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd) unsigned long flags; int rval, wait = 0; struct qla_hw_data *ha = vha->hw; + struct qla_qpair *qpair; if (qla2x00_isp_reg_stat(ha)) { ql_log(ql_log_info, vha, 0x8042, "PCI/Register disconnect, exiting.\n"); return FAILED; } - if (!CMD_SP(cmd)) - return SUCCESS; ret = fc_block_scsi_eh(cmd); if (ret != 0) return ret; ret = SUCCESS; - id = cmd->device->id; - lun = cmd->device->lun; - - spin_lock_irqsave(&ha->hardware_lock, flags); sp = (srb_t *) CMD_SP(cmd); - if (!sp) { - spin_unlock_irqrestore(&ha->hardware_lock, flags); + if (!sp) + return SUCCESS; + + qpair = sp->qpair; + if (!qpair) + return SUCCESS; + + spin_lock_irqsave(qpair->qp_lock_ptr, flags); + if (!CMD_SP(cmd)) { + /* there's a chance an interrupt could clear + the ptr as part of done & free */ + spin_unlock_irqrestore(qpair->qp_lock_ptr, flags); + return SUCCESS; + } + + if (sp_get(sp)){ + /* ref_count is already 0 */ + spin_unlock_irqrestore(qpair->qp_lock_ptr, flags); return SUCCESS; } + spin_unlock_irqrestore(qpair->qp_lock_ptr, flags); + + id = cmd->device->id; + lun = cmd->device->lun; ql_dbg(ql_dbg_taskm, vha, 0x8002, "Aborting from RISC nexus=%ld:%d:%llu sp=%p cmd=%p handle=%x\n", vha->host_no, id, lun, sp, cmd, sp->handle); /* Get a reference to the sp and drop the lock.*/ - sp_get(sp); - spin_unlock_irqrestore(&ha->hardware_lock, flags); rval = ha->isp_ops->abort_command(sp); if (rval) { if (rval == QLA_FUNCTION_PARAMETER_ERROR) @@ -1322,14 +1341,29 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd) wait = 1; } - spin_lock_irqsave(&ha->hardware_lock, flags); - sp->done(sp, 0); - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_lock_irqsave(qpair->qp_lock_ptr, flags); + /* + * Clear the slot in the oustanding_cmds array if we can't find the + * command to reclaim the resources. + */ + if (rval == QLA_FUNCTION_PARAMETER_ERROR) + vha->req->outstanding_cmds[sp->handle] = NULL; + + /* + * sp->done will do ref_count-- + * sp_get() took an extra count above + */ + sp->done(sp, DID_RESET << 16); /* Did the command return during mailbox execution? */ if (ret == FAILED && !CMD_SP(cmd)) ret = SUCCESS; + if (!CMD_SP(cmd)) + wait = 0; + + spin_unlock_irqrestore(qpair->qp_lock_ptr, flags); + /* Wait for the command to be returned. */ if (wait) { if (qla2x00_eh_wait_on_command(cmd) != QLA_SUCCESS) { @@ -1723,7 +1757,6 @@ __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res) struct req_que *req; struct qla_tgt *tgt = vha->vha_tgt.qla_tgt; struct qla_tgt_cmd *cmd; - uint8_t trace = 0; if (!ha->req_q_map) return; @@ -1735,82 +1768,65 @@ __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res) req->outstanding_cmds[cnt] = NULL; switch (sp->cmd_type) { case TYPE_SRB: - if (sp->cmd_type == TYPE_SRB) { - if (sp->type == SRB_NVME_CMD || - sp->type == SRB_NVME_LS) { - sp_get(sp); + if (sp->type == SRB_NVME_CMD || + sp->type == SRB_NVME_LS) { + if (!sp_get(sp)) { + /* got sp */ spin_unlock_irqrestore (qp->qp_lock_ptr, flags); qla_nvme_abort(ha, sp, res); spin_lock_irqsave - (qp->qp_lock_ptr, - flags); - } else if (GET_CMD_SP(sp) && - !ha->flags.eeh_busy && - (!test_bit(ABORT_ISP_ACTIVE, - &vha->dpc_flags)) && - (sp->type == SRB_SCSI_CMD)) { - /* - * Don't abort commands in - * adapter during EEH - * recovery as it's not - * accessible/responding. - * - * Get a reference to the sp - * and drop the lock. The - * reference ensures this - * sp->done() call and not the - * call in qla2xxx_eh_abort() - * ends the SCSI command (with - * result 'res'). - */ - sp_get(sp); + (qp->qp_lock_ptr, flags); + } + } else if (GET_CMD_SP(sp) && + !ha->flags.eeh_busy && + (!test_bit(ABORT_ISP_ACTIVE, + &vha->dpc_flags)) && + (sp->type == SRB_SCSI_CMD)) { + /* + * Don't abort commands in adapter + * during EEH recovery as it's not + * accessible/responding. + * + * Get a reference to the sp and drop + * the lock. The reference ensures this + * sp->done() call and not the call in + * qla2xxx_eh_abort() ends the SCSI cmd + * (with result 'res'). + */ + if (!sp_get(sp)) { spin_unlock_irqrestore - (qp->qp_lock_ptr, - flags); + (qp->qp_lock_ptr, flags); status = qla2xxx_eh_abort( GET_CMD_SP(sp)); spin_lock_irqsave - (qp->qp_lock_ptr, - flags); - /* - * Get rid of extra reference - * if immediate exit from - * ql2xxx_eh_abort - */ - if (status == FAILED && - (qla2x00_isp_reg_stat(ha))) - atomic_dec( - &sp->ref_count); - } - sp->done(sp, res); - break; - case TYPE_TGT_CMD: - if (!vha->hw->tgt.tgt_ops || - !tgt || qla_ini_mode_enabled(vha)) { - if (!trace) - ql_dbg(ql_dbg_tgt_mgt, - vha, 0xf003, - "HOST-ABORT-HNDLR: dpc_flags=%lx. Target mode disabled\n", - vha->dpc_flags); - continue; + (qp->qp_lock_ptr, flags); } - cmd = (struct qla_tgt_cmd *)sp; - qlt_abort_cmd_on_host_reset(cmd->vha, - cmd); - break; - case TYPE_TGT_TMCMD: - /* - * Currently, only ABTS response gets on - * the outstanding_cmds[] - */ - ha->tgt.tgt_ops->free_mcmd( - (struct qla_tgt_mgmt_cmd *)sp); - break; - default: - break; } + sp->done(sp, res); + break; + case TYPE_TGT_CMD: + if (!vha->hw->tgt.tgt_ops || !tgt || + qla_ini_mode_enabled(vha)) { + ql_dbg(ql_dbg_tgt_mgt, vha, 0xf003, + "HOST-ABORT-HNDLR: dpc_flags=%lx. Target mode disabled\n", + vha->dpc_flags); + continue; + } + cmd = (struct qla_tgt_cmd *)sp; + qlt_abort_cmd_on_host_reset(cmd->vha, cmd); + break; + case TYPE_TGT_TMCMD: + /* + * Currently, only ABTS response gets on the + * outstanding_cmds[] + */ + ha->tgt.tgt_ops->free_mcmd( + (struct qla_tgt_mgmt_cmd *)sp); + break; + default: + break; } } } From patchwork Tue Sep 4 21:19:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10587999 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 85C7D14E0 for ; Tue, 4 Sep 2018 21:19:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75B1E28F76 for ; Tue, 4 Sep 2018 21:19:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A3B02A127; Tue, 4 Sep 2018 21:19:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 0CEF028F76 for ; Tue, 4 Sep 2018 21:19:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727454AbeIEBqi (ORCPT ); Tue, 4 Sep 2018 21:46:38 -0400 Received: from mail-eopbgr700047.outbound.protection.outlook.com ([40.107.70.47]:12864 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726864AbeIEBqh (ORCPT ); Tue, 4 Sep 2018 21:46:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MBMM33cSw3D3wbZmOfOyCCo0y/eAzaxD9uXdc9YVPaM=; b=O1wK0HkAcxQBMNfnBx1sec9iT0qVADOzup3AAVpLJu0ENUc0nGdtbndx73whB/KfUY/i4UqlmRzZzKqZ39Pzs4kozPL4s3FTuulV/XtiHDpDh99HBNEmZ8SG1GKHD4BY4qpUalJiq8q14ONpWsqWVHkCdKgWQl47faqv4WTPIyE= Received: from DM5PR07CA0055.namprd07.prod.outlook.com (2603:10b6:4:ad::20) by BYAPR07MB4391.namprd07.prod.outlook.com (2603:10b6:a02:c0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.18; Tue, 4 Sep 2018 21:19:39 +0000 Received: from CO1NAM05FT006.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::207) by DM5PR07CA0055.outlook.office365.com (2603:10b6:4:ad::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.14 via Frontend Transport; Tue, 4 Sep 2018 21:19:38 +0000 Authentication-Results: spf=pass (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by CO1NAM05FT006.mail.protection.outlook.com (10.152.96.111) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1143.1 via Frontend Transport; Tue, 4 Sep 2018 21:19:38 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 4 Sep 2018 14:19:22 -0700 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 w84LJOkq032014; Tue, 4 Sep 2018 14:19:24 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w84LJNTG032013; Tue, 4 Sep 2018 14:19:23 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 13/13] qla2xxx: Update driver version to 10.00.00.10-k Date: Tue, 4 Sep 2018 14:19:21 -0700 Message-ID: <20180904211921.31927-14-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180904211921.31927-1-himanshu.madhani@cavium.com> References: <20180904211921.31927-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(346002)(376002)(39860400002)(396003)(136003)(2980300002)(438002)(199004)(189003)(50466002)(80596001)(69596002)(14444005)(2616005)(486006)(446003)(11346002)(476003)(44832011)(126002)(48376002)(2906002)(51416003)(336012)(316002)(16586007)(106002)(54906003)(110136005)(42186006)(76176011)(1076002)(4326008)(50226002)(81166006)(87636003)(478600001)(72206003)(5660300001)(81156014)(8936002)(106466001)(356003)(26005)(186003)(8676002)(86362001)(305945005)(36756003)(47776003);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR07MB4391;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT006;1:ILyZG1SFbh/Q5R05t50qngiXtHefmCImEo8PonTsIa8zXSfkmbTpx5+bA6CsVT4ih5OZ0p1KfmmWfvnP3gREx8CFSbBk1ttsuC7F6mj/nuv1kVReMWHFueItjPqUsA99 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ef3230a1-ace0-426d-cf94-08d612ac1f4c X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BYAPR07MB4391; X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4391;3:ZKQfCMt0zDxK9DdhNzsX3RC2wpCP0dUy6wz50U3AiazgHKDCZmtCVBcm1vCI9SC0Lhu491mlTwz3KcvwBnwGMNxH8Mfmixdd3JLC/zehGuNiRD7tXpk/xSO2gPY28dlGq/QjliAvk31BBT8NjC/F2Gs5WSGKkCNJlD339+ntJAP0Im4ComHNKDwAzquCyQ4dnhKj6IzFenpu0Pme89RgoR40v2oH9S/t47gwoGzL3LHIauPO2q4IJqYFrHMHIsbXOioycRsXKArUD4BOTbHG+GuGu/BMkYwp5EPfewXH5cORszVLMbAWkXH6YfqMBsXeXknkB4oaIudyRhWp0BnWNf7BW+/rIKpKTPgKOkLkDog=;25:iVcVLj3nI9QJwJLm4Xb/rZnMmgR9oG5TUc29VV+zz2lUSlaaw9n0OyH8EDytpJQ+xI+reoOygc/De5q6G4O0kxoRWlMlVkwreOAQVKXxpxHyWjXaaEJsvtPOdeOWoR3A9tB4lfKvbdCa+zqxVKeUUSYOqQdh7udorJSpjuNwfMnP5DibR0ATkTRN+li4whhdM1keLNZCl/ddOmgPq3Iv4H1hsnjgf0moSTsIhDPQ0//Ef2zzCzCyCEs41V6w3wJts3fVCZz20ax1xWm0MRN+3nkfF6DiUEwzUAXU//JvFV+D06QScAcAjBP5lXgCw9x3Q4Zj05Zv65vzMwt5bBBa5g== X-MS-TrafficTypeDiagnostic: BYAPR07MB4391: X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4391;31:4Tzg1hT5zI/ufG3WpGrpLMponjj/o1nBxbLDGHN7BIXm95aPyVevVgGsndnIxji+IX8/aiF2mCnIMbaEKbmMLrtFmwrEi+lPGZ/n7lEyHzqbwAt0MFIPjCHt2l3Mnl3XsraEFb8qiKF1e3bzqaMQpuRhWQFz3sGIDVkmgNO5JI3tpNwqrpwDQZ07jU0n20m4+7UJBp2u+95Z03fN6fPmY07amGulrPns1iF8imLnvw4=;20:eV372ei9WIwaIk/gKh54UPMd1SeCO/aur2N4wZtncYnI8CwKdIv0kR5HlqGYQrpBpeF9wSraZoB1kMG/BiNq7mOlvadzNlMAKgRaqaADr3jS8xKn0ShWTEkNb3lMf32rX600WylvFPVjNQzVQFhb+gXlTUTgZUegOoMC+TST1I9chy4XbR8i1SVqFeCYQD0ZRhmR1IOUJX2q7BZHW+Dnzn1VNsXm9C7iEOyehSrgwuVv0lfMy89OD3U7n7SsRIFQDIdX/OMmH1zqalOKX+Mai9X/iR9sMKeA4HWqaZr3phRBFmeYirG8gXXNYzwETx6V7hvp30vG9tvhb7bKibdm8PjejHHfUAtoUxytUVihYATsgi8/32xljTbiC+BsflsbBXc91LiJpGzNz13UeR2/t+nWYMnzD2bYuIfu6m6DwqZastyDplIBk03JkCrXphHRxl3WU3VNhD2qrOkPyu3jA3Sx4TpFrZnHKcBCFk6K8ey/1M2yFkbpxeIbFMqv/5kP X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93004095)(10201501046)(149027)(150027)(6041310)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:BYAPR07MB4391;BCL:0;PCL:0;RULEID:;SRVR:BYAPR07MB4391; X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4391;4:6WD0jNaydE53JMIqlRvYoaYl4RD6uO7SUsPVDl/PdHGy6lJey0Wi5aSMSx9kSV/ROrLhyRxgb8UMcc/EHA5E6jwTErLnpNNyUAK/NiKLpjIy5zVNGBllNvHUjXN6mDGUIz54me5AMvZuxVB/7JLvKk5ObX3alyfcYUnxsIJ2AxaiPpUQF1CpRMO2QnMmYHA3nGLKuETszhw2CqrMxlEKBCOn6eK6HNcD0ex2jT2BgARhMFp6UfoSBqFy9F87bCc+tQ3xtrvaHg0+8pdxwst8hQ== X-Forefront-PRVS: 0785459C39 X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4391;23:eYHSBDZKidTaRKw6Mz0kXAi3+0QbSSUGRA8QosouuoJH1lmhMI4/kTy0s3jEolW8H7WaUR+O3iSp2nbCVBsHhLIhjn9ZWf/0ForFAUH2ZX9ndVVQnB2+/p9cZGY5aErJolEKd2cwSdMemQ+8xAiS6r2ocIjE4cgNSBO+5njPvHJhc7nBKxUi1f86gyEvNPpJmEE3dxz0372uEKL1qkkeb6o1dyFPNjVZTO2rywv9Cgn2tVm4mNwEWrSp0Z7/EoVgESUfb+YfOVfXpXL863FyOrponS+MPG/MM37Y9CO1uWdXcltTp+Ld89S8uIHkq8lE+uoiJttC8PvwrFACr9HpM6LhYWf7VNT9LiyBglMeNzDz4wlVQ4sODZVkyWz1v6lBLVePxWTXWQlDFlCIRq+SiWfIdDwvwrqK1CH+UV9V4eGhR18uc8qqL3SqwulXPYFSXp/LnFj38X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exchange-Diagnostics: 1;BYAPR07MB4391;6:9mYcV4N/m9vz827zWfTDQLnU+ikgZDC4dUcFZWu3FKGtdDSFeyDJ5QkzDzINa6HmSohaWbhdOedUIvDyjMu0vjwjSWj3gYkEPyByATqui3WdxZRZrqYWmTJY9LDpojwXjUgIdS5EVfmOPcquhVK83kjz2noAByDU82D06HK76rsrLOZXSDpr7fLeDf3alzUrW5CfqzqjPJROxtMzqW4uQ6BFKC/XMmrq9CVsJm2GhOlbrlIJ8OcrwhLXy3809/Wr8ouofDjp1WR72VWprTPP3zOpkMlyFHagdABbdJFmR3hA1Xbs75yq3Qqo08F64MyO8U+U+LPQYtwBduzbCBhzxx2j67VFYFGaGlsiOtK7qFUyu8ulkBW+65CQCRTC4bR1PJqFO9zS9CYpyYcnP1E6BPZ2Py/FKkmXEsRhmR6fNyPCfty9saNmsT/nXXgVafOKmO4Fttjagseak6NiKYZ6rA==;5:gqPORgr6UJ4hT9wz13JIt7Ppw2/46nOrhV6gEjDtW8h0o8Wm1xlRpX4KXCYeZKlP0ArWzqChAtSuzyh3LQBSyuDF3sA14ae2IIEnfdUp1cqORtxbUT84eh1RYdoNESH70kpvs5XuFumAmOi2CFgFaRUSZmghKk66u9WpsmhoAdk=;7:iXrxUnZwRUm2B+beiJRABbatxevLa+GJJ/QPU2axT33snJHRpB/7MlTLUUuia1/GqX5WmH0CaWVAQu5EtpWcM/O6DuiejTaFhXS6knZ0fXAbwvjJfuDU8qpSV1jbZyeBzq+z9Kye4KbXpuAIJOy7HtyOkjgdLE8uIBAEMYwk6kFTraIT6x/l1cmqG1oyixKfPU6K6NyNK/T5xCQUCBloNapd+70Xi8mjKWaCsqboihsYsnM5y78mLyXb3MtHaPdU SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 21:19:38.5806 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef3230a1-ace0-426d-cf94-08d612ac1f4c X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB4391 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 0dbba38c408f..9559f1836170 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.09-k" +#define QLA2XXX_VERSION "10.00.00.10-k" #define QLA_DRIVER_MAJOR_VER 10 #define QLA_DRIVER_MINOR_VER 0