Skip to content

Commit 624dbf5

Browse files
govindarajuludavem330
authored andcommitted
driver/net: enic: Try DMA 64 first, then failover to DMA
In servers with more than 1.1 TB of RAM, the existing 40/32 bit DMA could cause failure as the DMA-able address could go outside the range addressable using 40/32 bits. The following patch first tried 64 bit DMA if possible, failover to 32 bit. Signed-off-by: Sujith Sankar <ssujith@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: Govindarajulu Varadarajan <govindarajulu90@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent bf751ba commit 624dbf5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/ethernet/cisco/enic/enic_main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,11 +2080,11 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
20802080
pci_set_master(pdev);
20812081

20822082
/* Query PCI controller on system for DMA addressing
2083-
* limitation for the device. Try 40-bit first, and
2083+
* limitation for the device. Try 64-bit first, and
20842084
* fail to 32-bit.
20852085
*/
20862086

2087-
err = pci_set_dma_mask(pdev, DMA_BIT_MASK(40));
2087+
err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
20882088
if (err) {
20892089
err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
20902090
if (err) {
@@ -2098,10 +2098,10 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
20982098
goto err_out_release_regions;
20992099
}
21002100
} else {
2101-
err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(40));
2101+
err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
21022102
if (err) {
21032103
dev_err(dev, "Unable to obtain %u-bit DMA "
2104-
"for consistent allocations, aborting\n", 40);
2104+
"for consistent allocations, aborting\n", 64);
21052105
goto err_out_release_regions;
21062106
}
21072107
using_dac = 1;

0 commit comments

Comments
 (0)