[PATCH net-next 10/14] mlxsw: pci: Remove obsolete 32-bit DMA mask fallback
From: Ruizhe Zhou
Date: Thu Sep 03 2026 - 04:52:11 EST
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@xxxxxxxxxxx>
---
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