From: Lukasz Luba <lukasz.luba@arm.com>
To: Marek Szyprowski <m.szyprowski@samsung.com>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org
Cc: inki.dae@samsung.com, jy0922.shim@samsung.com,
sw0312.kim@samsung.com, kyungmin.park@samsung.com,
airlied@linux.ie, daniel@ffwll.ch, kgene@kernel.org,
krzk@kernel.org, b.zolnierkie@samsung.com, a.hajda@samsung.com,
Dietmar.Eggemann@arm.com
Subject: Re: [PATCH] drm/exynos: Fix memory leak and release IOMMU mapping structures
Date: Thu, 5 Mar 2020 10:05:03 +0000 [thread overview]
Message-ID: <1044756c-39cf-9fea-4338-40e5a68349a9@arm.com> (raw)
In-Reply-To: <684ef9fb-eafb-22d3-40c1-50f596211d85@samsung.com>
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
next prev parent reply other threads:[~2020-03-05 10:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20200304220106eucas1p232aae5af79945664c4586930a9412eda@eucas1p2.samsung.com>
2020-03-04 22:00 ` Lukasz Luba
2020-03-05 7:07 ` Marek Szyprowski
2020-03-05 10:05 ` Lukasz Luba [this message]
2020-03-09 0:45 ` Inki Dae
2020-03-09 8:41 ` Lukasz Luba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1044756c-39cf-9fea-4338-40e5a68349a9@arm.com \
--to=lukasz.luba@arm.com \
--cc=Dietmar.Eggemann@arm.com \
--cc=a.hajda@samsung.com \
--cc=airlied@linux.ie \
--cc=b.zolnierkie@samsung.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=inki.dae@samsung.com \
--cc=jy0922.shim@samsung.com \
--cc=kgene@kernel.org \
--cc=krzk@kernel.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=sw0312.kim@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®