Skip to content

Commit

Permalink
[PATCH] Use pci_set_consistent_dma_mask in ixgb driver
Browse files Browse the repository at this point in the history
The ixgb driver is using pci_alloc_consistent, thus is should also use
pci_set_consistent_dma_mask.  This allows the driver to work on SGI
systems.

In case of an error during probing it should also disable the device again.

Signed-off-by: Andreas Schwab <schwab@suse.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Andreas Schwab authored and Jeff Garzik committed Apr 12, 2006
1 parent 43f2f10 commit c91e468
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions drivers/net/ixgb/ixgb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,18 +357,20 @@ ixgb_probe(struct pci_dev *pdev,
if((err = pci_enable_device(pdev)))
return err;

if(!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) {
if(!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK)) &&
!(err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK))) {
pci_using_dac = 1;
} else {
if((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) {
if((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK)) ||
(err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK))) {
IXGB_ERR("No usable DMA configuration, aborting\n");
return err;
goto err_dma_mask;
}
pci_using_dac = 0;
}

if((err = pci_request_regions(pdev, ixgb_driver_name)))
return err;
goto err_request_regions;

pci_set_master(pdev);

Expand Down Expand Up @@ -502,6 +504,9 @@ ixgb_probe(struct pci_dev *pdev,
free_netdev(netdev);
err_alloc_etherdev:
pci_release_regions(pdev);
err_request_regions:
err_dma_mask:
pci_disable_device(pdev);
return err;
}

Expand Down

0 comments on commit c91e468

Please sign in to comment.