From: Chaoyi Chen <chaoyi.chen@rock-chips.com>
To: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Cc: Daniel Drake <ddrake@baylibre.com>,
Chaoyi Chen <kernel@airkyi.com>, Oded Gabbay <ogabbay@kernel.org>,
Heiko Stuebner <heiko@sntech.de>,
Jeff Hugo <jeff.hugo@oss.qualcomm.com>,
LKML <linux-kernel@vger.kernel.org>,
dri-devel <dri-devel@lists.freedesktop.org>,
"open list:ARM/Rockchip SoC..."
<linux-rockchip@lists.infradead.org>,
LAKML <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 3/4] accel/rocket: Fix the extra iommu_group_get call in rocket_job_handle_irq
Date: Wed, 18 Nov 2026 17:16:54 +0800 [thread overview]
Message-ID: <daea6316-bf37-4b9d-92a7-945f34cd719d@rock-chips.com> (raw)
In-Reply-To: <CAPsqS2QhAortoDOt9MBizTr4RCDhChr1xLF13NNTUYjyFMakhg@mail.gmail.com>
Hi Tomeu,
On 11/18/2026 4:58 PM, Tomeu Vizoso wrote:
> Hi Chaoyi and Daniel,
>
> On Wed, Nov 18, 2026 at 3:29 AM Chaoyi Chen <chaoyi.chen@rock-chips.com> wrote:
>>
>> Hi Daniel,
>>
>> On 11/18/2026 5:53 AM, Daniel Drake wrote:
>>> On 14/08/2026 03:24, Chaoyi Chen wrote:
>>>> From: Chaoyi Chen <chaoyi.chen@rock-chips.com>
>>>>
>>>> The rocket attaches the IOMMU group in rocket_job_run() and detaches it
>>>> in rocket_job_handle_irq(). Calling iommu_group_get() in
>>>> rocket_job_handle_irq() causes the reference count to increase
>>>> unexpectedly. And this causes rocket_core_fini() to fail to release the
>>>> IOMMU group, leading to a resource leak.
>>>
>>>
>>> While there is a leak here, I think sashiko correct in saying this change would introduce a crash because core->iommu_group can be set to NULL before this codepath is reached. That might be a simple fix.
>>>
>>>> Fixes: 658ebeac3351 ("accel/rocket: Add IOCTL for BO creation")
>>>
>>>
>>> Wrong commit mentioned here.
>
> I fixed this one when applying.
>
>> Thanks for you review. This is indeed a problem.
>
> I'm sorry but I had already applied this patch to drm-misc-fixes and
> pushed when I read this. I have looked at fixing just this crash, but
> have decided against it because we anyway crash in drm_sched on core
> unbind whenever a client is active (no need to have a job in flight),
> due to the sched entities keeping a reference to the stale scheduler.
>
Oh, that's true, but it seems no merge notification email was sent out?
https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/5c4aeafcac8c46be7b08b86795baa64453eb68aa
>> And it has been a long time since I sent this series. :)
>>
>> During this time, I have seen a lot of similar work. For example, work
>> similar to patch1 is here[0]. And some of the issues mentioned by
>> Sashikoare also being fixed by in-flight patches like[1].
>
> Core removal needs to be fixed as a whole: detach the open files'
> entities from the scheduler that goes away, complete or cancel the job
> in flight, and quiesce the job interrupt before the resources it uses
> are released.
>
>> I'm not sure whether I should slow down the submission, since it seems
>> Tomeu is quite busy and hasn't gotten to some of the backlogged patches.
>
> I'm sorry about the big backlog of patches. With Heiko and Daniel's
> help I expect to get it cleared soon and be more responsive.
>
Thanks for your excellent work! I think patch4 could also be merged?
That way, people on the rockchip mailing list can also conveniently help
us review these patches. :-)
--
Best,
Chaoyi
next prev parent reply other threads:[~2026-11-18 9:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-14 2:24 [PATCH 0/4] accel/rocket: resource leak and stability improvements Chaoyi Chen
2026-08-14 2:24 ` [PATCH 1/4] accel/rocket: Fix the IOMMU domain leak in rocket_ioctl_create_bo Chaoyi Chen
2026-11-17 21:45 ` Daniel Drake
2026-08-14 2:24 ` [PATCH 2/4] accel/rocket: Fix the panic in rocket_iommu_domain_put when the domain is NULL Chaoyi Chen
2026-11-17 21:47 ` Daniel Drake
2026-08-14 2:24 ` [PATCH 3/4] accel/rocket: Fix the extra iommu_group_get call in rocket_job_handle_irq Chaoyi Chen
2026-11-17 21:53 ` Daniel Drake
2026-11-18 2:29 ` Chaoyi Chen
2026-11-18 8:58 ` Tomeu Vizoso
2026-11-18 9:16 ` Chaoyi Chen [this message]
2026-08-14 2:24 ` [PATCH 4/4] MAINTAINERS: accel/rocket: Add rockchip mail list for rocket Chaoyi Chen
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=daea6316-bf37-4b9d-92a7-945f34cd719d@rock-chips.com \
--to=chaoyi.chen@rock-chips.com \
--cc=ddrake@baylibre.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=heiko@sntech.de \
--cc=jeff.hugo@oss.qualcomm.com \
--cc=kernel@airkyi.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=ogabbay@kernel.org \
--cc=tomeu@tomeuvizoso.net \
/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®