lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <d2a99673-cc0e-4024-bc66-76d395ea4313@app.fastmail.com>
Date: Thu, 18 Sep 2025 18:20:07 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Guodong Xu" <guodong@...cstar.com>, "Vinod Koul" <vkoul@...nel.org>,
 "Nathan Chancellor" <nathan@...nel.org>,
 "Nick Desaulniers" <nick.desaulniers+lkml@...il.com>,
 "Bill Wendling" <morbo@...gle.com>, "Justin Stitt" <justinstitt@...gle.com>,
 "Yixun Lan" <dlan@...too.org>
Cc: dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org,
 llvm@...ts.linux.dev, linux-riscv@...ts.infradead.org,
 spacemit@...ts.linux.dev, elder@...cstar.com,
 "Naresh Kamboju" <naresh.kamboju@...aro.org>
Subject: Re: [PATCH] dmaengine: mmp_pdma: fix DMA mask handling

On Thu, Sep 18, 2025, at 16:27, Guodong Xu wrote:
> The driver's existing logic for setting the DMA mask for "marvell,pdma-1.0"
> was flawed. It incorrectly relied on pdev->dev->coherent_dma_mask instead
> of declaring the hardware's fixed addressing capability. A cleaner and
> more correct approach is to define the mask directly based on the hardware
> limitations.
>
> The MMP/PXA PDMA controller is a 32-bit DMA engine. This is supported by
> datasheets and various dtsi files for PXA25x, PXA27x, PXA3xx, and MMP2,
> all of which are 32-bit systems.
>
> This patch simplifies the driver's logic by replacing the 'u64 dma_mask'
> field with a simpler 'u32 dma_width' to store the addressing capability
> in bits. The complex if/else block in probe() is then replaced with a
> single, clear call to dma_set_mask_and_coherent(). This sets a fixed
> 32-bit DMA mask for "marvell,pdma-1.0" and a 64-bit mask for
> "spacemit,k1-pdma," matching each device's hardware capabilities.
>
> Finally, this change also works around a specific build error encountered
> with clang-20 on x86_64 allyesconfig. The shift-count-overflow error is
> caused by a known clang compiler issue where the DMA_BIT_MASK(n) macro's
> ternary operator is not correctly evaluated in static initializers. By
> moving the macro's evaluation into the probe() function, the driver avoids
> this compiler bug.
>
> Fixes: 5cfe585d8624 ("dmaengine: mmp_pdma: Add SpacemiT K1 PDMA support 
> with 64-bit addressing")
> Reported-by: Naresh Kamboju <naresh.kamboju@...aro.org>
> Closes: 
> https://lore.kernel.org/lkml/CA+G9fYsPcMfW-e_0_TRqu4cnwqOqYF3aJOeKUYk6Z4qRStdFvg@mail.gmail.com
> Suggested-by: Arnd Bergmann <arnd@...db.de>
> Signed-off-by: Guodong Xu <guodong@...cstar.com>

Reviewed-by: Arnd Bergmann <arnd@...db.de>

Thanks for fixing this!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