Skip to content

Commit

Permalink
scsi: aic94xx: fix calls to dma_set_mask_and_coherent()
Browse files Browse the repository at this point in the history
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.

[mkp: fixed subject]

Fixes: 3a21986 ("scsi: aic94xx: 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>
  • Loading branch information
Hannes Reinecke authored and Martin K. Petersen committed Feb 26, 2019
1 parent 1feb3b0 commit c326de5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/scsi/aic94xx/aic94xx_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,9 +769,11 @@ static int asd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
if (err)
goto Err_remove;

err = -ENODEV;
if (dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64)) ||
dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32))) {
err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64));
if (err)
err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
if (err) {
err = -ENODEV;
asd_printk("no suitable DMA mask for %s\n", pci_name(dev));
goto Err_remove;
}
Expand Down

0 comments on commit c326de5

Please sign in to comment.