Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1704108 > unrolled thread

[PATCH] intel-vbtn: match power button on press rather than release

Started byMario Limonciello <mario.limonciello@dell.com>
First post2017-08-04 19:10 +0200
Last post2017-08-07 06:00 +0200
Articles 9 — 5 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] intel-vbtn: match power button on press rather than release Mario Limonciello <mario.limonciello@dell.com> - 2017-08-04 19:10 +0200
    Re: [PATCH] intel-vbtn: match power button on press rather than  release Darren Hart <dvhart@infradead.org> - 2017-08-04 19:40 +0200
      Re: [PATCH] intel-vbtn: match power button on press rather than release "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-08-05 01:40 +0200
        Re: [PATCH] intel-vbtn: match power button on press rather than  release Darren Hart <dvhart@infradead.org> - 2017-08-05 23:00 +0200
          Re: [PATCH] intel-vbtn: match power button on press rather than release "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-08-06 00:30 +0200
            Re: [PATCH] intel-vbtn: match power button on press rather than  release Darren Hart <dvhart@infradead.org> - 2017-08-07 01:30 +0200
              Re: [PATCH] intel-vbtn: match power button on press rather than release "Rafael J. Wysocki" <rafael@kernel.org> - 2017-08-07 02:40 +0200
                Re: [PATCH] intel-vbtn: match power button on press rather than release AceLan Kao <acelan.kao@canonical.com> - 2017-08-07 03:00 +0200
                  Re: [PATCH] intel-vbtn: match power button on press rather than  release Darren Hart <dvhart@infradead.org> - 2017-08-07 06:00 +0200

#1704108 — [PATCH] intel-vbtn: match power button on press rather than release

FromMario Limonciello <mario.limonciello@dell.com>
Date2017-08-04 19:10 +0200
Subject[PATCH] intel-vbtn: match power button on press rather than release
Message-ID<uaOgN-1p8-7@gated-at.bofh.it>
This fixes a problem where the system gets stuck in a loop
unable to wakeup via power button in s2idle.

The problem happens because:
 - press power button:
   - system emits 0xc0 (power press), event ignored
   - system emits 0xc1 (power release), event processed,
     emited as KEY_POWER
   - set wakeup_mode to true
   - system goes to s2idle
 - press power button
   - system emits 0xc0 (power press), wakeup_mode is true,
     system wakes
   - system emits 0xc1 (power release), event processed,
     emited as KEY_POWER
   - system goes to s2idle again

To avoid this situation, process the presses (which matches what
intel-hid does too).

Verified on an Dell XPS 9365

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
---
 drivers/platform/x86/intel-vbtn.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c
