diff options
| author | Alexander Gordeev <agordeev@redhat.com> | 2014-02-19 03:58:21 -0500 |
|---|---|---|
| committer | Jens Axboe <axboe@fb.com> | 2014-02-21 18:45:26 -0500 |
| commit | a9df862564941f3613b26b4204af1d33aae33c24 (patch) | |
| tree | 90b486a451fd685212f693146d98397552aef938 | |
| parent | 1bc5ce5df95f6366e38d509cfac3c75e4554fdd2 (diff) | |
skd: Use pci_enable_msix_range() 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() and pci_enable_msix_range()
interfaces.
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@fb.com>
| -rw-r--r-- | 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 1cd1095cf8e6..a69dd93d1bd5 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) | |||
| 3932 | 3932 | ||
| 3933 | static int skd_acquire_msix(struct skd_device *skdev) | 3933 | static int skd_acquire_msix(struct skd_device *skdev) |
| 3934 | { | 3934 | { |
| 3935 | int i, rc, msix_count = SKD_MAX_MSIX_COUNT; | 3935 | int i, rc; |
| 3936 | struct pci_dev *pdev = skdev->pdev; | 3936 | struct pci_dev *pdev = skdev->pdev; |
| 3937 | struct msix_entry *entries; | 3937 | struct msix_entry *entries; |
| 3938 | struct skd_msix_entry *qentry; | 3938 | struct skd_msix_entry *qentry; |
| 3939 | 3939 | ||
| 3940 | entries = kzalloc(sizeof(struct msix_entry) * msix_count, GFP_KERNEL); | 3940 | entries = kzalloc(sizeof(struct msix_entry) * SKD_MAX_MSIX_COUNT, |
| 3941 | GFP_KERNEL); | ||
| 3941 | if (!entries) | 3942 | if (!entries) |
| 3942 | return -ENOMEM; | 3943 | return -ENOMEM; |
| 3943 | 3944 | ||
| 3944 | for (i = 0; i < msix_count; i++) | 3945 | for (i = 0; i < SKD_MAX_MSIX_COUNT; i++) |
| 3945 | entries[i].entry = i; | 3946 | entries[i].entry = i; |
| 3946 | 3947 | ||
| 3947 | rc = pci_enable_msix(pdev, entries, msix_count); | 3948 | rc = pci_enable_msix_range(pdev, entries, |
| 3948 | if (rc < 0) | 3949 | SKD_MIN_MSIX_COUNT, SKD_MAX_MSIX_COUNT); |
| 3950 | if (rc < 0) { | ||
| 3951 | pr_err("(%s): failed to enable MSI-X %d\n", | ||
| 3952 | skd_name(skdev), rc); | ||
| 3949 | goto msix_out; | 3953 | goto msix_out; |
| 3950 | else if (rc) { | ||
| 3951 | if (rc < SKD_MIN_MSIX_COUNT) { | ||
| 3952 | pr_err("(%s): failed to enable MSI-X %d\n", | ||
| 3953 | skd_name(skdev), rc); | ||
| 3954 | goto msix_out; | ||
| 3955 | } | ||
| 3956 | pr_debug("%s:%s:%d %s: <%s> allocated %d MSI-X vectors\n", | ||
| 3957 | skdev->name, __func__, __LINE__, | ||
| 3958 | pci_name(pdev), skdev->name, rc); | ||
| 3959 | |||
| 3960 | msix_count = rc; | ||
| 3961 | rc = pci_enable_msix(pdev, entries, msix_count); | ||
| 3962 | if (rc) { | ||
| 3963 | pr_err("(%s): failed to enable MSI-X " | ||
| 3964 | "support (%d) %d\n", | ||
| 3965 | skd_name(skdev), msix_count, rc); | ||
| 3966 | goto msix_out; | ||
| 3967 | } | ||
| 3968 | } | 3954 | } |
| 3969 | 3955 | ||
| 3970 | skdev->msix_count = msix_count; | 3956 | skdev->msix_count = rc; |
| 3971 | skdev->msix_entries = kzalloc(sizeof(struct skd_msix_entry) * | 3957 | skdev->msix_entries = kzalloc(sizeof(struct skd_msix_entry) * |
| 3972 | skdev->msix_count, GFP_KERNEL); | 3958 | skdev->msix_count, GFP_KERNEL); |
| 3973 | if (!skdev->msix_entries) { | 3959 | if (!skdev->msix_entries) { |
| @@ -4046,8 +4032,8 @@ RETRY_IRQ_TYPE: | |||
| 4046 | case SKD_IRQ_MSI: | 4032 | case SKD_IRQ_MSI: |
| 4047 | snprintf(skdev->isr_name, sizeof(skdev->isr_name), "%s%d-msi", | 4033 | snprintf(skdev->isr_name, sizeof(skdev->isr_name), "%s%d-msi", |
| 4048 | DRV_NAME, skdev->devno); | 4034 | DRV_NAME, skdev->devno); |
| 4049 | rc = pci_enable_msi(pdev); | 4035 | rc = pci_enable_msi_range(pdev, 1, 1); |
| 4050 | if (!rc) { | 4036 | if (rc > 0) { |
| 4051 | rc = devm_request_irq(&pdev->dev, pdev->irq, skd_isr, 0, | 4037 | rc = devm_request_irq(&pdev->dev, pdev->irq, skd_isr, 0, |
| 4052 | skdev->isr_name, skdev); | 4038 | skdev->isr_name, skdev); |
| 4053 | if (rc) { | 4039 | if (rc) { |
