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 3/3] gpio: brcmstb: allow parent_irq to wake
Date: Thu, 22 Jan 2026 11:24:35 -0800 [thread overview]
Message-ID: <a7b2f013-965b-436d-95f0-8ce1e2ec0c41@broadcom.com> (raw)
In-Reply-To: <CAHp75VfhEZ60F7ZHkjNDZ3JR6B6tNF5ORUDPoN8ZibbvF=js8w@mail.gmail.com>
On 1/21/2026 11:42 PM, Andy Shevchenko wrote:
> On Thu, Jan 22, 2026 at 3:06 AM 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.
>
>> Signed-off-by: Doug Berger <opendmb@gmail.com>
>> [florian: port changes after generic gpio chip conversion]
>
> Likewise in the previous patch I think this deserves the Co-developed-by tag.
OK.
>
>> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
>
> ...
>
>> + if (priv->suspended && bank->wake_active & (u32)status) {
>
> Why casting?
status is an unsigned long, which is what for_each_set_bit() expects, so
it is intended here to ensure the top bits are not participating in the
comparison, I think this is just being extra explicit with intent here.
>
>> + priv->suspended = false;
>> + pm_wakeup_event(&priv->pdev->dev, 0);
>> + }
>
> ...
>
>> static void brcmstb_gpio_shutdown(struct platform_device *pdev)
>> {
>> + struct brcmstb_gpio_priv *priv = dev_get_drvdata(&pdev->dev);
>
>> + /* disable interrupts */
>
> A useless comment.
Indeed.
>
>> + if (priv->parent_irq > 0)
>> + disable_irq(priv->parent_irq);
>> +
>> /* Enable GPIO for S5 cold boot */
>> - brcmstb_gpio_quiesce(&pdev->dev, false);
>> + brcmstb_gpio_quiesce(priv, false);
>> }
>
> ...
>
>> static const struct dev_pm_ops brcmstb_gpio_pm_ops = {
>
>> + .suspend_noirq = pm_sleep_ptr(brcmstb_gpio_suspend_noirq),
>> .resume_noirq = pm_sleep_ptr(brcmstb_gpio_resume),
>
> May we use one of the PM macros for these two assignments?
Sure, can do that!
--
Florian
next prev parent reply other threads:[~2026-01-22 19:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-22 1:05 [PATCH 0/3] gpio: brcmstb: Bug fixes and wake-up interrupt improvements Florian Fainelli
2026-01-22 1:05 ` [PATCH 1/3] gpio: brcmstb: correct hwirq to bank map Florian Fainelli
2026-01-22 1:05 ` [PATCH 2/3] gpio: brcmstb: implement irq_mask_ack Florian Fainelli
2026-01-22 7:36 ` Andy Shevchenko
2026-01-22 19:17 ` Florian Fainelli
2026-01-22 19:26 ` Florian Fainelli
2026-01-23 19:01 ` Florian Fainelli
2026-01-22 1:05 ` [PATCH 3/3] gpio: brcmstb: allow parent_irq to wake Florian Fainelli
2026-01-22 7:42 ` Andy Shevchenko
2026-01-22 19:24 ` Florian Fainelli [this message]
2026-01-26 16:26 ` Andy Shevchenko
2026-01-22 7:44 ` Andy Shevchenko
2026-01-22 7:45 ` 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=a7b2f013-965b-436d-95f0-8ce1e2ec0c41@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