Re: [PATCH v2] sparc: Fix page alignment in dma mapping
From: Leon Romanovsky
Date: Wed Feb 18 2026 - 03:52:18 EST
On Tue, Feb 17, 2026 at 06:10:19PM +0100, stian@xxxxxx wrote:
> From: Stian Halseth <stian@xxxxxx>
>
> 'phys' may include an offset within the page, while 'base_paddr' is already
> page-aligned. This caused incorrect DMA mapping in dma_4u_map_phys and
> dma_4v_map_phys.
>
> Fix both functions by masking phys with IO_PAGE_MASK or subtracting the
> page offset, covering both generic SPARC code and sun4v.
>
> Fixes: 38c0d0ebf520 ("sparc: Use physical address DMA mapping")
> Reported-by: Stian Halseth <stian@xxxxxx>
> Closes: https://github.com/sparclinux/issues/issues/75
> Suggested-by: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>
> Signed-off-by: Stian Halseth <stian@xxxxxx>
> ---
> arch/sparc/kernel/iommu.c | 2 ++
> arch/sparc/kernel/pci_sun4v.c | 2 +-
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
Thanks,
Reviewed-by: Leon Romanovsky <leon@xxxxxxxxxx>