Re: [PATCH 07/10] iommu/mediatek: Add a gap for the iova regions

From: Yong Wu (吴勇)
Date: Tue Feb 14 2023 - 00:33:54 EST


On Mon, 2023-01-16 at 10:46 +0100, AngeloGioacchino Del Regno wrote:
> Il 13/01/23 07:01, Yong Wu ha scritto:
> > Currenly masters can not indicate its special dma-ranges. Prepare
> > for vcodec. some vcodec end address is address + size, if our size
> > is 4G, the end address may be 0x2_0000_0000. and the
> > register is u32, then it may get zero. thus add a gap(8M) for
> > all the regions.
> >
> > Signed-off-by: Yong Wu <yong.wu@xxxxxxxxxxxx>
>
> I definitely agree on the fact that we do *need* this series...

Thanks very much for your review.

> but this particular commit looks like a hack.
>
> I'm not convinced: I have a hunch that this one will sooner or later
> backfire
> on us and break things again... at the same time, I'm not sure how to
> do this
> properly at this point (I didn't do any research, anyway).

I got a real vcodec issue described in the commit message. As you may
see in the vcodec's dt-binding example[1/10] or the dts node[9/10],
their length is 0xfff00000 that means they use 1M as the gap. Vcodec
use this for a long time. After this patchset, this property is unused,
then I have to take care this in the iommu, therefore this patch is
required, and I just give a bigger gap(8M) here.

>
> Ideas?
>
> Regards,
> Angelo
>