Re: [PATCH 1/3] dmaengine: ptdma: Remove obsolete 32-bit DMA mask fallback
From: Frank Li
Date: Thu Sep 03 2026 - 15:47:03 EST
On Thu, Sep 03, 2026 at 07:54:39PM +0800, Ruizhe Zhou wrote:
> [You don't often get email from zhouruizhe@xxxxxxxxxxx. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> 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@xxxxxxxxxxx>
> ---
> drivers/dma/amd/ptdma/ptdma-pci.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/dma/amd/ptdma/ptdma-pci.c b/drivers/dma/amd/ptdma/ptdma-pci.c
> index 22739ff0c3c5..d36bb9c67325 100644
> --- a/drivers/dma/amd/ptdma/ptdma-pci.c
> +++ b/drivers/dma/amd/ptdma/ptdma-pci.c
> @@ -178,12 +178,8 @@ static int pt_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>
> ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(48));
> if (ret) {
> - ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));
> - if (ret) {
> - dev_err(dev, "dma_set_mask_and_coherent failed (%d)\n",
> - ret);
> - goto e_err;
> - }
> + dev_err(dev, "dma_set_mask_and_coherent failed (%d)\n", ret);
> + goto e_err;
also needn't check return value, it always return success if mask >= 32.
Frank
> }
>
> dev_set_drvdata(dev, pt);
> --
> 2.27.0
>