Commit 11ea3824 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Martin K. Petersen

scsi: bfa: 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.

[mkp: fixed commit message]

Fixes: a69b0800 ("scsi: bfa: use dma_set_mask_and_coherent")
Cc: <stable@vger.kernel.org>
Suggested-by: default avatarEwan D. Milne <emilne@redhat.com>
Signed-off-by: default avatarHannes Reinecke <hare@suse.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarEwan D. Milne <emilne@redhat.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent c326de56
...@@ -739,8 +739,12 @@ bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad) ...@@ -739,8 +739,12 @@ bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad)
pci_set_master(pdev); pci_set_master(pdev);
if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) || rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) { if (rc)
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (rc) {
rc = -ENODEV;
printk(KERN_ERR "dma_set_mask_and_coherent fail %p\n", pdev); printk(KERN_ERR "dma_set_mask_and_coherent fail %p\n", pdev);
goto out_release_region; goto out_release_region;
} }
...@@ -1534,6 +1538,7 @@ bfad_pci_slot_reset(struct pci_dev *pdev) ...@@ -1534,6 +1538,7 @@ bfad_pci_slot_reset(struct pci_dev *pdev)
{ {
struct bfad_s *bfad = pci_get_drvdata(pdev); struct bfad_s *bfad = pci_get_drvdata(pdev);
u8 byte; u8 byte;
int rc;
dev_printk(KERN_ERR, &pdev->dev, dev_printk(KERN_ERR, &pdev->dev,
"bfad_pci_slot_reset flags: 0x%x\n", bfad->bfad_flags); "bfad_pci_slot_reset flags: 0x%x\n", bfad->bfad_flags);
...@@ -1561,8 +1566,11 @@ bfad_pci_slot_reset(struct pci_dev *pdev) ...@@ -1561,8 +1566,11 @@ bfad_pci_slot_reset(struct pci_dev *pdev)
pci_save_state(pdev); pci_save_state(pdev);
pci_set_master(pdev); pci_set_master(pdev);
if (dma_set_mask_and_coherent(&bfad->pcidev->dev, DMA_BIT_MASK(64)) || rc = dma_set_mask_and_coherent(&bfad->pcidev->dev, DMA_BIT_MASK(64));
dma_set_mask_and_coherent(&bfad->pcidev->dev, DMA_BIT_MASK(32))) if (rc)
rc = dma_set_mask_and_coherent(&bfad->pcidev->dev,
DMA_BIT_MASK(32));
if (rc)
goto out_disable_device; goto out_disable_device;
if (restart_bfa(bfad) == -1) if (restart_bfa(bfad) == -1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment