Commit 21da01fd authored by Sasha Neftin's avatar Sasha Neftin Committed by Jeff Kirsher

igc: Improve the DMA mapping flow

Improve the probe flow and set both the DMA mask and the coherent
to the same thing. Make the flow optimized and cleared.
Signed-off-by: default avatarSasha Neftin <sasha.neftin@intel.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent b7b46245
...@@ -4345,32 +4345,26 @@ static int igc_probe(struct pci_dev *pdev, ...@@ -4345,32 +4345,26 @@ static int igc_probe(struct pci_dev *pdev,
struct net_device *netdev; struct net_device *netdev;
struct igc_hw *hw; struct igc_hw *hw;
const struct igc_info *ei = igc_info_tbl[ent->driver_data]; const struct igc_info *ei = igc_info_tbl[ent->driver_data];
int err; int err, pci_using_dac;
err = pci_enable_device_mem(pdev); err = pci_enable_device_mem(pdev);
if (err) if (err)
return err; return err;
err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)); pci_using_dac = 0;
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if (!err) { if (!err) {
err = dma_set_coherent_mask(&pdev->dev, pci_using_dac = 1;
DMA_BIT_MASK(64));
} else { } else {
err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (err) { if (err) {
err = dma_set_coherent_mask(&pdev->dev, dev_err(&pdev->dev,
DMA_BIT_MASK(32)); "No usable DMA configuration, aborting\n");
if (err) { goto err_dma;
dev_err(&pdev->dev, "igc: Wrong DMA config\n");
goto err_dma;
}
} }
} }
err = pci_request_selected_regions(pdev, err = pci_request_mem_regions(pdev, igc_driver_name);
pci_select_bars(pdev,
IORESOURCE_MEM),
igc_driver_name);
if (err) if (err)
goto err_pci_reg; goto err_pci_reg;
......
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