Thread (21 messages) flat view 21 messages, 6 authors, 15h ago

Re: [PATCH net-next 13/14] net: renesas: rswitch: Remove obsolete 32-bit DMA mask fallback

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2026-09-03 09:43:17
Also in: linux-renesas-soc, lkml

Hi Ruizhe,

Thanks for your patch!

On Thu, 3 Sept 2026 at 11:27, Ruizhe Zhou [off-list ref] wrote:
The DMA API guarantees support for masks of 32 bits or wider and
Really?
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
AFAIUI, that is only true iff the wider request is DMA_BIT_MASK(64).
Remove the obsolete fallback while retaining the error check so that a
genuine DMA setup failure still aborts initialization.
Have you tested this on actual hardware, with/without IOMMU support?
quoted hunk ↗ jump to hunk
Signed-off-by: Ruizhe Zhou <redacted>
---
 drivers/net/ethernet/renesas/rswitch_main.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/renesas/rswitch_main.c b/drivers/net/ethernet/renesas/rswitch_main.c
index 755232994fcc..64b821ca02f8 100644
--- a/drivers/net/ethernet/renesas/rswitch_main.c
+++ b/drivers/net/ethernet/renesas/rswitch_main.c
@@ -2162,11 +2162,8 @@ static int renesas_eth_sw_probe(struct platform_device *pdev)
                return -ENOMEM;

        ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(40));
-       if (ret < 0) {
-               ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
-               if (ret < 0)
-                       return ret;
-       }
+       if (ret)
+               return ret;

        priv->gwca.index = AGENT_INDEX_GWCA;
        priv->gwca.num_queues = min(RSWITCH_NUM_PORTS * NUM_QUEUES_PER_NDEV,
Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help