Skip to content

Commit 0dcae66

Browse files
DerDakonJames Bottomley
authored andcommitted
[SCSI] aacraid: Do not set DMA mask to 32 bit first if adapter only supports 31
Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de> Acked-by: Achim Leubner <Achim_Leubner@pmc-sierra.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
1 parent 0c47087 commit 0dcae66

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

‎drivers/scsi/aacraid/linit.c‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
10911091
struct list_head *insert = &aac_devices;
10921092
int error = -ENODEV;
10931093
int unique_id = 0;
1094+
u64 dmamask;
10941095

10951096
list_for_each_entry(aac, &aac_devices, entry) {
10961097
if (aac->id > unique_id)
@@ -1104,17 +1105,18 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
11041105
goto out;
11051106
error = -ENODEV;
11061107

1107-
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) ||
1108-
pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)))
1109-
goto out_disable_pdev;
11101108
/*
11111109
* If the quirk31 bit is set, the adapter needs adapter
11121110
* to driver communication memory to be allocated below 2gig
11131111
*/
11141112
if (aac_drivers[index].quirks & AAC_QUIRK_31BIT)
1115-
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(31)) ||
1116-
pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(31)))
1117-
goto out_disable_pdev;
1113+
dmamask = DMA_BIT_MASK(31);
1114+
else
1115+
dmamask = DMA_BIT_MASK(32);
1116+
1117+
if (pci_set_dma_mask(pdev, dmamask) ||
1118+
pci_set_consistent_dma_mask(pdev, dmamask))
1119+
goto out_disable_pdev;
11181120

11191121
pci_set_master(pdev);
11201122

0 commit comments

Comments
 (0)