Skip to content

Commit

Permalink
ipr: set coherent DMA mask
Browse files Browse the repository at this point in the history
Use dma_set_mask_and_coherent() to set both the DMA and coherent
DMA mask.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Anton Blanchard authored and Christoph Hellwig committed Nov 12, 2014
1 parent d73341b commit 869404c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions drivers/scsi/ipr.c
Original file line number Diff line number Diff line change
Expand Up @@ -9582,16 +9582,17 @@ static int ipr_probe_ioa(struct pci_dev *pdev,
ipr_init_regs(ioa_cfg);

if (ioa_cfg->sis64) {
rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if (rc < 0) {
dev_dbg(&pdev->dev, "Failed to set 64 bit PCI DMA mask\n");
rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
dev_dbg(&pdev->dev, "Failed to set 64 bit DMA mask\n");
rc = dma_set_mask_and_coherent(&pdev->dev,
DMA_BIT_MASK(32));
}
} else
rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));

if (rc < 0) {
dev_err(&pdev->dev, "Failed to set PCI DMA mask\n");
dev_err(&pdev->dev, "Failed to set DMA mask\n");
goto cleanup_nomem;
}

Expand Down

0 comments on commit 869404c

Please sign in to comment.