From patchwork Wed Apr 16 09:05:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anil Gurumurthy X-Patchwork-Id: 4000351 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 483B9BFF02 for ; Wed, 16 Apr 2014 12:11:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 517AD202F2 for ; Wed, 16 Apr 2014 12:11:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 45740202E6 for ; Wed, 16 Apr 2014 12:11:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752595AbaDPMLU (ORCPT ); Wed, 16 Apr 2014 08:11:20 -0400 Received: from avcashub1.qlogic.com ([198.70.193.115]:22804 "EHLO avcashub1.qlogic.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751377AbaDPMLS (ORCPT ); Wed, 16 Apr 2014 08:11:18 -0400 X-Greylist: delayed 311 seconds by postgrey-1.27 at vger.kernel.org; Wed, 16 Apr 2014 08:11:18 EDT Received: from AVMB2.qlogic.org ([fe80::cdfd:9ba8:5afa:475c]) by avcashub1.qlogic.org ([::1]) with mapi id 14.02.0387.000; Wed, 16 Apr 2014 02:05:11 -0700 From: Anil Gurumurthy To: Alexander Gordeev , linux-kernel CC: linux-scsi , linux-pci Subject: RE: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix() Thread-Topic: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix() Thread-Index: AQHPV7t8fDZIz6CLPUWJwtCLHdmFLpsT9kdw Date: Wed, 16 Apr 2014 09:05:10 +0000 Message-ID: <20B1A3CBD98F3845B3F5F56D8597EF59F827FE@avmb2.qlogic.org> References: <7db0ca73195c7a4b41ec8263e23ffaeb7ff4dce2.1397461652.git.agordeev@redhat.com> In-Reply-To: <7db0ca73195c7a4b41ec8263e23ffaeb7ff4dce2.1397461652.git.agordeev@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <20B1A3CBD98F3845B3F5F56D8597EF59F827FE@avmb2.qlogic.org> x-originating-ip: [10.1.4.10] MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Patch look good. Acked-by: Anil Gurumurthy -----Original Message----- From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-owner@vger.kernel.org] On Behalf Of Alexander Gordeev Sent: 14 April 2014 13:35 To: linux-kernel Cc: Alexander Gordeev; Anil Gurumurthy; Vijaya Mohan Guvva; linux-scsi; linux-pci Subject: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix() As result of deprecation of MSI-X/MSI enablement functions pci_enable_msix() and pci_enable_msi_block() all drivers using these two interfaces need to be updated to use the new pci_enable_msi_range() or pci_enable_msi_exact() and pci_enable_msix_range() or pci_enable_msix_exact() interfaces. Signed-off-by: Alexander Gordeev Cc: Anil Gurumurthy Cc: Vijaya Mohan Guvva Cc: linux-scsi@vger.kernel.org Cc: linux-pci@vger.kernel.org --- drivers/scsi/bfa/bfad.c | 20 ++++++-------------- 1 files changed, 6 insertions(+), 14 deletions(-) -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index e7e4774..839c81c 100644 --- a/drivers/scsi/bfa/bfad.c +++ b/drivers/scsi/bfa/bfad.c @@ -1234,29 +1234,21 @@ bfad_setup_intr(struct bfad_s *bfad) if ((bfa_asic_id_ctc(pdev->device) && !msix_disable_ct) || (bfa_asic_id_cb(pdev->device) && !msix_disable_cb)) { - error = pci_enable_msix(bfad->pcidev, msix_entries, bfad->nvec); + error = pci_enable_msix_exact(bfad->pcidev, + msix_entries, bfad->nvec); /* In CT1 & CT2, try to allocate just one vector */ - if (error > 0 && bfa_asic_id_ctc(pdev->device)) { + if (error == -ENOSPC && bfa_asic_id_ctc(pdev->device)) { printk(KERN_WARNING "bfa %s: trying one msix " "vector failed to allocate %d[%d]\n", bfad->pci_name, bfad->nvec, error); bfad->nvec = 1; - error = pci_enable_msix(bfad->pcidev, - msix_entries, bfad->nvec); + error = pci_enable_msix_exact(bfad->pcidev, + msix_entries, 1); } - /* - * Only error number of vector is available. - * We don't have a mechanism to map multiple - * interrupts into one vector, so even if we - * can try to request less vectors, we don't - * know how to associate interrupt events to - * vectors. Linux doesn't duplicate vectors - * in the MSIX table for this case. - */ if (error) { printk(KERN_WARNING "bfad%d: " - "pci_enable_msix failed (%d), " + "pci_enable_msix_exact failed (%d), " "use line based.\n", bfad->inst_no, error); goto line_based;