From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Hans de Goede <hdegoede@redhat.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Linus Walleij <linus.walleij@linaro.org>,
Alexandre Courbot <gnurou@gmail.com>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-gpio@vger.kernel.org, joeyli <jlee@suse.com>,
Takashi Iwai <tiwai@suse.de>
Subject: Re: [PATCH v3] gpio: Add driver for ACPI INT0002 Virtual GPIO device
Date: Thu, 25 May 2017 01:10:22 +0200 [thread overview]
Message-ID: <CAJZ5v0izgRfxbUVLLQ1jzAVorRc5-71u-cqCNM28sgYFEkLyCw@mail.gmail.com> (raw)
In-Reply-To: <5d207e0b-72d1-ee46-9e90-a98744768ced@redhat.com>
On Wed, May 24, 2017 at 9:50 AM, Hans de Goede <hdegoede@redhat.com> wrote:
> Hi,
>
[cut]
>>> +static irqreturn_t int0002_irq(int irq, void *data)
>>> +{
>>> + struct gpio_chip *chip = data;
>>> + u32 gpe_sts_reg;
>>> +
>>> + gpe_sts_reg = inl(GPE0A_STS_PORT);
>>> + if (!(gpe_sts_reg & GPE0A_PME_B0_STS_BIT))
>>> + return IRQ_NONE;
>>> +
>>> + generic_handle_irq(irq_find_mapping(chip->irqdomain,
>>> + GPE0A_PME_B0_VIRT_GPIO_PIN));
>>> +
>>> + pm_wakeup_hard_event(chip->parent);
>>
>>
>> It may be better to just do pm_system_wakeup() here and drop the
>> device_init_wakeup() from _probe().
>
>
> Ok, I've given this a try and it works fine, so I will send a v4 with
> this changed.
OK
>> The reason why is that device_init_wakeup() allows user space to disable
>> this wakeup source via sysfs which probably never is a good idea, because
>> this thing is just for clearing PME status which should be done regardless
>> and the actual wakeup is triggered by something else.
>
>
> Ack.
>
>> Also in theory pm_system_wakeup() should not really be necessary for
>> wakeup via USB keyboard to work, because that should be signaled via
>> acpi_pm_notify_handler(), at least in principle.
>
>
> Earlier versions of the int0002 driver did not call any wakeup() function
> at all and with 4.11 that worked fine, my initial testing with 4.12-rc1 also
> did not include a wakeup() call but that resulted in USB-keyboard wakeup
> not working and the system not responding to other wakeup sources like
> the power-button after the attempted USB-keyb wakeup. To be sure I've
> retried my current int0002 code with the wakeup call commented out, that
> leads to the same result (unwakeable system) so it seems we really need
> to do the pm_system_wakeup() call.
That's fine, it doesn't hurt to put it in there ATM anyway.
Thanks,
Rafael
prev parent reply other threads:[~2017-05-24 23:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-23 20:12 [PATCH v3] gpio: Add driver for ACPI INT0002 Virtual GPIO device Hans de Goede
2017-05-23 23:58 ` Rafael J. Wysocki
2017-05-24 7:50 ` Hans de Goede
2017-05-24 23:10 ` Rafael J. Wysocki [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=CAJZ5v0izgRfxbUVLLQ1jzAVorRc5-71u-cqCNM28sgYFEkLyCw@mail.gmail.com \
--to=rafael@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gnurou@gmail.com \
--cc=hdegoede@redhat.com \
--cc=jlee@suse.com \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=tiwai@suse.de \
/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).