From patchwork Wed Feb 19 08:58:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Gordeev X-Patchwork-Id: 321783 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 272C32C020A for ; Wed, 19 Feb 2014 19:57:32 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752168AbaBSI5B (ORCPT ); Wed, 19 Feb 2014 03:57:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5242 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753138AbaBSI4s (ORCPT ); Wed, 19 Feb 2014 03:56:48 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1J8ui4a024422 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 19 Feb 2014 03:56:44 -0500 Received: from dhcp-26-207.brq.redhat.com (vpn-55-192.rdu2.redhat.com [10.10.55.192]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s1J8uOYx003605; Wed, 19 Feb 2014 03:56:42 -0500 From: Alexander Gordeev To: linux-kernel@vger.kernel.org Cc: Alexander Gordeev , Jens Axboe , Bartlomiej Zolnierkiewicz , Kyungmin Park , linux-pci@vger.kernel.org Subject: [PATCH 9/9] skd: Use pci_enable_msix_range() instead of pci_enable_msix() Date: Wed, 19 Feb 2014 09:58:21 +0100 Message-Id: <916f0aad90121bc7d2d43deb4088c63f600c1d20.1392799752.git.agordeev@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 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() and pci_enable_msix_range() interfaces. Signed-off-by: Alexander Gordeev Cc: Jens Axboe Cc: Bartlomiej Zolnierkiewicz Cc: Kyungmin Park Cc: linux-pci@vger.kernel.org --- drivers/block/skd_main.c | 38 ++++++++++++-------------------------- 1 files changed, 12 insertions(+), 26 deletions(-) diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c index 1cd1095..a69dd93 100644 --- a/drivers/block/skd_main.c +++ b/drivers/block/skd_main.c @@ -3932,42 +3932,28 @@ static void skd_release_msix(struct skd_device *skdev) static int skd_acquire_msix(struct skd_device *skdev) { - int i, rc, msix_count = SKD_MAX_MSIX_COUNT; + int i, rc; struct pci_dev *pdev = skdev->pdev; struct msix_entry *entries; struct skd_msix_entry *qentry; - entries = kzalloc(sizeof(struct msix_entry) * msix_count, GFP_KERNEL); + entries = kzalloc(sizeof(struct msix_entry) * SKD_MAX_MSIX_COUNT, + GFP_KERNEL); if (!entries) return -ENOMEM; - for (i = 0; i < msix_count; i++) + for (i = 0; i < SKD_MAX_MSIX_COUNT; i++) entries[i].entry = i; - rc = pci_enable_msix(pdev, entries, msix_count); - if (rc < 0) + rc = pci_enable_msix_range(pdev, entries, + SKD_MIN_MSIX_COUNT, SKD_MAX_MSIX_COUNT); + if (rc < 0) { + pr_err("(%s): failed to enable MSI-X %d\n", + skd_name(skdev), rc); goto msix_out; - else if (rc) { - if (rc < SKD_MIN_MSIX_COUNT) { - pr_err("(%s): failed to enable MSI-X %d\n", - skd_name(skdev), rc); - goto msix_out; - } - pr_debug("%s:%s:%d %s: <%s> allocated %d MSI-X vectors\n", - skdev->name, __func__, __LINE__, - pci_name(pdev), skdev->name, rc); - - msix_count = rc; - rc = pci_enable_msix(pdev, entries, msix_count); - if (rc) { - pr_err("(%s): failed to enable MSI-X " - "support (%d) %d\n", - skd_name(skdev), msix_count, rc); - goto msix_out; - } } - skdev->msix_count = msix_count; + skdev->msix_count = rc; skdev->msix_entries = kzalloc(sizeof(struct skd_msix_entry) * skdev->msix_count, GFP_KERNEL); if (!skdev->msix_entries) { @@ -4046,8 +4032,8 @@ RETRY_IRQ_TYPE: case SKD_IRQ_MSI: snprintf(skdev->isr_name, sizeof(skdev->isr_name), "%s%d-msi", DRV_NAME, skdev->devno); - rc = pci_enable_msi(pdev); - if (!rc) { + rc = pci_enable_msi_range(pdev, 1, 1); + if (rc > 0) { rc = devm_request_irq(&pdev->dev, pdev->irq, skd_isr, 0, skdev->isr_name, skdev); if (rc) {