index 61f1063..4809267 100644
--- a/drivers/platform/x86/intel-vbtn.c
+++ b/drivers/platform/x86/intel-vbtn.c
@@ -36,8 +36,8 @@ static const struct acpi_device_id intel_vbtn_ids[] = {
 
 /* In theory, these are HID usages. */
 static const struct key_entry intel_vbtn_keymap[] = {
-	{ KE_IGNORE, 0xC0, { KEY_POWER } },	/* power key press */
-	{ KE_KEY, 0xC1, { KEY_POWER } },	/* power key release */
+	{ KE_KEY, 0xC0, { KEY_POWER } },	/* power key press */
+	{ KE_IGNORE, 0xC1, { KEY_POWER } },	/* power key release */
 	{ KE_KEY, 0xC4, { KEY_VOLUMEUP } },		/* volume-up key press */
 	{ KE_IGNORE, 0xC5, { KEY_VOLUMEUP } },		/* volume-up key release */
 	{ KE_KEY, 0xC6, { KEY_VOLUMEDOWN } },		/* volume-down key press */
-- 
2.7.4

[toc] | [next] | [standalone]


#1704120 — Re: [PATCH] intel-vbtn: match power button on press rather than release

FromDarren Hart <dvhart@infradead.org>
Date2017-08-04 19:40 +0200
SubjectRe: [PATCH] intel-vbtn: match power button on press rather than release
Message-ID<uaOJQ-1Av-17@gated-at.bofh.it>
In reply to#1704108
On Fri, Aug 04, 2017 at 12:00:06PM -0500, Mario Limonciello wrote:
> This fixes a problem where the system gets stuck in a loop
> unable to wakeup via power button in s2idle.
> 
> The problem happens because:
>  - press power button:
>    - system emits 0xc0 (power press), event ignored
>    - system emits 0xc1 (power release), event processed,
>      emited as KEY_POWER
>    - set wakeup_mode to true
>    - system goes to s2idle
>  - press power button
>    - system emits 0xc0 (power press), wakeup_mode is true,
>      system wakes
>    - system emits 0xc1 (power release), event processed,
>      emited as KEY_POWER
>    - system goes to s2idle again
> 
> To avoid this situation, process the presses (which matches what
> intel-hid does too).
> 
> Verified on an Dell XPS 9365
> 
> Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>

This looks good to me - responding to the release is non-intuitive IMHO
anyway.  I'd like to see agreement from AceLan, but this should go into
the 4.13 rc cycle (at rc3 currently).

-- 
Darren Hart
VMware Open Source Technology Center

[toc] | [prev] | [next] | [standalone]


#1704352

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2017-08-05 01:40 +0200
Message-ID<uaUmf-5dC-25@gated-at.bofh.it>
In reply to#1704120
On Friday, August 4, 2017 7:29:53 PM CEST Darren Hart wrote:
> On Fri, Aug 04, 2017 at 12:00:06PM -0500, Mario Limonciello wrote:
> > This fixes a problem where the system gets stuck in a loop
> > unable to wakeup via power button in s2idle.
> > 
> > The problem happens because:
> >  - press power button:
> >    - system emits 0xc0 (power press), event ignored
> >    - system emits 0xc1 (power release), event processed,
> >      emited as KEY_POWER
> >    - set wakeup_mode to true
> >    - system goes to s2idle
> >  - press power button
> >    - system emits 0xc0 (power press), wakeup_mode is true,
> >      system wakes
> >    - system emits 0xc1 (power release), event processed,
> >      emited as KEY_POWER
> >    - system goes to s2idle again
> > 
> > To avoid this situation, process the presses (which matches what
> > intel-hid does too).
> > 
> > Verified on an Dell XPS 9365
> > 
> > Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
> 
> This looks good to me - responding to the release is non-intuitive IMHO
> anyway.  I'd like to see agreement from AceLan, but this should go into
> the 4.13 rc cycle (at rc3 currently).

Yes, it should, and I'm not sure if the original author's opinion matters here.

The patch makes sense to everyone involved and fixes an annoying issue, so
I don't see any real arguments against applying it.

Please feel free to add my ACK to it if that helps.

In any case, it has to go in before https://patchwork.kernel.org/patch/9873163/
does, is if it doesn't go into 4.13-rc after all, please let me know.

Thanks,
Rafael

[toc] | [prev] | [next] | [standalone]


#1704707 — Re: [PATCH] intel-vbtn: match power button on press rather than release

FromDarren Hart <dvhart@infradead.org>
Date2017-08-05 23:00 +0200
SubjectRe: [PATCH] intel-vbtn: match power button on press rather than release
Message-ID<ubekW-1o0-29@gated-at.bofh.it>
In reply to#1704352
On Sat, Aug 05, 2017 at 01:30:20AM +0200, Rafael Wysocki wrote:
> On Friday, August 4, 2017 7:29:53 PM CEST Darren Hart wrote:
> > On Fri, Aug 04, 2017 at 12:00:06PM -0500, Mario Limonciello wrote:
> > > This fixes a problem where the system gets stuck in a loop
> > > unable to wakeup via power button in s2idle.
> > > 
> > > The problem happens because:
> > >  - press power button:
> > >    - system emits 0xc0 (power press), event ignored
> > >    - system emits 0xc1 (power release), event processed,
> > >      emited as KEY_POWER
> > >    - set wakeup_mode to true
> > >    - system goes to s2idle
> > >  - press power button
> > >    - system emits 0xc0 (power press), wakeup_mode is true,
> > >      system wakes
> > >    - system emits 0xc1 (power release), event processed,
> > >      emited as KEY_POWER
> > >    - system goes to s2idle again
> > > 
> > > To avoid this situation, process the presses (which matches what
> > > intel-hid does too).
> > > 
> > > Verified on an Dell XPS 9365
> > > 
> > > Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
> > 
> > This looks good to me - responding to the release is non-intuitive IMHO
> > anyway.  I'd like to see agreement from AceLan, but this should go into
> > the 4.13 rc cycle (at rc3 currently).
> 
> Yes, it should, and I'm not sure if the original author's opinion matters here.
> 
> The patch makes sense to everyone involved and fixes an annoying issue, so
> I don't see any real arguments against applying it.
> 
> Please feel free to add my ACK to it if that helps.

I always try to give those in MAINTAINERS a chance to respond, but I will queue
this up to fixes now.

-- 
Darren Hart
VMware Open Source Technology Center

[toc] | [prev] | [next] | [standalone]


#1704716

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2017-08-06 00:30 +0200
Message-ID<ubfK1-2mC-5@gated-at.bofh.it>
In reply to#1704707
On Saturday, August 5, 2017 10:57:53 PM CEST Darren Hart wrote:
> On Sat, Aug 05, 2017 at 01:30:20AM +0200, Rafael Wysocki wrote:
> > On Friday, August 4, 2017 7:29:53 PM CEST Darren Hart wrote:
> > > On Fri, Aug 04, 2017 at 12:00:06PM -0500, Mario Limonciello wrote:
> > > > This fixes a problem where the system gets stuck in a loop
> > > > unable to wakeup via power button in s2idle.
> > > > 
> > > > The problem happens because:
> > > >  - press power button:
> > > >    - system emits 0xc0 (power press), event ignored
> > > >    - system emits 0xc1 (power release), event processed,
> > > >      emited as KEY_POWER
> > > >    - set wakeup_mode to true
> > > >    - system goes to s2idle
> > > >  - press power button
> > > >    - system emits 0xc0 (power press), wakeup_mode is true,
> > > >      system wakes
> > > >    - system emits 0xc1 (power release), event processed,
> > > >      emited as KEY_POWER
> > > >    - system goes to s2idle again
> > > > 
> > > > To avoid this situation, process the presses (which matches what
> > > > intel-hid does too).
> > > > 
> > > > Verified on an Dell XPS 9365
> > > > 
> > > > Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
> > > 
> > > This looks good to me - responding to the release is non-intuitive IMHO
> > > anyway.  I'd like to see agreement from AceLan, but this should go into
> > > the 4.13 rc cycle (at rc3 currently).
> > 
> > Yes, it should, and I'm not sure if the original author's opinion matters here.
> > 
> > The patch makes sense to everyone involved and fixes an annoying issue, so
> > I don't see any real arguments against applying it.
> > 
> > Please feel free to add my ACK to it if that helps.
> 
> I always try to give those in MAINTAINERS a chance to respond, but I will queue
> this up to fixes now.

Thanks!

[toc] | [prev] | [next] | [standalone]


#1705024 — Re: [PATCH] intel-vbtn: match power button on press rather than release

FromDarren Hart <dvhart@infradead.org>
Date2017-08-07 01:30 +0200
SubjectRe: [PATCH] intel-vbtn: match power button on press rather than release
Message-ID<ubD9D-nK-11@gated-at.bofh.it>
In reply to#1704716
On Sun, Aug 06, 2017 at 12:20:22AM +0200, Rafael Wysocki wrote:
> On Saturday, August 5, 2017 10:57:53 PM CEST Darren Hart wrote:
> > On Sat, Aug 05, 2017 at 01:30:20AM +0200, Rafael Wysocki wrote:
> > > On Friday, August 4, 2017 7:29:53 PM CEST Darren Hart wrote:
> > > > On Fri, Aug 04, 2017 at 12:00:06PM -0500, Mario Limonciello wrote:
> > > > > This fixes a problem where the system gets stuck in a loop
> > > > > unable to wakeup via power button in s2idle.
> > > > > 
> > > > > The problem happens because:
> > > > >  - press power button:
> > > > >    - system emits 0xc0 (power press), event ignored
> > > > >    - system emits 0xc1 (power release), event processed,
> > > > >      emited as KEY_POWER
> > > > >    - set wakeup_mode to true
> > > > >    - system goes to s2idle
> > > > >  - press power button
> > > > >    - system emits 0xc0 (power press), wakeup_mode is true,
> > > > >      system wakes
> > > > >    - system emits 0xc1 (power release), event processed,
> > > > >      emited as KEY_POWER
> > > > >    - system goes to s2idle again
> > > > > 
> > > > > To avoid this situation, process the presses (which matches what
> > > > > intel-hid does too).
> > > > > 
> > > > > Verified on an Dell XPS 9365
> > > > > 
> > > > > Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
> > > > 
> > > > This looks good to me - responding to the release is non-intuitive IMHO
> > > > anyway.  I'd like to see agreement from AceLan, but this should go into
> > > > the 4.13 rc cycle (at rc3 currently).
> > > 
> > > Yes, it should, and I'm not sure if the original author's opinion matters here.
> > > 
> > > The patch makes sense to everyone involved and fixes an annoying issue, so
> > > I don't see any real arguments against applying it.
> > > 
> > > Please feel free to add my ACK to it if that helps.
> > 
> > I always try to give those in MAINTAINERS a chance to respond, but I will queue
> > this up to fixes now.
> 
> Thanks!

Rafael,

Merged to mainline (in case you were waiting on this for the dependent
patch you mentioned).

-- 
Darren Hart
VMware Open Source Technology Center

[toc] | [prev] | [next] | [standalone]


#1705032

From"Rafael J. Wysocki" <rafael@kernel.org>
Date2017-08-07 02:40 +0200
Message-ID<ubEfo-111-5@gated-at.bofh.it>
In reply to#1705024
On Mon, Aug 7, 2017 at 1:24 AM, Darren Hart <dvhart@infradead.org> wrote:
> On Sun, Aug 06, 2017 at 12:20:22AM +0200, Rafael Wysocki wrote:
>> On Saturday, August 5, 2017 10:57:53 PM CEST Darren Hart wrote:
>> > On Sat, Aug 05, 2017 at 01:30:20AM +0200, Rafael Wysocki wrote:
>> > > On Friday, August 4, 2017 7:29:53 PM CEST Darren Hart wrote:
>> > > > On Fri, Aug 04, 2017 at 12:00:06PM -0500, Mario Limonciello wrote:
>> > > > > This fixes a problem where the system gets stuck in a loop
>> > > > > unable to wakeup via power button in s2idle.
>> > > > >
>> > > > > The problem happens because:
>> > > > >  - press power button:
>> > > > >    - system emits 0xc0 (power press), event ignored
>> > > > >    - system emits 0xc1 (power release), event processed,
>> > > > >      emited as KEY_POWER
>> > > > >    - set wakeup_mode to true
>> > > > >    - system goes to s2idle
>> > > > >  - press power button
>> > > > >    - system emits 0xc0 (power press), wakeup_mode is true,
>> > > > >      system wakes
>> > > > >    - system emits 0xc1 (power release), event processed,
>> > > > >      emited as KEY_POWER
>> > > > >    - system goes to s2idle again
>> > > > >
>> > > > > To avoid this situation, process the presses (which matches what
>> > > > > intel-hid does too).
>> > > > >
>> > > > > Verified on an Dell XPS 9365
>> > > > >
>> > > > > Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
>> > > >
>> > > > This looks good to me - responding to the release is non-intuitive IMHO
>> > > > anyway.  I'd like to see agreement from AceLan, but this should go into
>> > > > the 4.13 rc cycle (at rc3 currently).
>> > >
>> > > Yes, it should, and I'm not sure if the original author's opinion matters here.
>> > >
>> > > The patch makes sense to everyone involved and fixes an annoying issue, so
>> > > I don't see any real arguments against applying it.
>> > >
>> > > Please feel free to add my ACK to it if that helps.
>> >
>> > I always try to give those in MAINTAINERS a chance to respond, but I will queue
>> > this up to fixes now.
>>
>> Thanks!
>
> Rafael,
>
> Merged to mainline (in case you were waiting on this for the dependent
> patch you mentioned).

Awesome, thanks!

[toc] | [prev] | [next] | [standalone]


#1705033

FromAceLan Kao <acelan.kao@canonical.com>
Date2017-08-07 03:00 +0200
Message-ID<ubEyK-17m-13@gated-at.bofh.it>
In reply to#1705032
Looks like I'm one hour late to ack the patch.
Thanks any way for the quick response.

2017-08-07 8:38 GMT+08:00 Rafael J. Wysocki <rafael@kernel.org>:
> On Mon, Aug 7, 2017 at 1:24 AM, Darren Hart <dvhart@infradead.org> wrote:
>> On Sun, Aug 06, 2017 at 12:20:22AM +0200, Rafael Wysocki wrote:
>>> On Saturday, August 5, 2017 10:57:53 PM CEST Darren Hart wrote:
>>> > On Sat, Aug 05, 2017 at 01:30:20AM +0200, Rafael Wysocki wrote:
>>> > > On Friday, August 4, 2017 7:29:53 PM CEST Darren Hart wrote:
>>> > > > On Fri, Aug 04, 2017 at 12:00:06PM -0500, Mario Limonciello wrote:
>>> > > > > This fixes a problem where the system gets stuck in a loop
>>> > > > > unable to wakeup via power button in s2idle.
>>> > > > >
>>> > > > > The problem happens because:
>>> > > > >  - press power button:
>>> > > > >    - system emits 0xc0 (power press), event ignored
>>> > > > >    - system emits 0xc1 (power release), event processed,
>>> > > > >      emited as KEY_POWER
>>> > > > >    - set wakeup_mode to true
>>> > > > >    - system goes to s2idle
>>> > > > >  - press power button
>>> > > > >    - system emits 0xc0 (power press), wakeup_mode is true,
>>> > > > >      system wakes
>>> > > > >    - system emits 0xc1 (power release), event processed,
>>> > > > >      emited as KEY_POWER
>>> > > > >    - system goes to s2idle again
>>> > > > >
>>> > > > > To avoid this situation, process the presses (which matches what
>>> > > > > intel-hid does too).
>>> > > > >
>>> > > > > Verified on an Dell XPS 9365
>>> > > > >
>>> > > > > Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
>>> > > >
>>> > > > This looks good to me - responding to the release is non-intuitive IMHO
>>> > > > anyway.  I'd like to see agreement from AceLan, but this should go into
>>> > > > the 4.13 rc cycle (at rc3 currently).
>>> > >
>>> > > Yes, it should, and I'm not sure if the original author's opinion matters here.
>>> > >
>>> > > The patch makes sense to everyone involved and fixes an annoying issue, so
>>> > > I don't see any real arguments against applying it.
>>> > >
>>> > > Please feel free to add my ACK to it if that helps.
>>> >
>>> > I always try to give those in MAINTAINERS a chance to respond, but I will queue
>>> > this up to fixes now.
>>>
>>> Thanks!
>>
>> Rafael,
>>
>> Merged to mainline (in case you were waiting on this for the dependent
>> patch you mentioned).
>
> Awesome, thanks!

[toc] | [prev] | [next] | [standalone]


#1705079 — Re: [PATCH] intel-vbtn: match power button on press rather than release

FromDarren Hart <dvhart@infradead.org>
Date2017-08-07 06:00 +0200
SubjectRe: [PATCH] intel-vbtn: match power button on press rather than release
Message-ID<ubHmW-2YE-19@gated-at.bofh.it>
In reply to#1705033
On Mon, Aug 07, 2017 at 08:59:30AM +0800, AceLan Kao wrote:
> Looks like I'm one hour late to ack the patch.
> Thanks any way for the quick response.

Thanks for chiming in all the same - and normally I'd have provided for
more time. In this case, I will be away for a few days, and it was
important to get this in sooner rather than later in the RC cycle.

-- 
Darren Hart
VMware Open Source Technology Center

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web