Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 00/14] net: Remove obsolete 32-bit DMA mask fallbacks
@ 2026-09-03  8:43 Ruizhe Zhou
  2026-09-03  8:43 ` [PATCH net-next 01/14] net: atlantic: Remove obsolete 32-bit DMA mask fallback Ruizhe Zhou
                   ` (13 more replies)
  0 siblings, 14 replies; 17+ messages in thread
From: Ruizhe Zhou @ 2026-09-03  8:43 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Sukhdeep Singh, Chris Snook, Florian Fainelli,
	Michael Chan, Pavan Chebbi, Satish Kharat, Jian Shen, Jijie Shao,
	Tony Nguyen, Przemek Kitszel, Tariq Toukan, Saeed Mahameed,
	Leon Romanovsky, Mark Bloch, Ido Schimmel, Petr Machata,
	Alexander Duyck
  Cc: netdev, linux-kernel, Ruizhe Zhou

A lot of Ethernet drivers set a >32 bit DMA mask and retry with a
32-bit mask if the first call fails. This treats the return value of
dma_set_mask_and_coherent() as an indication that the platform requires
a narrower DMA width.

That is not a correct interpretation of dma_set_mask_and_coherent().
The mask describes the DMA addresses the device can accept and constrains
subsequent mappings to that range. A wider mask includes every address
permitted by a 32-bit mask, including addresses from a platform that only
produces 32-bit DMA addresses. Retrying with 32 bits therefore adds a stricter
constraint and cannot correct a failure to establish the wider mask.
The DMA API HOWTO explicitly calls this fallback pattern incorrect [1].
See [2] and [3] for details.

A net subsystem tree-wide audit found 28 Ethernet drivers with this pattern.
This series contains 14 straightforward cases where the fallback can be
removed without changing the mask selected for the device. The return-value
check is retained. DMA setup errors are still reported and still abort device
initialization. The other 14 cases are less straightforward. So I will submit
those as a separate follow-up after review of this series concludes and any
issues are resolved.

Testing was compile-only. No hardware testing was performed.

[1] DMA API HOWTO, "DMA addressing capabilities"
https://docs.kernel.org/core-api/dma-api-howto.html#dma-addressing-capabilities

[2] DMA direct addressability change, commit 91ef26f91417
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=91ef26f914171cf753330f13724fd9142b5b1640

[3] DMA HOWTO correction, commit f7ae20f2fc4e
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f7ae20f2fc4e

Best regards,
Ruizhe Zhou

Ruizhe Zhou (14):
  net: atlantic: Remove obsolete 32-bit DMA mask fallback
  net: alx: Remove obsolete 32-bit DMA mask fallback
  net: systemport: Remove obsolete 32-bit DMA mask fallback
  bnxt_en: Remove obsolete 32-bit DMA mask fallback
  enic: Remove obsolete 32-bit DMA mask fallback
  net: hns3: Remove obsolete 32-bit DMA mask fallback
  fm10k: Remove obsolete 32-bit DMA mask fallback
  net/mlx4: Remove obsolete 32-bit DMA mask fallback
  net/mlx5: Remove obsolete 32-bit DMA mask fallback
  mlxsw: pci: Remove obsolete 32-bit DMA mask fallback
  eth: fbnic: Remove obsolete 32-bit DMA mask fallback
  net: pch_gbe: Remove obsolete 32-bit DMA mask fallback
  net: renesas: rswitch: Remove obsolete 32-bit DMA mask fallback
  net: niu: Remove obsolete 32-bit DMA mask fallback

 .../ethernet/aquantia/atlantic/aq_pci_func.c  |  2 --
 drivers/net/ethernet/atheros/alx/main.c       | 13 +++++--------
 drivers/net/ethernet/broadcom/bcmsysport.c    |  2 --
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     |  4 ++--
 drivers/net/ethernet/cisco/enic/enic_main.c   | 19 ++++---------------
 .../hisilicon/hns3/hns3pf/hclge_main.c        |  9 ++-------
 drivers/net/ethernet/intel/fm10k/fm10k_pci.c  |  2 --
 drivers/net/ethernet/mellanox/mlx4/main.c     |  8 ++------
 .../net/ethernet/mellanox/mlx5/core/main.c    |  8 ++------
 drivers/net/ethernet/mellanox/mlxsw/pci.c     |  7 ++-----
 drivers/net/ethernet/meta/fbnic/fbnic_pci.c   |  2 --
 .../ethernet/oki-semi/pch_gbe/pch_gbe_main.c  | 10 ++++------
 drivers/net/ethernet/renesas/rswitch_main.c   |  7 ++-----
 drivers/net/ethernet/sun/niu.c                | 10 +++-------
 14 files changed, 28 insertions(+), 75 deletions(-)


base-commit: e16acadb9a0f7a0f04318e4b3a8e89e8ddd0c905
--
2.27.0

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2026-09-04 16:01 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03  8:43 [PATCH net-next 00/14] net: Remove obsolete 32-bit DMA mask fallbacks Ruizhe Zhou
2026-09-03  8:43 ` [PATCH net-next 01/14] net: atlantic: Remove obsolete 32-bit DMA mask fallback Ruizhe Zhou
2026-09-03  8:43 ` [PATCH net-next 02/14] net: alx: " Ruizhe Zhou
2026-09-03  8:43 ` [PATCH net-next 03/14] net: systemport: " Ruizhe Zhou
2026-09-03  8:43 ` [PATCH net-next 04/14] bnxt_en: " Ruizhe Zhou
2026-09-03  8:43 ` [PATCH net-next 05/14] enic: " Ruizhe Zhou
2026-09-03  8:43 ` [PATCH net-next 06/14] net: hns3: " Ruizhe Zhou
2026-09-03  8:43 ` [PATCH net-next 07/14] fm10k: " Ruizhe Zhou
2026-09-03  8:43 ` [PATCH net-next 08/14] net/mlx4: " Ruizhe Zhou
2026-09-03  8:43 ` [PATCH net-next 09/14] net/mlx5: " Ruizhe Zhou
2026-09-03  8:43 ` [PATCH net-next 10/14] mlxsw: pci: " Ruizhe Zhou
2026-09-04 16:00   ` Petr Machata
2026-09-03  8:43 ` [PATCH net-next 11/14] eth: fbnic: " Ruizhe Zhou
2026-09-03  8:43 ` [PATCH net-next 12/14] net: pch_gbe: " Ruizhe Zhou
2026-09-03  8:43 ` [PATCH net-next 13/14] net: renesas: rswitch: " Ruizhe Zhou
2026-09-03  9:43   ` Geert Uytterhoeven
2026-09-03  8:43 ` [PATCH net-next 14/14] net: niu: " Ruizhe Zhou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox