diff options
author | Hannes Reinecke <hare@suse.de> | 2019-02-18 02:34:21 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-02-25 21:37:26 -0500 |
commit | 1feb3b02294994ee3a067c9b6cda6c244fd0ee18 (patch) | |
tree | 0a78f1c5aad665c163374e23972a6b585f394fa0 | |
parent | 33d6667416c73eb0b37f0f10f56d825b15389dab (diff) |
scsi: 3w-sas: fix calls to dma_set_mask_and_coherent()
The change to use dma_set_mask_and_coherent() incorrectly made a second
call with the 32 bit DMA mask value when the call with the 64 bit DMA mask
value succeeded.
Fixes: b1fa122930c4 ("scsi: 3w-sas: fully convert to the generic DMA API")
Cc: <stable@vger.kernel.org>
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/3w-sas.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c index e8f5f7c63190..2d15b878bd94 100644 --- a/drivers/scsi/3w-sas.c +++ b/drivers/scsi/3w-sas.c | |||
@@ -1572,8 +1572,10 @@ static int twl_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id) | |||
1572 | pci_set_master(pdev); | 1572 | pci_set_master(pdev); |
1573 | pci_try_set_mwi(pdev); | 1573 | pci_try_set_mwi(pdev); |
1574 | 1574 | ||
1575 | if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) || | 1575 | retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); |
1576 | dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) { | 1576 | if (retval) |
1577 | retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); | ||
1578 | if (retval) { | ||
1577 | TW_PRINTK(host, TW_DRIVER, 0x18, "Failed to set dma mask"); | 1579 | TW_PRINTK(host, TW_DRIVER, 0x18, "Failed to set dma mask"); |
1578 | retval = -ENODEV; | 1580 | retval = -ENODEV; |
1579 | goto out_disable_device; | 1581 | goto out_disable_device; |
@@ -1804,8 +1806,10 @@ static int twl_resume(struct pci_dev *pdev) | |||
1804 | pci_set_master(pdev); | 1806 | pci_set_master(pdev); |
1805 | pci_try_set_mwi(pdev); | 1807 | pci_try_set_mwi(pdev); |
1806 | 1808 | ||
1807 | if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) || | 1809 | retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); |
1808 | dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) { | 1810 | if (retval) |
1811 | retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); | ||
1812 | if (retval) { | ||
1809 | TW_PRINTK(host, TW_DRIVER, 0x25, "Failed to set dma mask during resume"); | 1813 | TW_PRINTK(host, TW_DRIVER, 0x25, "Failed to set dma mask during resume"); |
1810 | retval = -ENODEV; | 1814 | retval = -ENODEV; |
1811 | goto out_disable_device; | 1815 | goto out_disable_device; |