* [PATCH net-next 01/14] net: atlantic: Remove obsolete 32-bit DMA mask fallback
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 ` Ruizhe Zhou
2026-09-03 8:43 ` [PATCH net-next 02/14] net: alx: " Ruizhe Zhou
` (12 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Ruizhe Zhou @ 2026-09-03 8:43 UTC (permalink / raw)
To: Sukhdeep Singh, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel, Ruizhe Zhou
The DMA API guarantees support for masks of 32 bits or wider and
explicitly identifies retrying a 32-bit mask after a 64-bit 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 still aborts initialization.
Signed-off-by: Ruizhe Zhou <zhouruizhe@resnics.com>
---
drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
index 005d6ef4fc36..04b3ef840b36 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
@@ -125,8 +125,6 @@ static int aq_pci_func_init(struct pci_dev *pdev)
int err;
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
- if (err)
- err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (err) {
err = -ENOSR;
goto err_exit;
--
2.27.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH net-next 02/14] net: alx: Remove obsolete 32-bit DMA mask fallback
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 ` Ruizhe Zhou
2026-09-03 8:43 ` [PATCH net-next 03/14] net: systemport: " Ruizhe Zhou
` (11 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Ruizhe Zhou @ 2026-09-03 8:43 UTC (permalink / raw)
To: Chris Snook, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel, Ruizhe Zhou
The DMA API guarantees support for masks of 32 bits or wider and
explicitly identifies retrying a 32-bit mask after a 64-bit 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.
Signed-off-by: Ruizhe Zhou <zhouruizhe@resnics.com>
---
drivers/net/ethernet/atheros/alx/main.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
index ab262e66f986..3ca69fd14a5c 100644
--- a/drivers/net/ethernet/atheros/alx/main.c
+++ b/drivers/net/ethernet/atheros/alx/main.c
@@ -1727,15 +1727,12 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
* shared register for the high 32 bits, so only a single, aligned,
* 4 GB physical address range can be used for descriptors.
*/
- if (!dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64))) {
- dev_dbg(&pdev->dev, "DMA to 64-BIT addresses\n");
- } else {
- err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
- if (err) {
- dev_err(&pdev->dev, "No usable DMA config, aborting\n");
- goto out_pci_disable;
- }
+ err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+ if (err) {
+ dev_err(&pdev->dev, "No usable DMA config, aborting\n");
+ goto out_pci_disable;
}
+ dev_dbg(&pdev->dev, "DMA to 64-BIT addresses\n");
err = pci_request_mem_regions(pdev, alx_drv_name);
if (err) {
--
2.27.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH net-next 03/14] net: systemport: Remove obsolete 32-bit DMA mask fallback
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 ` Ruizhe Zhou
2026-09-03 8:43 ` [PATCH net-next 04/14] bnxt_en: " Ruizhe Zhou
` (10 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Ruizhe Zhou @ 2026-09-03 8:43 UTC (permalink / raw)
To: Florian Fainelli, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel, Ruizhe Zhou,
Broadcom internal kernel review list
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.
Signed-off-by: Ruizhe Zhou <zhouruizhe@resnics.com>
---
drivers/net/ethernet/broadcom/bcmsysport.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index 4d06c6ba6641..4f0ec136b606 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -2453,8 +2453,6 @@ static int bcm_sysport_probe(struct platform_device *pdev)
return -EINVAL;
ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(40));
- if (ret)
- ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (ret) {
dev_err(&pdev->dev, "unable to set DMA mask: %d\n", ret);
return ret;
--
2.27.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH net-next 04/14] bnxt_en: Remove obsolete 32-bit DMA mask fallback
2026-09-03 8:43 [PATCH net-next 00/14] net: Remove obsolete 32-bit DMA mask fallbacks Ruizhe Zhou
` (2 preceding siblings ...)
2026-09-03 8:43 ` [PATCH net-next 03/14] net: systemport: " Ruizhe Zhou
@ 2026-09-03 8:43 ` Ruizhe Zhou
2026-09-03 8:43 ` [PATCH net-next 05/14] enic: " Ruizhe Zhou
` (9 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Ruizhe Zhou @ 2026-09-03 8:43 UTC (permalink / raw)
To: Michael Chan, Pavan Chebbi, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel, Ruizhe Zhou
The DMA API guarantees support for masks of 32 bits or wider and
explicitly identifies retrying a 32-bit mask after a 64-bit 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.
Signed-off-by: Ruizhe Zhou <zhouruizhe@resnics.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index d59bcca73a2b..1d5cb53f4258 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -15610,8 +15610,8 @@ static int bnxt_init_board(struct pci_dev *pdev, struct net_device *dev)
goto init_err_disable;
}
- if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) != 0 &&
- dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)) != 0) {
+ rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+ if (rc) {
dev_err(&pdev->dev, "System does not support DMA, aborting\n");
rc = -EIO;
goto init_err_release;
--
2.27.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH net-next 05/14] enic: Remove obsolete 32-bit DMA mask fallback
2026-09-03 8:43 [PATCH net-next 00/14] net: Remove obsolete 32-bit DMA mask fallbacks Ruizhe Zhou
` (3 preceding siblings ...)
2026-09-03 8:43 ` [PATCH net-next 04/14] bnxt_en: " Ruizhe Zhou
@ 2026-09-03 8:43 ` Ruizhe Zhou
2026-09-03 8:43 ` [PATCH net-next 06/14] net: hns3: " Ruizhe Zhou
` (8 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Ruizhe Zhou @ 2026-09-03 8:43 UTC (permalink / raw)
To: Satish Kharat, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel, Ruizhe Zhou
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 <zhouruizhe@resnics.com>
---
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
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH net-next 06/14] net: hns3: Remove obsolete 32-bit DMA mask fallback
2026-09-03 8:43 [PATCH net-next 00/14] net: Remove obsolete 32-bit DMA mask fallbacks Ruizhe Zhou
` (4 preceding siblings ...)
2026-09-03 8:43 ` [PATCH net-next 05/14] enic: " Ruizhe Zhou
@ 2026-09-03 8:43 ` Ruizhe Zhou
2026-09-03 8:43 ` [PATCH net-next 07/14] fm10k: " Ruizhe Zhou
` (7 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Ruizhe Zhou @ 2026-09-03 8:43 UTC (permalink / raw)
To: Jian Shen, Jijie Shao, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel, Ruizhe Zhou
The DMA API guarantees support for masks of 32 bits or wider and
explicitly identifies retrying a 32-bit mask after a 64-bit 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.
Signed-off-by: Ruizhe Zhou <zhouruizhe@resnics.com>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index e6af939c1c19..e43bd2035edb 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -9156,13 +9156,8 @@ static int hclge_pci_init(struct hclge_dev *hdev)
ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if (ret) {
- ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
- if (ret) {
- dev_err(&pdev->dev,
- "can't set consistent PCI DMA\n");
- goto err_disable_device;
- }
- dev_warn(&pdev->dev, "set DMA mask to 32 bits\n");
+ dev_err(&pdev->dev, "can't set consistent PCI DMA\n");
+ goto err_disable_device;
}
ret = pci_request_regions(pdev, HCLGE_DRIVER_NAME);
--
2.27.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH net-next 07/14] fm10k: Remove obsolete 32-bit DMA mask fallback
2026-09-03 8:43 [PATCH net-next 00/14] net: Remove obsolete 32-bit DMA mask fallbacks Ruizhe Zhou
` (5 preceding siblings ...)
2026-09-03 8:43 ` [PATCH net-next 06/14] net: hns3: " Ruizhe Zhou
@ 2026-09-03 8:43 ` Ruizhe Zhou
2026-09-03 8:43 ` [PATCH net-next 08/14] net/mlx4: " Ruizhe Zhou
` (6 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Ruizhe Zhou @ 2026-09-03 8:43 UTC (permalink / raw)
To: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel, Ruizhe Zhou, intel-wired-lan
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.
Signed-off-by: Ruizhe Zhou <zhouruizhe@resnics.com>
---
drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
index f5b4d062709a..afe939f8f4ef 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
@@ -2111,8 +2111,6 @@ static int fm10k_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
}
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(48));
- if (err)
- err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (err) {
dev_err(&pdev->dev,
"DMA configuration failed: %d\n", err);
--
2.27.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH net-next 08/14] net/mlx4: Remove obsolete 32-bit DMA mask fallback
2026-09-03 8:43 [PATCH net-next 00/14] net: Remove obsolete 32-bit DMA mask fallbacks Ruizhe Zhou
` (6 preceding siblings ...)
2026-09-03 8:43 ` [PATCH net-next 07/14] fm10k: " Ruizhe Zhou
@ 2026-09-03 8:43 ` Ruizhe Zhou
2026-09-03 8:43 ` [PATCH net-next 09/14] net/mlx5: " Ruizhe Zhou
` (5 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Ruizhe Zhou @ 2026-09-03 8:43 UTC (permalink / raw)
To: Tariq Toukan, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel, Ruizhe Zhou, linux-rdma
The DMA API guarantees support for masks of 32 bits or wider and
explicitly identifies retrying a 32-bit mask after a 64-bit 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.
Signed-off-by: Ruizhe Zhou <zhouruizhe@resnics.com>
---
drivers/net/ethernet/mellanox/mlx4/main.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index c851daa5da9f..036135df23bf 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -3863,12 +3863,8 @@ static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data,
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if (err) {
- dev_warn(&pdev->dev, "Warning: couldn't set 64-bit PCI DMA mask\n");
- err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
- if (err) {
- dev_err(&pdev->dev, "Can't set PCI DMA mask, aborting\n");
- goto err_release_regions;
- }
+ dev_err(&pdev->dev, "Can't set PCI DMA mask, aborting\n");
+ goto err_release_regions;
}
/* Allow large DMA segments, up to the firmware limit of 1 GB */
--
2.27.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH net-next 09/14] net/mlx5: Remove obsolete 32-bit DMA mask fallback
2026-09-03 8:43 [PATCH net-next 00/14] net: Remove obsolete 32-bit DMA mask fallbacks Ruizhe Zhou
` (7 preceding siblings ...)
2026-09-03 8:43 ` [PATCH net-next 08/14] net/mlx4: " Ruizhe Zhou
@ 2026-09-03 8:43 ` Ruizhe Zhou
2026-09-03 8:43 ` [PATCH net-next 10/14] mlxsw: pci: " Ruizhe Zhou
` (4 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Ruizhe Zhou @ 2026-09-03 8:43 UTC (permalink / raw)
To: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, Mark Bloch,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni
Cc: netdev, linux-kernel, Ruizhe Zhou, linux-rdma
The DMA API guarantees support for masks of 32 bits or wider and
explicitly identifies retrying a 32-bit mask after a 64-bit 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.
Signed-off-by: Ruizhe Zhou <zhouruizhe@resnics.com>
---
drivers/net/ethernet/mellanox/mlx5/core/main.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 5f28d906c35b..3a3b0ec4aad1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -184,12 +184,8 @@ static int set_dma_caps(struct pci_dev *pdev)
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if (err) {
- dev_warn(&pdev->dev, "Warning: couldn't set 64-bit PCI DMA mask\n");
- err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
- if (err) {
- dev_err(&pdev->dev, "Can't set PCI DMA mask, aborting\n");
- return err;
- }
+ dev_err(&pdev->dev, "Can't set PCI DMA mask, aborting\n");
+ return err;
}
dma_set_max_seg_size(&pdev->dev, 2u * 1024 * 1024 * 1024);
--
2.27.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH net-next 10/14] mlxsw: pci: Remove obsolete 32-bit DMA mask fallback
2026-09-03 8:43 [PATCH net-next 00/14] net: Remove obsolete 32-bit DMA mask fallbacks Ruizhe Zhou
` (8 preceding siblings ...)
2026-09-03 8:43 ` [PATCH net-next 09/14] net/mlx5: " Ruizhe Zhou
@ 2026-09-03 8:43 ` Ruizhe Zhou
2026-09-04 16:00 ` Petr Machata
2026-09-03 8:43 ` [PATCH net-next 11/14] eth: fbnic: " Ruizhe Zhou
` (3 subsequent siblings)
13 siblings, 1 reply; 17+ messages in thread
From: Ruizhe Zhou @ 2026-09-03 8:43 UTC (permalink / raw)
To: Ido Schimmel, Petr Machata, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel, Ruizhe Zhou
The DMA API guarantees support for masks of 32 bits or wider and
explicitly identifies retrying a 32-bit mask after a 64-bit 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.
Update the error message to identify the combined streaming and coherent
DMA mask operation.
Signed-off-by: Ruizhe Zhou <zhouruizhe@resnics.com>
---
drivers/net/ethernet/mellanox/mlxsw/pci.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci.c b/drivers/net/ethernet/mellanox/mlxsw/pci.c
index bfe3268dfdc1..dceb69945d26 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/pci.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/pci.c
@@ -2429,11 +2429,8 @@ static int mlxsw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if (err) {
- err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
- if (err) {
- dev_err(&pdev->dev, "dma_set_mask failed\n");
- goto err_pci_set_dma_mask;
- }
+ dev_err(&pdev->dev, "dma_set_mask_and_coherent failed\n");
+ goto err_pci_set_dma_mask;
}
if (pci_resource_len(pdev, 0) < MLXSW_PCI_BAR0_SIZE) {
--
2.27.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH net-next 10/14] mlxsw: pci: Remove obsolete 32-bit DMA mask fallback
2026-09-03 8:43 ` [PATCH net-next 10/14] mlxsw: pci: " Ruizhe Zhou
@ 2026-09-04 16:00 ` Petr Machata
0 siblings, 0 replies; 17+ messages in thread
From: Petr Machata @ 2026-09-04 16:00 UTC (permalink / raw)
To: Ruizhe Zhou
Cc: Ido Schimmel, Petr Machata, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel
Ruizhe Zhou <zhouruizhe@resnics.com> writes:
> The DMA API guarantees support for masks of 32 bits or wider and
> explicitly identifies retrying a 32-bit mask after a 64-bit 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.
> Update the error message to identify the combined streaming and coherent
> DMA mask operation.
>
> Signed-off-by: Ruizhe Zhou <zhouruizhe@resnics.com>
Doco: "dma_set_mask_and_coherent() never return fail when DMA_BIT_MASK(64)."
Checking code, the only way that I see that dma_set_mask_and_coherent()
returns error is if dma_supported() returns 0. This could happen if:
- use_dma_iommu() fails, but that doesn't consider mask, so retrying
with 32 doesn't help.
- if ops->dma_supported fails. But I checked several architectures where
mlxsw could even theoretically be relevant, and it's basically always
some mask > X type of expression, so retrying with a smaller mask does
not help.
- The fallback of dma_direct_supported() is like that as well.
So yeah. I think this is correct.
Reviewed-by: Petr Machata <petrm@nvidia.com>
> ---
> drivers/net/ethernet/mellanox/mlxsw/pci.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci.c b/drivers/net/ethernet/mellanox/mlxsw/pci.c
> index bfe3268dfdc1..dceb69945d26 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/pci.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/pci.c
> @@ -2429,11 +2429,8 @@ static int mlxsw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>
> err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
> if (err) {
> - err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
> - if (err) {
> - dev_err(&pdev->dev, "dma_set_mask failed\n");
> - goto err_pci_set_dma_mask;
> - }
> + dev_err(&pdev->dev, "dma_set_mask_and_coherent failed\n");
> + goto err_pci_set_dma_mask;
> }
>
> if (pci_resource_len(pdev, 0) < MLXSW_PCI_BAR0_SIZE) {
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH net-next 11/14] eth: fbnic: Remove obsolete 32-bit DMA mask fallback
2026-09-03 8:43 [PATCH net-next 00/14] net: Remove obsolete 32-bit DMA mask fallbacks Ruizhe Zhou
` (9 preceding siblings ...)
2026-09-03 8:43 ` [PATCH net-next 10/14] mlxsw: pci: " Ruizhe Zhou
@ 2026-09-03 8:43 ` Ruizhe Zhou
2026-09-03 8:43 ` [PATCH net-next 12/14] net: pch_gbe: " Ruizhe Zhou
` (2 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Ruizhe Zhou @ 2026-09-03 8:43 UTC (permalink / raw)
To: Alexander Duyck, Jakub Kicinski, Andrew Lunn, David S. Miller,
Eric Dumazet, Paolo Abeni
Cc: netdev, linux-kernel, Ruizhe Zhou, kernel-team
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.
Signed-off-by: Ruizhe Zhou <zhouruizhe@resnics.com>
---
drivers/net/ethernet/meta/fbnic/fbnic_pci.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_pci.c b/drivers/net/ethernet/meta/fbnic/fbnic_pci.c
index 8b9bc9e8ea56..47d5dfbf3368 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_pci.c
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_pci.c
@@ -276,8 +276,6 @@ static int fbnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
}
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(46));
- if (err)
- err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (err) {
dev_err(&pdev->dev, "DMA configuration failed: %d\n", err);
return err;
--
2.27.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH net-next 12/14] net: pch_gbe: Remove obsolete 32-bit DMA mask fallback
2026-09-03 8:43 [PATCH net-next 00/14] net: Remove obsolete 32-bit DMA mask fallbacks Ruizhe Zhou
` (10 preceding siblings ...)
2026-09-03 8:43 ` [PATCH net-next 11/14] eth: fbnic: " Ruizhe Zhou
@ 2026-09-03 8:43 ` Ruizhe Zhou
2026-09-03 8:43 ` [PATCH net-next 13/14] net: renesas: rswitch: " Ruizhe Zhou
2026-09-03 8:43 ` [PATCH net-next 14/14] net: niu: " Ruizhe Zhou
13 siblings, 0 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
Cc: netdev, linux-kernel, Ruizhe Zhou
The DMA API guarantees support for masks of 32 bits or wider and
explicitly identifies retrying a 32-bit mask after a 64-bit 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.
Signed-off-by: Ruizhe Zhou <zhouruizhe@resnics.com>
---
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index 88c5c52e0e38..ba3d10f9aec6 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -2504,12 +2504,10 @@ static int pch_gbe_probe(struct pci_dev *pdev,
if (ret)
return ret;
- if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64))) {
- ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
- if (ret) {
- dev_err(&pdev->dev, "ERR: No usable DMA configuration, aborting\n");
- return ret;
- }
+ ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+ if (ret) {
+ dev_err(&pdev->dev, "ERR: No usable DMA configuration, aborting\n");
+ return ret;
}
ret = pcim_iomap_regions(pdev, 1 << PCH_GBE_PCI_BAR, pci_name(pdev));
--
2.27.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH net-next 13/14] net: renesas: rswitch: Remove obsolete 32-bit DMA mask fallback
2026-09-03 8:43 [PATCH net-next 00/14] net: Remove obsolete 32-bit DMA mask fallbacks Ruizhe Zhou
` (11 preceding siblings ...)
2026-09-03 8:43 ` [PATCH net-next 12/14] net: pch_gbe: " Ruizhe Zhou
@ 2026-09-03 8:43 ` Ruizhe Zhou
2026-09-03 9:43 ` Geert Uytterhoeven
2026-09-03 8:43 ` [PATCH net-next 14/14] net: niu: " Ruizhe Zhou
13 siblings, 1 reply; 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
Cc: netdev, linux-kernel, Ruizhe Zhou, Yoshihiro Shimoda,
linux-renesas-soc
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 still aborts initialization.
Signed-off-by: Ruizhe Zhou <zhouruizhe@resnics.com>
---
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,
--
2.27.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH net-next 13/14] net: renesas: rswitch: Remove obsolete 32-bit DMA mask fallback
2026-09-03 8:43 ` [PATCH net-next 13/14] net: renesas: rswitch: " Ruizhe Zhou
@ 2026-09-03 9:43 ` Geert Uytterhoeven
0 siblings, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2026-09-03 9:43 UTC (permalink / raw)
To: Ruizhe Zhou
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, netdev, linux-kernel, Yoshihiro Shimoda,
linux-renesas-soc
Hi Ruizhe,
Thanks for your patch!
On Thu, 3 Sept 2026 at 11:27, Ruizhe Zhou <zhouruizhe@resnics.com> 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?
> Signed-off-by: Ruizhe Zhou <zhouruizhe@resnics.com>
> ---
> 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
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH net-next 14/14] net: niu: Remove obsolete 32-bit DMA mask fallback
2026-09-03 8:43 [PATCH net-next 00/14] net: Remove obsolete 32-bit DMA mask fallbacks Ruizhe Zhou
` (12 preceding siblings ...)
2026-09-03 8:43 ` [PATCH net-next 13/14] net: renesas: rswitch: " Ruizhe Zhou
@ 2026-09-03 8:43 ` Ruizhe Zhou
13 siblings, 0 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
Cc: netdev, linux-kernel, Ruizhe Zhou
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@resnics.com>
---
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
^ permalink raw reply related [flat|nested] 17+ messages in thread