From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
To: Linus Walleij <linusw@kernel.org>
Cc: Li Youhong <dayou5941@163.com>,
dan.scally@ideasonboard.com, jacopo.mondi@ideasonboard.com,
mchehab@kernel.org, linux-media@vger.kernel.org,
Li Youhong <liyouhong@kylinos.cn>
Subject: Re: [PATCH] media: mali-c55: free IRQ when remove while runtime-active
Date: Fri, 4 Sep 2026 12:40:18 +0200 [thread overview]
Message-ID: <apqfTZnUOMcb6xw3@zed> (raw)
In-Reply-To: <CAD++jLnVf8-o2XBWonLStH33+GfkFCbqORisM9JMZOhhbNxX6w@mail.gmail.com>
Hi Linus
On Fri, Sep 04, 2026 at 12:12:20PM +0200, Linus Walleij wrote:
> On Thu, Sep 3, 2026 at 4:55 AM Li Youhong <dayou5941@163.com> wrote:
>
> > @@ -861,6 +861,8 @@ static void mali_c55_remove(struct platform_device *pdev)
> >
> > mali_c55_media_frameworks_deinit(mali_c55);
> > if (!pm_runtime_suspended(&pdev->dev)) {
> > + if (irq_has_action(mali_c55->irqnum))
> > + free_irq(mali_c55->irqnum, &pdev->dev);
> > __mali_c55_power_off(mali_c55);
> > pm_runtime_set_suspended(&pdev->dev);
>
> This whole runtime suspend/resume looks a bit odd to me.
>
> Normally you keep the IRQ requested perpetually in a driver,
> this looks like some really odd workaround to explicitly deal with
> wakeup capable/non-wakeup capable IRQs.
>
> I tried to see if this was addressed during review of the driver
> and whether there was a reason for doing things like this.
> But there are too many threads on lore.
Indeed it's weird.
I've a branch that I started that tried to fix that, but the issue I
was hitting was due the fact the ISP starts with all ISP unmasked, and
I get very bad races between the power-up routine and the IRQ.
I run out of time and gave up, but if you're interested I can provide
you references to that work
>
> I think the proper fix is to keep the IRQ requested during
> suspend/resume and *not* mark it as wakeup-source; in the
> device tree for the SoC.
>
> Support code is needed in the driver, something along the line
> of this:
>
> suspend():
> if (device_may_wakeup(dev))
> enable_irq_wake(irq);
>
> resume():
> if (device_may_wakeup(dev))
> disable_irq_wake(irq);
>
> Do you want to make the patch or should I?
That's something I didn't consider maybe :)
>
> Yours,
> Linus Walleij
next prev parent reply other threads:[~2026-09-04 10:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 2:55 [PATCH] media: mali-c55: free IRQ when remove while runtime-active Li Youhong
2026-09-04 10:12 ` Linus Walleij
2026-09-04 10:40 ` Jacopo Mondi [this message]
2026-09-04 14:55 ` Dan Scally
2026-09-07 2:04 ` 李佑鸿
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=apqfTZnUOMcb6xw3@zed \
--to=jacopo.mondi@ideasonboard.com \
--cc=dan.scally@ideasonboard.com \
--cc=dayou5941@163.com \
--cc=linusw@kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=liyouhong@kylinos.cn \
--cc=mchehab@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.