diff options
author | Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com> | 2017-04-05 13:44:16 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-04-27 01:28:06 +0300 |
commit | f481973d5efdb63b7c6ca6b0ecd2b8462556a461 (patch) | |
tree | bb254fe9f09a156d6b2768fd006bfc76d2cdb49f /drivers/scsi/aacraid/rx.c | |
parent | 6cf161150d815da0ee8cff158b185bc33dca3a34 (diff) | |
download | linux-f481973d5efdb63b7c6ca6b0ecd2b8462556a461.tar.xz |
scsi: aacraid: pci_alloc_consistent() failures on ARM64
There were pci_alloc_consistent() failures on ARM64 platform. Use
dma_alloc_coherent() with GFP_KERNEL flag DMA memory allocations.
Signed-off-by: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com>
[hch: tweaked indentation, removed memsets]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Dave Carroll <david.carroll@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/aacraid/rx.c')
-rw-r--r-- | drivers/scsi/aacraid/rx.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c index 5d19c31e3bba..93ef7c37e568 100644 --- a/drivers/scsi/aacraid/rx.c +++ b/drivers/scsi/aacraid/rx.c @@ -355,14 +355,16 @@ static int aac_rx_check_health(struct aac_dev *dev) if (likely((status & 0xFF000000L) == 0xBC000000L)) return (status >> 16) & 0xFF; - buffer = pci_alloc_consistent(dev->pdev, 512, &baddr); + buffer = dma_alloc_coherent(&dev->pdev->dev, 512, &baddr, + GFP_KERNEL); ret = -2; if (unlikely(buffer == NULL)) return ret; - post = pci_alloc_consistent(dev->pdev, - sizeof(struct POSTSTATUS), &paddr); + post = dma_alloc_coherent(&dev->pdev->dev, + sizeof(struct POSTSTATUS), &paddr, + GFP_KERNEL); if (unlikely(post == NULL)) { - pci_free_consistent(dev->pdev, 512, buffer, baddr); + dma_free_coherent(&dev->pdev->dev, 512, buffer, baddr); return ret; } memset(buffer, 0, 512); @@ -371,13 +373,13 @@ static int aac_rx_check_health(struct aac_dev *dev) rx_writel(dev, MUnit.IMRx[0], paddr); rx_sync_cmd(dev, COMMAND_POST_RESULTS, baddr, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL); - pci_free_consistent(dev->pdev, sizeof(struct POSTSTATUS), - post, paddr); + dma_free_coherent(&dev->pdev->dev, sizeof(struct POSTSTATUS), + post, paddr); if (likely((buffer[0] == '0') && ((buffer[1] == 'x') || (buffer[1] == 'X')))) { ret = (hex_to_bin(buffer[2]) << 4) + hex_to_bin(buffer[3]); } - pci_free_consistent(dev->pdev, 512, buffer, baddr); + dma_free_coherent(&dev->pdev->dev, 512, buffer, baddr); return ret; } /* |