[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <77867c46-d868-4496-a1a3-45feb0bdd604@arm.com>
Date: Tue, 17 Jun 2025 17:04:57 +0100
From: Robin Murphy <robin.murphy@....com>
To: Benjamin Gaignard <benjamin.gaignard@...labora.com>,
Jason Gunthorpe <jgg@...pe.ca>
Cc: joro@...tes.org, will@...nel.org, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, heiko@...ech.de, nicolas.dufresne@...labora.com,
p.zabel@...gutronix.de, mchehab@...nel.org, iommu@...ts.linux.dev,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-rockchip@...ts.infradead.org,
linux-media@...r.kernel.org, kernel@...labora.com
Subject: Re: [PATCH 5/5] media: verisilicon: Flush IOMMU before decoding a
frame
On 17/06/2025 5:01 pm, Benjamin Gaignard wrote:
>
> Le 17/06/2025 à 17:58, Jason Gunthorpe a écrit :
>> On Mon, Jun 16, 2025 at 04:55:53PM +0200, Benjamin Gaignard wrote:
>>> Flush the IOMMU mapping before decoding a frame to ensure that all
>>> memory
>>> translations are properly applied.
>>>
>>> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@...labora.com>
>>> ---
>>> drivers/media/platform/verisilicon/hantro_drv.c | 11 +++++++++++
>>> 1 file changed, 11 insertions(+)
>> This is a really big red flag.
>>
>> iommu translations are supposed to be controlled by the iommu driver
>> and should be flushed as part of the iommu map/unmap flows. It should
>> never be necessary to do something like this.
>
> I have redone tests without this patch and the decode is perform correctly.
> I will drop it in the next version.
> I think I have fix the reference frame management in the driver so it
> becomes
> useless.
If it turns out the hardware does require a TLBI to guarantee new
mappings are visible, though, then the correct way is to implement the
iotlb_sync_map op.
Thanks,
Robin.
Powered by blists - more mailing lists