]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dma-direct: fix use of max_pfn
authorPetr Tesarik <ptesarik@suse.com>
Fri, 10 Apr 2026 11:35:06 +0000 (13:35 +0200)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 30 Apr 2026 06:21:34 +0000 (08:21 +0200)
commit22d0213e55fbb723c2c00dd5aa855a6eaad95b23
treee6a1d1cf3c5488b926addeb7f9c8c4f1fca2e799
parent254f49634ee16a731174d2ae34bc50bd5f45e731
dma-direct: fix use of max_pfn

Calculate the correct physical address of the last byte of memory. Since
max_pfn is in fact "the PFN of the first page after the highest system RAM
in physical address space", the highest address that might be used for a
DMA buffer is one byte below max_pfn << PAGE_SHIFT.

This fix is unlikely to make any difference in practice. It's just that the
current formula is slightly confusing.

Signed-off-by: Petr Tesarik <ptesarik@suse.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20260410113506.262579-1-ptesarik@suse.com
kernel/dma/direct.c