[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1044756c-39cf-9fea-4338-40e5a68349a9@arm.com>
Date: Thu, 5 Mar 2020 10:05:03 +0000
From: Lukasz Luba <lukasz.luba@....com>
To: Marek Szyprowski <m.szyprowski@...sung.com>,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org
Cc: inki.dae@...sung.com, jy0922.shim@...sung.com,
sw0312.kim@...sung.com, kyungmin.park@...sung.com,
airlied@...ux.ie, daniel@...ll.ch, kgene@...nel.org,
krzk@...nel.org, b.zolnierkie@...sung.com, a.hajda@...sung.com,
Dietmar.Eggemann@....com
Subject: Re: [PATCH] drm/exynos: Fix memory leak and release IOMMU mapping
structures
Hi Marek,
On 3/5/20 7:07 AM, Marek Szyprowski wrote:
> Hi Lukasz,
>
> On 04.03.2020 23:00, Lukasz Luba wrote:
>> There is a memory leak which left some objects not freed. The reference
>> counter of mapping: 'mapping->kref' was 2 when calling
>> arm_iommu_detach_device(), so the release_iommu_mapping() won't be called.
>> Since the old mapping structure is not going to be used any more (because
>> it is detached and new one attached), call arm_iommu_release_mapping()
>> to trigger cleanup.
>
> This will break IOMMU support in Exynos DRM if deferred probe happens.
> Here is a proper fix:
I forgot about the deferred probe.
>
> https://patchwork.kernel.org/patch/11415715/
>
> The mapping initially created by DMA-mapping framework should be
> attached back when Exynos DRM releases the subdev device.
>
Indeed, as you responded in that thread with the example, there is
more dependencies and attaching back the old mapping will work.
I am going add my reviewed-by to your patch.
Regards,
Lukasz
Powered by blists - more mailing lists