From: Thomas Gleixner <tglx@linutronix.de>
To: Doug Anderson <dianders@chromium.org>,
Brian Norris <briannorris@chromium.org>
Cc: chintanpandya@google.com, Marc Zyngier <maz@kernel.org>,
Maulik Shah <quic_mkshah@quicinc.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] genirq/PM: Fix IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND if depth > 1
Date: Sat, 14 Jun 2025 21:01:03 +0200 [thread overview]
Message-ID: <87sek2no5s.ffs@tglx> (raw)
In-Reply-To: <CAD=FV=X_nkzpWzaPaFb+OC0+r-BYUoXmog=BNV43CR-WHoDTpA@mail.gmail.com>
On Tue, Jun 10 2025 at 09:43, Doug Anderson wrote:
> On Tue, May 13, 2025 at 4:02 PM Brian Norris <briannorris@chromium.org> wrote:
>> It seems to me (again, not an expert) that maybe you need to solve your
>> problems by dodging the disable-depth entirely. But I'm not sure the
>> best way to do that.
>
> I can give a shot at spinning the patch, but before doing so I'd love
> to get agreement that this problem is worth solving. As I said above,
> we're not actually hitting this in any real cases and the issue was
> just found during code review. To me it feels like it's a real
> (potential) bug and worth solving before it bites someone in the
> future, but I won't force the issue and I'll drop the patch if that's
> what everyone wants.
I don't have a strong opinion either way.
> If it's agreed that I should move forward, I'd love advice on which
> approach I should use. Should I do as Brian says and try to sidestep
> disable-depth entirely in this case? I could factor out the "case 1"
> case of __enable_irq() and call it directly and then make sure that
> all I do is count "depth" while `IRQD_IRQ_ENABLED_ON_SUSPEND` is set.
> That doesn't seem like it would be too ugly...
No. That's creating inconstent state. It's already ugly enough. So if we
go there then we make it explicit like we did for the managed case,
i.e. something like this
void enable_wakeup_irq(struct irq_desc *desc)
{
irqd_set(irqd, IRQD_IRQ_ENABLED_ON_SUSPEND);
desc->saved_depth = desc->depth;
desc->depth = 1;
__enable_irq(desc);
}
and then have a counterpart which disables and restores the state.
Thanks,
tglx
prev parent reply other threads:[~2025-06-14 19:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-13 0:32 [PATCH] genirq/PM: Fix IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND if depth > 1 Douglas Anderson
2025-05-13 7:49 ` Marc Zyngier
2025-05-13 14:31 ` Doug Anderson
2025-05-13 23:02 ` Brian Norris
2025-06-10 16:43 ` Doug Anderson
2025-06-14 19:01 ` Thomas Gleixner [this message]
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=87sek2no5s.ffs@tglx \
--to=tglx@linutronix.de \
--cc=briannorris@chromium.org \
--cc=chintanpandya@google.com \
--cc=dianders@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=quic_mkshah@quicinc.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 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.