From: Doug Berger <opendmb@gmail.com>
To: Gregory Fong <gregory.0xf0@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Brian Norris <computersforpeace@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
bcm-kernel-feedback-list <bcm-kernel-feedback-list@broadcom.com>,
linux-gpio@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 7/7] gpio: brcmstb: implement suspend/resume/shutdown
Date: Mon, 23 Oct 2017 16:06:39 -0700 [thread overview]
Message-ID: <b6a889bc-261d-2082-568c-2eb4847b44b5@gmail.com> (raw)
In-Reply-To: <CADtm3G5utU_-6+FMqnxN0LYJggLhSe7Q6V5LbwchLQLe5zVing@mail.gmail.com>
On 10/20/2017 05:54 PM, Gregory Fong wrote:
> On Thu, Oct 19, 2017 at 11:39 AM, Doug Berger <opendmb@gmail.com> wrote:
>>>> +static int brcmstb_gpio_resume(struct device *dev)
>>>> +{
>>>> + struct brcmstb_gpio_priv *priv = dev_get_drvdata(dev);
>>>> + struct brcmstb_gpio_bank *bank;
>>>> + u32 wake_mask = 0;
>>>
>>> This isn't really being used as a mask, contrary to appearances. It's
>>> just tracking whether any active IRQs were seen. Please change to use a
>>> bool instead and adjust the name accordingly.
>>>
>>
>> I see your point, but I believe it is cleaner to use this to consolidate
>> the bit masks returned by each __brcmstb_gpio_get_active_irqs() call.
>> This allows a single test rather than a test per bank.
>
> What about something like this?
>
> bool need_wakeup_event = false;
>
> list_for_each_entry(bank, &priv->bank_list, node) {
> need_wakeup_event |= !!__brcmstb_gpio_get_active_irqs(bank);
> brcmstb_gpio_bank_restore(priv, bank);
> }
>
> if (priv->parent_wake_irq && need_wakeup_event)
> pm_wakeup_event(dev, 0);
>
It's less efficient, but it is not performance sensitive so if you feel
this is more understandable I'll make the change.
Thanks,
Doug
next prev parent reply other threads:[~2017-10-23 23:06 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-30 3:40 [PATCH 0/7] gpio: brcmstb: improved interrupt and wake support Doug Berger
2017-09-30 3:40 ` [PATCH 1/7] gpio: brcmstb: allow all instances to be wakeup sources Doug Berger
2017-10-04 1:40 ` Gregory Fong
2017-10-07 10:52 ` Linus Walleij
2017-09-30 3:40 ` [PATCH 2/7] gpio: brcmstb: release the bgpio lock during irq handlers Doug Berger
2017-10-04 1:55 ` Gregory Fong
2017-10-04 2:09 ` Doug Berger
2017-10-04 3:07 ` Gregory Fong
2017-09-30 3:40 ` [PATCH 3/7] gpio: brcmstb: switch to handle_level_irq flow Doug Berger
2017-10-04 1:59 ` Gregory Fong
2017-09-30 3:40 ` [PATCH 4/7] gpio: brcmstb: correct the configuration of level interrupts Doug Berger
2017-10-04 2:03 ` Gregory Fong
2017-09-30 3:40 ` [PATCH 5/7] gpio: brcmstb: enable masking of interrupts when changing type Doug Berger
2017-10-04 2:10 ` Gregory Fong
2017-10-04 2:22 ` Doug Berger
2017-10-04 3:15 ` Gregory Fong
2017-09-30 3:40 ` [PATCH 6/7] gpio: brcmstb: consolidate interrupt domains Doug Berger
2017-10-04 3:03 ` Gregory Fong
2017-10-04 21:24 ` Doug Berger
2017-10-16 23:04 ` Doug Berger
2017-10-19 7:57 ` Gregory Fong
2017-10-19 18:25 ` Doug Berger
2017-09-30 3:40 ` [PATCH 7/7] gpio: brcmstb: implement suspend/resume/shutdown Doug Berger
2017-10-19 9:03 ` Gregory Fong
2017-10-19 18:39 ` Doug Berger
2017-10-21 0:54 ` Gregory Fong
2017-10-23 23:06 ` Doug Berger [this message]
2017-09-30 5:34 ` [PATCH 0/7] gpio: brcmstb: improved interrupt and wake support Florian Fainelli
2017-10-07 10:54 ` Linus Walleij
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=b6a889bc-261d-2082-568c-2eb4847b44b5@gmail.com \
--to=opendmb@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=computersforpeace@gmail.com \
--cc=f.fainelli@gmail.com \
--cc=gregory.0xf0@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).