The DMA API guarantees support for masks of 32 bits or wider and explicitly identifies retrying a 32-bit mask after a wider request as incorrect: https://docs.kernel.org/core-api/dma-api-howto.html#dma-addressing-capabilities Remove the obsolete fallback while retaining the error check so that a genuine DMA setup failure is still reported and aborts initialization. A successful setup now necessarily uses the 47-bit mask, so remove the redundant using_dac flag and advertise NETIF_F_HIGHDMA directly. Signed-off-by: Ruizhe Zhou --- drivers/net/ethernet/cisco/enic/enic_main.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c index 0baef7a120ec..d32fd03bbf6a 100644 --- a/drivers/net/ethernet/cisco/enic/enic_main.c +++ b/drivers/net/ethernet/cisco/enic/enic_main.c @@ -2991,7 +2991,6 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct device *dev = &pdev->dev; struct net_device *netdev; struct enic *enic; - int using_dac = 0; unsigned int i; int err; #ifdef CONFIG_PCI_IOV @@ -3033,20 +3032,11 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) pci_set_master(pdev); - /* Query PCI controller on system for DMA addressing - * limitation for the device. Try 47-bit first, and - * fail to 32-bit. - */ - + /* The device supports DMA addresses up to 47 bits. */ err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(47)); if (err) { - err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); - if (err) { - dev_err(dev, "No usable DMA configuration, aborting\n"); - goto err_out_release_regions; - } - } else { - using_dac = 1; + dev_err(dev, "No usable DMA configuration, aborting\n"); + goto err_out_release_regions; } /* Map vNIC resources from BAR0-5 @@ -3319,8 +3309,7 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) netdev->hw_features |= NETIF_F_NTUPLE; #endif - if (using_dac) - netdev->features |= NETIF_F_HIGHDMA; + netdev->features |= NETIF_F_HIGHDMA; netdev->priv_flags |= IFF_UNICAST_FLT; -- 2.27.0