From patchwork Sat Feb 16 00:42:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10816115 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 AEFA614E1 for ; Sat, 16 Feb 2019 00:44:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F5C62ED78 for ; Sat, 16 Feb 2019 00:44:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CA082EE55; Sat, 16 Feb 2019 00:44:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9C4E2ED78 for ; Sat, 16 Feb 2019 00:44:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730366AbfBPAoI (ORCPT ); Fri, 15 Feb 2019 19:44:08 -0500 Received: from mail-eopbgr800059.outbound.protection.outlook.com ([40.107.80.59]:18880 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726145AbfBPAoI (ORCPT ); Fri, 15 Feb 2019 19:44:08 -0500 Received: from DM5PR07CA0044.namprd07.prod.outlook.com (2603:10b6:3:16::30) by CY1PR0701MB1929.namprd07.prod.outlook.com (2a01:111:e400:58f9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Sat, 16 Feb 2019 00:44:05 +0000 Received: from CO1NAM05FT015.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::201) by DM5PR07CA0044.outlook.office365.com (2603:10b6:3:16::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Sat, 16 Feb 2019 00:44:05 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by CO1NAM05FT015.mail.protection.outlook.com (10.152.96.122) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Sat, 16 Feb 2019 00:44:04 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Fri, 15 Feb 2019 16:42:56 -0800 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id x1G0gu4l028280; Fri, 15 Feb 2019 16:42:56 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1G0gtNd028279; Fri, 15 Feb 2019 16:42:55 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH] qla2xxx: Avoid PCI IRQ affinity mapping when multiqueue is not supported. Date: Fri, 15 Feb 2019 16:42:55 -0800 Message-ID: <20190216004255.28245-1-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131947514451046651;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(346002)(39860400002)(136003)(376002)(396003)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(217873002)(45080400002)(6306002)(5024004)(14444005)(36906005)(106466001)(336012)(105606002)(356004)(1076003)(81156014)(50226002)(8936002)(81166006)(51416003)(8676002)(48376002)(26005)(305945005)(54906003)(50466002)(486006)(110136005)(16586007)(316002)(4326008)(80596001)(69596002)(42186006)(97736004)(2906002)(2616005)(126002)(476003)(87636003)(966005)(86362001)(53936002)(26826003)(498600001)(36756003)(85426001)(68736007)(47776003)(5660300002)(6606295002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0701MB1929;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c2e3d1bf-cf24-40c7-5c68-08d693a7da49 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:CY1PR0701MB1929; X-MS-TrafficTypeDiagnostic: CY1PR0701MB1929: X-MS-Exchange-PUrlCount: 2 X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0950706AC1 X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1929;23:7dfMJ8uk68A+RJ3i6rVGFZO+mEJr9mexqDf34MxPxIm6LDDafTkGSeY/yuJAp52DOBJnlFf78hL05zshax5oS4CwmUOrRSA4RHyY+kJpKjktv1D4gY+C9ubgkKPK+nSr451AqLC1JphEWtXRmxDrX2DCr+oDxXTG50dO2X5JQRt/KnrBY5SNeDEmKIgfNxKLOFtgI3T66gUVGn6nVCtCBKR1Vo+TltJDTMYE4UrpePMGWA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/jwU= X-Microsoft-Antispam-Message-Info: /cABpTyXXJJe+ecgXBnSITk76Lv9L+LV/uHwq23d7xMKdG8P3OY54PKYIcQhxdWb2LboV78XmZMrzGq+X35V77d+vE3+LnziDO/ZBpZfiNM8QgEBxNxRM8ZRIiDiZLkMA26nDLmhe3D/YDExBz7RnJlUZi7HkfQJTksOI6dwNKkAyE29Vu+58y7GBI9sU6W3o1BMo5HUpLp/w7ua0D0LkOmS5sylBKXUch+5qfvuMrOtxbXgdXfJl665lm0WaConKbURsjY6Vt2SJODBJRV8YmgHp4ZurqVA7gtXTEgqE8TPY7fAU3fIAXcFi40JoIwEr93rv5QU38SU7zX6TV4mTyaN6ZoX6VET0d7IS3NY9Yx56e2dLU2/TACh96/ht6+hctEHKKapPPXkwHRy2ih6tNusjG+3YCX/j076Zlp8IYw= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2019 00:44:04.7149 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c2e3d1bf-cf24-40c7-5c68-08d693a7da49 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1929 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: Giridhar Malavali This patch fixes warning seen when BLK-MQ is enabled and hardware does not support MQ. This will result into driver requesting MSIx vectors which are equal or less than pre_desc via PCI IRQ Affinity infrastructure. [ 19.746300] qla2xxx [0000:00:00.0]-0005: : QLogic Fibre Channel HBA Driver: 10.00.00.12-k. [ 19.746599] qla2xxx [0000:02:00.0]-001d: : Found an ISP2432 irq 18 iobase 0x(____ptrval____). [ 20.203186] ------------[ cut here ]------------ [ 20.203306] WARNING: CPU: 8 PID: 268 at drivers/pci/msi.c:1273 pci_irq_get_affinity+0xf4/0x120 [ 20.203481] Modules linked in: tg3 ptp qla2xxx(+) pps_core sg libphy scsi_transport_fc flash loop autofs4 [ 20.203700] CPU: 8 PID: 268 Comm: systemd-udevd Not tainted 5.0.0-rc5-00358-gdf3865f #113 [ 20.203830] Call Trace: [ 20.203933] [0000000000461bb0] __warn+0xb0/0xe0 [ 20.204090] [00000000006c8f34] pci_irq_get_affinity+0xf4/0x120 [ 20.204219] [000000000068c764] blk_mq_pci_map_queues+0x24/0x120 [ 20.204396] [00000000007162f4] scsi_map_queues+0x14/0x40 [ 20.204626] [0000000000673654] blk_mq_update_queue_map+0x94/0xe0 [ 20.204698] [0000000000676ce0] blk_mq_alloc_tag_set+0x120/0x300 [ 20.204869] [000000000071077c] scsi_add_host_with_dma+0x7c/0x300 [ 20.205419] [00000000100ead54] qla2x00_probe_one+0x19d4/0x2640 [qla2xxx] [ 20.205621] [00000000006b3c88] pci_device_probe+0xc8/0x160 [ 20.205697] [0000000000701c0c] really_probe+0x1ac/0x2e0 [ 20.205770] [0000000000701f90] driver_probe_device+0x50/0x100 [ 20.205843] [0000000000702134] __driver_attach+0xf4/0x120 [ 20.205913] [0000000000700644] bus_for_each_dev+0x44/0x80 [ 20.206081] [0000000000700c98] bus_add_driver+0x198/0x220 [ 20.206300] [0000000000702950] driver_register+0x70/0x120 [ 20.206582] [0000000010248224] qla2x00_module_init+0x224/0x284 [qla2xxx] [ 20.206857] ---[ end trace b1de7a3f79fab2c2 ]--- The fix is to check if the hardware does not have Multi Queue capabiltiy, use pci_alloc_irq_vectors() call instead of pci_alloc_irq_affinity(). Fixes: f664a3cc17b7d ("scsi: kill off the legacy IO path") Cc: stable@vger.kernel.org #4.19 Signed-off-by: Giridhar Malavali Signed-off-by: Himanshu Madhani --- Hi Martin, This patch fixes issue, if BLK-MQ is enabled, driver will not map IRQ affinity if the hardware does not support MQ. This was reported by Meelis Ross here https://marc.info/?l=linux-scsi&m=154980175720501&w=2 Please apply this on top of my earlier series for inclusion in 5.1/scsi-queue https://marc.info/?l=linux-scsi&m=155027035917217&w=2 Thanks, Himanshu --- drivers/scsi/qla2xxx/qla_isr.c | 2 +- drivers/scsi/qla2xxx/qla_os.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index b5ae76869d5b..89ee82e6773b 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -3431,7 +3431,7 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) min_vecs++; } - if (USER_CTRL_IRQ(ha)) { + if (USER_CTRL_IRQ(ha) || !ha->mqiobase) { /* user wants to control IRQ setting for target mode */ ret = pci_alloc_irq_vectors(ha->pdev, min_vecs, ha->msix_count, PCI_IRQ_MSIX); diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 7bf23943c815..84cd6bff8b12 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -7181,7 +7181,7 @@ static int qla2xxx_map_queues(struct Scsi_Host *shost) scsi_qla_host_t *vha = (scsi_qla_host_t *)shost->hostdata; struct blk_mq_queue_map *qmap = &shost->tag_set.map[0]; - if (USER_CTRL_IRQ(vha->hw)) + if (USER_CTRL_IRQ(vha->hw) || !vha->hw->mqiobase) rc = blk_mq_map_queues(qmap); else rc = blk_mq_pci_map_queues(qmap, vha->hw->pdev, 0);