From patchwork Mon Apr 14 08:05:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Gordeev X-Patchwork-Id: 338878 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 77ECC1400F4 for ; Mon, 14 Apr 2014 18:27:54 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752045AbaDNI1Z (ORCPT ); Mon, 14 Apr 2014 04:27:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41447 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753276AbaDNIEJ (ORCPT ); Mon, 14 Apr 2014 04:04:09 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s3E8487l027935 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Apr 2014 04:04:08 -0400 Received: from dhcp-26-207.brq.redhat.com (dhcp-26-119.brq.redhat.com [10.34.26.119]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s3E83wdL024046; Mon, 14 Apr 2014 04:04:07 -0400 From: Alexander Gordeev To: linux-kernel@vger.kernel.org Cc: Alexander Gordeev , Anil Gurumurthy , Vijaya Mohan Guvva , linux-scsi@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix() Date: Mon, 14 Apr 2014 10:05:28 +0200 Message-Id: <7db0ca73195c7a4b41ec8263e23ffaeb7ff4dce2.1397461652.git.agordeev@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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(-) 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;