Skip to content

Commit 3e344b6

Browse files
hreineckemartinkpetersen
authored andcommitted
scsi: hptiop: fix calls to dma_set_mask()
The change to use dma_set_mask() incorrectly made a second call with the 32 bit DMA mask value when the call with the 64 bit DMA mask value succeeded. Fixes: 453cd37 ("scsi: hptiop: use dma_set_mask") Cc: <[email protected]> Suggested-by: Ewan D. Milne <[email protected]> Signed-off-by: Hannes Reinecke <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Ewan D. Milne <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent d9a0045 commit 3e344b6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/scsi/hptiop.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,7 @@ static int hptiop_probe(struct pci_dev *pcidev, const struct pci_device_id *id)
12921292
dma_addr_t start_phy;
12931293
void *start_virt;
12941294
u32 offset, i, req_size;
1295+
int rc;
12951296

12961297
dprintk("hptiop_probe(%p)\n", pcidev);
12971298

@@ -1308,9 +1309,12 @@ static int hptiop_probe(struct pci_dev *pcidev, const struct pci_device_id *id)
13081309

13091310
/* Enable 64bit DMA if possible */
13101311
iop_ops = (struct hptiop_adapter_ops *)id->driver_data;
1311-
if (dma_set_mask(&pcidev->dev,
1312-
DMA_BIT_MASK(iop_ops->hw_dma_bit_mask)) ||
1313-
dma_set_mask(&pcidev->dev, DMA_BIT_MASK(32))) {
1312+
rc = dma_set_mask(&pcidev->dev,
1313+
DMA_BIT_MASK(iop_ops->hw_dma_bit_mask));
1314+
if (rc)
1315+
rc = dma_set_mask(&pcidev->dev, DMA_BIT_MASK(32));
1316+
1317+
if (rc) {
13141318
printk(KERN_ERR "hptiop: fail to set dma_mask\n");
13151319
goto disable_pci_device;
13161320
}

0 commit comments

Comments
 (0)