Re: [PATCH v12 2/7] iommu/mediatek: Fix two IOMMU share pagetable issue

From: Yong Wu (吴勇)
Date: Sat Aug 19 2023 - 04:48:51 EST


Hi Laura,

Thanks very much for your testing.

On Fri, 2023-08-18 at 17:41 +0200, Laura Nao wrote:
> Hello,
>
> This patch is causing fluster tests to fail on MT8192, IOMMU read and
> write faults are reported in the log. Here's an extract is from the
> VP9 tests:
>
> mtk-iommu 1401d000.m4u: fault type=0x280 iova=0x1ff7c0000 pa=0x0
> master=0x5000480(larb=5 port=0) layer=0 read
> mtk-iommu 1401d000.m4u: fault type=0x280 iova=0x1fe3ee000 pa=0x0
> master=0x5000492(larb=5 port=4) layer=0 write
>
> Tests are failing for H264, VP8 and VP9 decoding on next-20230817
> with fluster in the same way, complete logs can be found here:
> - H264:
> https://urldefense.com/v3/__https://storage.kernelci.org/next/master/next-20230817/arm64/defconfig*arm64-chromebook*videodec/gcc-10/lab-collabora/v4l2-decoder-conformance-h264-mt8192-asurada-spherion-r0.html__;Kys!!CTRNKA9wMg0ARbw!g5CkV4Tmx8gZ_Ll6AMpoEosTjSgKbdfG2RNwJJFdnpX4g-MW0IdAmt3bXphiIIfSPmGbbPO1tFM4b8wSlrgogw$
>
> - VP8:
> https://urldefense.com/v3/__https://storage.kernelci.org/next/master/next-20230817/arm64/defconfig*arm64-chromebook*videodec/gcc-10/lab-collabora/v4l2-decoder-conformance-vp8-mt8192-asurada-spherion-r0.html__;Kys!!CTRNKA9wMg0ARbw!g5CkV4Tmx8gZ_Ll6AMpoEosTjSgKbdfG2RNwJJFdnpX4g-MW0IdAmt3bXphiIIfSPmGbbPO1tFM4b8wa_83EZw$
>
> - VP9:
> https://urldefense.com/v3/__https://storage.kernelci.org/next/master/next-20230817/arm64/defconfig*arm64-chromebook*videodec/gcc-10/lab-collabora/v4l2-decoder-conformance-vp9-mt8192-asurada-spherion-r0.html__;Kys!!CTRNKA9wMg0ARbw!g5CkV4Tmx8gZ_Ll6AMpoEosTjSgKbdfG2RNwJJFdnpX4g-MW0IdAmt3bXphiIIfSPmGbbPO1tFM4b8xaOT2SLw$
>
>
> Reverting this patch fixes the issue.
>
> From my understanding, on MT8192 the 16GB iova space is partitioned
> between display, vcodec and camera. The iommu domain configuration
> for vcodec was loaded from frstdata->bank[0]->m4u_dom (vcodec is
> preassigned to a specific iova range), while after this patch a new
> pagetable is created instead.

Exactly Right. It creates a new pagetable for this case. I sent a patch
for this. Could you also help confirm?
Thanks.


https://lore.kernel.org/linux-mediatek/20230819081443.8333-1-yong.wu@xxxxxxxxxxxx/

>
> Do you have any insight on how to fix this while keeping
> compatibility with MT8188 and MT8195?
>
> Best,
>
> Laura