From 03011820f02feedbffa25254bdc25ff3a9800c6a Mon Sep 17 00:00:00 2001 From: Ruizhe Zhou Date: Thu, 3 Sep 2026 16:43:39 +0800 Subject: [PATCH] net: niu: Remove obsolete 32-bit DMA mask fallback 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 44-bit mask, so advertise NETIF_F_HIGHDMA directly after checking the result. Signed-off-by: Ruizhe Zhou Link: https://patch.msgid.link/20260903084339.870562-15-zhouruizhe@resnics.com Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/sun/niu.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c index 54dd7281191d..c74a97fe5464 100644 --- a/drivers/net/ethernet/sun/niu.c +++ b/drivers/net/ethernet/sun/niu.c @@ -9835,15 +9835,11 @@ static int niu_pci_init_one(struct pci_dev *pdev, PCI_EXP_DEVCTL_RELAX_EN); err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(44)); - if (!err) - dev->features |= NETIF_F_HIGHDMA; if (err) { - err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); - if (err) { - dev_err(&pdev->dev, "No usable DMA configuration, aborting\n"); - goto err_out_release_parent; - } + dev_err(&pdev->dev, "No usable DMA configuration, aborting\n"); + goto err_out_release_parent; } + dev->features |= NETIF_F_HIGHDMA; niu_set_basic_features(dev);