public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Florian Fainelli <florian.fainelli@broadcom.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: linux-kernel@vger.kernel.org, Doug Berger <opendmb@gmail.com>,
	Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Christophe Leroy <chleroy@kernel.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	"moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 3/3] gpio: brcmstb: allow parent_irq to wake
Date: Thu, 29 Jan 2026 12:02:32 -0800	[thread overview]
Message-ID: <b9732251-936b-4935-a586-25993881ce4e@broadcom.com> (raw)
In-Reply-To: <CAHp75Vc1om1XDT0os+md1D-mwYxrVZJGfbpepkdPJrHOmFPBvA@mail.gmail.com>

On 1/29/26 06:23, Andy Shevchenko wrote:
> On Tue, Jan 27, 2026 at 11:47 PM Florian Fainelli
> <florian.fainelli@broadcom.com> wrote:
> 
>> The classic parent_wake_irq can only occur after the system has
>> been placed into a hardware managed power management state. This
>> prevents its use for waking from software managed suspend states
>> like s2idle.
>>
>> By allowing the parent_irq to be enabled for wake enabled GPIO
>> during suspend, these GPIO can now be used to wake from these
>> states. The 'suspended' boolean is introduced to support wake
>> event accounting.
> 
> ...
> 
>>          if (of_property_read_bool(np, "wakeup-source")) {
>> +               /*
>> +                * Set wakeup capability so we can process boot-time
>> +                * "wakeups" (e.g., from S5 cold boot)
> 
> While at it, add a period at the end.
> 
>> +                */
>> +               device_set_wakeup_capable(dev, true);
>> +               device_wakeup_enable(dev);
> 
>>          }
> 
> ...
> 
>> +       /* disable interrupts */
> 
> Still the comment is useless.
> 
>> +       if (priv->parent_irq > 0)
>> +               disable_irq(priv->parent_irq);
> 
> And looking more at this, I don't see why we even need the check. Does
> the code WARNs or so when there is no parent_irq available?
> 
> *Yes, I saw this is the original code, perhaps can be addressed in a follow up.
> 
> ...
> 
>> +       /* disable interrupts while we save the masks */
> 
>> +       if (priv->parent_irq > 0)
> 
> Ditto.
> 
>> +               disable_irq(priv->parent_irq);
> 
> ...
> 
>> +       /* disable interrupts while we restore the masks */
>> +       if (priv->parent_wake_irq)
> 
> Ditto.
> 
>> +               disable_irq(priv->parent_irq);
> 
> ...
> 
>> +       /* re-enable interrupts */
>> +       if (priv->parent_irq > 0)
> 
> Same here.
> 
>>                  enable_irq(priv->parent_irq);
> 
> ...
> 
> All we are diving into is the 2 questions:
> - is 0 on the particular platform an IRQ number and there is no sparse
> tree enabled?
> - is maple tree implementation clever enough to not crash (or have
> side effects) when we ask for a non-existing index?
> 
> Anyway, this can be done later on.

OK, I will remove the superfluous comments, add punctuation where 
necessary and respin (removing patch #1 since it was applied already).

Thank you!
-- 
Florian


  reply	other threads:[~2026-01-29 20:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-27 21:46 [PATCH v2 0/3] gpio: brcmstb: Bug fixes and wake-up interrupt improvements Florian Fainelli
2026-01-27 21:46 ` [PATCH v2 1/3] gpio: brcmstb: correct hwirq to bank map Florian Fainelli
2026-01-27 22:15   ` Linus Walleij
2026-01-27 21:46 ` [PATCH v2 2/3] gpio: brcmstb: implement irq_mask_ack Florian Fainelli
2026-01-27 22:16   ` Linus Walleij
2026-01-27 21:46 ` [PATCH v2 3/3] gpio: brcmstb: allow parent_irq to wake Florian Fainelli
2026-01-29 14:23   ` Andy Shevchenko
2026-01-29 20:02     ` Florian Fainelli [this message]
2026-01-28  9:15 ` (subset) [PATCH v2 0/3] gpio: brcmstb: Bug fixes and wake-up interrupt improvements Bartosz Golaszewski
2026-01-29 14:24 ` Andy Shevchenko

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=b9732251-936b-4935-a586-25993881ce4e@broadcom.com \
    --to=florian.fainelli@broadcom.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=brgl@kernel.org \
    --cc=chleroy@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=opendmb@gmail.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