[PATCH net-next 14/14] net: niu: Remove obsolete 32-bit DMA mask fallback

From: Ruizhe Zhou

Date: Thu Sep 03 2026 - 05:11:29 EST


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 <zhouruizhe@xxxxxxxxxxx>
---
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);

--
2.27.0