Re: [PATCH v2] sparc: Fix page alignment in dma mapping

Leon Romanovsky <[email protected]>
Newsgroups org.kernel.vger.sparclinux,org.kernel.vger.linux-kernel
Message-ID <20260218084826.GB10368@unreal>
On Tue, Feb 17, 2026 at 06:10:19PM +0100, [email protected] wrote:
> From: Stian Halseth <[email protected]>
> 
> '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 <[email protected]>
> Closes: https://github.com/sparclinux/issues/issues/75
> Suggested-by: Marek Szyprowski <[email protected]>
> Signed-off-by: Stian Halseth <[email protected]>
> ---
>  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 <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.