* [PATCH 1/4] iommu/io-pgtable-arm: use inner shareable for Mali LPAE on a non-coherent GPU
[not found] <20261106054210.2893230-1-nirvanah@nirvanahyj.com>
@ 2026-11-06 5:41 ` Young-Jun Hong
2026-11-29 10:48 ` Shigeaki Asai
0 siblings, 1 reply; 2+ messages in thread
From: Young-Jun Hong @ 2026-11-06 5:41 UTC (permalink / raw)
Cc: stable, Will Deacon, Robin Murphy, Joerg Roedel (AMD),
linux-arm-kernel, iommu, linux-kernel
io-pgtable marks every ARM_MALI_LPAE PTE outer shareable (SH = 2). Outer
shareability is only meaningful when the GPU sits behind a coherent
interconnect, i.e. when the page-table walk is coherent (cfg.coherent_walk,
which panfrost sets from the dma-coherent DT property). The vendor kbase
driver on a non-coherent Exynos 5422 (COHERENCY_NONE) never uses outer
shareable: its PTEs are non-shareable or inner shareable.
On Exynos 5422 (Mali-T628 MP6, ARMv7 LPAE, not IO-coherent) the outer
shareable attribute hangs the whole SoC when a large GPU buffer is first
used under GPU bandwidth load and memory pressure: 0 of 22 runs survived
with SH = 2, 3 of 3 with inner shareable. Non-shareable also avoids the
hang but breaks global atomics between the two core groups, so use inner
shareable for a non-coherent Mali; coherent configurations are unchanged.
Sustained GPU copy bandwidth also rises from 6.3 to 7.7 GB/s.
Tested on Samsung ARTIK 10 (Exynos 5422) with panfrost and Mesa Rusticl:
hang reproducer clean, OpenCL accuracy suite 96/96, no GPU faults over
several days of use.
The analysis, the code and this changelog were produced with Claude
Code (Anthropic), a coding assistant.
Fixes: 7618e4790982 ("iommu/io-pgtable-arm: Improve attribute handling")
Cc: stable@vger.kernel.org
Signed-off-by: Young-Jun Hong <nirvanah@nirvanahyj.com>
---
drivers/iommu/io-pgtable-arm.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c
index 476c0e25631a..0e7b2edd9ca1 100644
--- a/drivers/iommu/io-pgtable-arm.c
+++ b/drivers/iommu/io-pgtable-arm.c
@@ -565,6 +565,13 @@ static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data,
*/
if (prot & IOMMU_CACHE && data->iop.fmt != ARM_MALI_LPAE)
pte |= ARM_LPAE_PTE_SH_IS;
+ else if (data->iop.fmt == ARM_MALI_LPAE && !data->iop.cfg.coherent_walk)
+ /*
+ * A non-coherent Mali must not mark its accesses outer
+ * shareable; inner shareable keeps atomics consistent across
+ * its core groups.
+ */
+ pte |= ARM_LPAE_PTE_SH_IS;
else
pte |= ARM_LPAE_PTE_SH_OS;
--
2.47.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/4] iommu/io-pgtable-arm: use inner shareable for Mali LPAE on a non-coherent GPU
2026-11-06 5:41 ` [PATCH 1/4] iommu/io-pgtable-arm: use inner shareable for Mali LPAE on a non-coherent GPU Young-Jun Hong
@ 2026-11-29 10:48 ` Shigeaki Asai
0 siblings, 0 replies; 2+ messages in thread
From: Shigeaki Asai @ 2026-11-29 10:48 UTC (permalink / raw)
To: Young-Jun Hong
Cc: Will Deacon, Robin Murphy, Joerg Roedel (AMD), iommu,
linux-arm-kernel, linux-kernel, stable
On 11/6/26 14:41, Young-Jun Hong wrote:
> io-pgtable marks every ARM_MALI_LPAE PTE outer shareable (SH = 2).
Tested on an ODROID-XU4 (Exynos 5422, Mali-T628 r0p1),
kernel 7.3.4, LibreELEC with Kodi.
With this patch, the board ran for about 4 hours without freezes or
errors. H.264 1080p60 (over 10 minutes) played three times and HEVC
1080p30 (over 8 minutes) once, without any panfrost errors.
Without this patch, the Kodi GUI never appeared after the splash
screen, and the following messages were logged repeatedly:
[ 25.284080] panfrost 11800000.gpu: AS_ACTIVE bit stuck
[ 25.295125] panfrost 11800000.gpu: gpu soft reset timed out, attempting hard reset
...
Tested-by: Shigeaki Asai <y-asai.0816@docomonet.jp>
(I used Claude (AI) to help read the logs and to check my English.)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-29 10:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20261106054210.2893230-1-nirvanah@nirvanahyj.com>
2026-11-06 5:41 ` [PATCH 1/4] iommu/io-pgtable-arm: use inner shareable for Mali LPAE on a non-coherent GPU Young-Jun Hong
2026-11-29 10:48 ` Shigeaki Asai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox