linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/x86: hp-wmi: Actually use mask parameter in hp_wmi_hw_state
@ 2017-11-28 15:17 Michel Dänzer
  2017-11-28 16:57 ` Darren Hart
  0 siblings, 1 reply; 9+ messages in thread
From: Michel Dänzer @ 2017-11-28 15:17 UTC (permalink / raw)
  To: Darren Hart, Andy Shevchenko; +Cc: platform-driver-x86, linux-kernel

We were always checking bit 0 (which represents the docked state)
regardless of the mask.

Fixes the "tablet mode" state always being reported the same as the
docked state, which with current libinput can cause the built-in input
devices of laptops to be incorrectly disabled while docked.

Cc: stable@vger.kernel.org
Fixes: ("platform/x86: hp-wmi: Refactor dock and tablet state fetchers")
Signed-off-by: Michel Dänzer <michel@daenzer.net>
---
 drivers/platform/x86/hp-wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index b4ed3dc983d5..2bdd6bbdb353 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -297,7 +297,7 @@ static int hp_wmi_hw_state(int mask)
 	if (state < 0)
 		return state;
 
-	return state & 0x1;
+	return (state & mask) ? 1 : 0;
 }
 
 static int __init hp_wmi_bios_2008_later(void)
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] platform/x86: hp-wmi: Actually use mask parameter in hp_wmi_hw_state
  2017-11-28 15:17 [PATCH] platform/x86: hp-wmi: Actually use mask parameter in hp_wmi_hw_state Michel Dänzer
@ 2017-11-28 16:57 ` Darren Hart
  2017-11-28 18:06   ` Michel Dänzer
  0 siblings, 1 reply; 9+ messages in thread
From: Darren Hart @ 2017-11-28 16:57 UTC (permalink / raw)
  To: Michel Dänzer; +Cc: Andy Shevchenko, platform-driver-x86, linux-kernel

On Tue, Nov 28, 2017 at 04:17:58PM +0100, Michel Dänzer wrote:
> We were always checking bit 0 (which represents the docked state)
> regardless of the mask.
> 
> Fixes the "tablet mode" state always being reported the same as the
> docked state, which with current libinput can cause the built-in input
> devices of laptops to be incorrectly disabled while docked.
> 
> Cc: stable@vger.kernel.org
> Fixes: ("platform/x86: hp-wmi: Refactor dock and tablet state fetchers")
> Signed-off-by: Michel Dänzer <michel@daenzer.net>
> ---
>  drivers/platform/x86/hp-wmi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
> index b4ed3dc983d5..2bdd6bbdb353 100644
> --- a/drivers/platform/x86/hp-wmi.c
> +++ b/drivers/platform/x86/hp-wmi.c
> @@ -297,7 +297,7 @@ static int hp_wmi_hw_state(int mask)
>  	if (state < 0)
>  		return state;
>  
> -	return state & 0x1;
> +	return (state & mask) ? 1 : 0;

The current code does:

return !!(state & mask);

See:
9968e12 platform/x86: hp-wmi: Fix tablet mode detection for convertibles

Merged in 4.15-rc1

-- 
Darren Hart
VMware Open Source Technology Center

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] platform/x86: hp-wmi: Actually use mask parameter in hp_wmi_hw_state
  2017-11-28 16:57 ` Darren Hart
@ 2017-11-28 18:06   ` Michel Dänzer
  2017-11-28 19:30     ` Andy Shevchenko
  0 siblings, 1 reply; 9+ messages in thread
From: Michel Dänzer @ 2017-11-28 18:06 UTC (permalink / raw)
  To: Darren Hart; +Cc: Andy Shevchenko, platform-driver-x86, linux-kernel

On 2017-11-28 05:57 PM, Darren Hart wrote:
> On Tue, Nov 28, 2017 at 04:17:58PM +0100, Michel Dänzer wrote:
>> We were always checking bit 0 (which represents the docked state)
>> regardless of the mask.
>>
>> Fixes the "tablet mode" state always being reported the same as the
>> docked state, which with current libinput can cause the built-in input
>> devices of laptops to be incorrectly disabled while docked.
>>
>> Cc: stable@vger.kernel.org
>> Fixes: ("platform/x86: hp-wmi: Refactor dock and tablet state fetchers")
>> Signed-off-by: Michel Dänzer <michel@daenzer.net>
>> ---
>>  drivers/platform/x86/hp-wmi.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
>> index b4ed3dc983d5..2bdd6bbdb353 100644
>> --- a/drivers/platform/x86/hp-wmi.c
>> +++ b/drivers/platform/x86/hp-wmi.c
>> @@ -297,7 +297,7 @@ static int hp_wmi_hw_state(int mask)
>>  	if (state < 0)
>>  		return state;
>>  
>> -	return state & 0x1;
>> +	return (state & mask) ? 1 : 0;
> 
> The current code does:
> 
> return !!(state & mask);
> 
> See:
> 9968e12 platform/x86: hp-wmi: Fix tablet mode detection for convertibles
> 
> Merged in 4.15-rc1

AFAIK commits without

 Cc: stable@vger.kernel.org

don't get automatically picked up for stable branches. Can you manually
nominate 9968e12 for stable?


Thanks,


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] platform/x86: hp-wmi: Actually use mask parameter in hp_wmi_hw_state
  2017-11-28 18:06   ` Michel Dänzer
@ 2017-11-28 19:30     ` Andy Shevchenko
  2017-11-28 19:41       ` Michel Dänzer
  0 siblings, 1 reply; 9+ messages in thread
From: Andy Shevchenko @ 2017-11-28 19:30 UTC (permalink / raw)
  To: Michel Dänzer
  Cc: Darren Hart, Andy Shevchenko, Platform Driver, linux-kernel

On Tue, Nov 28, 2017 at 8:06 PM, Michel Dänzer <michel@daenzer.net> wrote:
> On 2017-11-28 05:57 PM, Darren Hart wrote:
>> On Tue, Nov 28, 2017 at 04:17:58PM +0100, Michel Dänzer wrote:
>>> We were always checking bit 0 (which represents the docked state)
>>> regardless of the mask.
>>>
>>> Fixes the "tablet mode" state always being reported the same as the
>>> docked state, which with current libinput can cause the built-in input
>>> devices of laptops to be incorrectly disabled while docked.

>> Merged in 4.15-rc1
>
> AFAIK commits without
>
>  Cc: stable@vger.kernel.org
>
> don't get automatically picked up for stable branches. Can you manually
> nominate 9968e12 for stable?

AFAIK Greg picks up patches based on Fixes tag as well.
Feel free to ping us or just forward that one yourself if Greg will
not pick up in reasonable (month?) time.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] platform/x86: hp-wmi: Actually use mask parameter in hp_wmi_hw_state
  2017-11-28 19:30     ` Andy Shevchenko
@ 2017-11-28 19:41       ` Michel Dänzer
  2017-12-01 19:39         ` Darren Hart
  2017-12-01 19:52         ` Andy Shevchenko
  0 siblings, 2 replies; 9+ messages in thread
From: Michel Dänzer @ 2017-11-28 19:41 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Darren Hart, Andy Shevchenko, Platform Driver, linux-kernel

On 2017-11-28 08:30 PM, Andy Shevchenko wrote:
> On Tue, Nov 28, 2017 at 8:06 PM, Michel Dänzer <michel@daenzer.net> wrote:
>> On 2017-11-28 05:57 PM, Darren Hart wrote:
>>> On Tue, Nov 28, 2017 at 04:17:58PM +0100, Michel Dänzer wrote:
>>>> We were always checking bit 0 (which represents the docked state)
>>>> regardless of the mask.
>>>>
>>>> Fixes the "tablet mode" state always being reported the same as the
>>>> docked state, which with current libinput can cause the built-in input
>>>> devices of laptops to be incorrectly disabled while docked.
> 
>>> Merged in 4.15-rc1
>>
>> AFAIK commits without
>>
>>  Cc: stable@vger.kernel.org
>>
>> don't get automatically picked up for stable branches. Can you manually
>> nominate 9968e12 for stable?
> 
> AFAIK Greg picks up patches based on Fixes tag as well.
> Feel free to ping us or just forward that one yourself if Greg will
> not pick up in reasonable (month?) time.

Both 4.14.1 and 4.14.2 were released after Linus merged the fix, but
neither has it. Given that, and that a fair number of people seem to be
running into this, seems like a good idea to do it ASAP.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] platform/x86: hp-wmi: Actually use mask parameter in hp_wmi_hw_state
  2017-11-28 19:41       ` Michel Dänzer
@ 2017-12-01 19:39         ` Darren Hart
  2017-12-04  8:31           ` Michel Dänzer
  2017-12-01 19:52         ` Andy Shevchenko
  1 sibling, 1 reply; 9+ messages in thread
From: Darren Hart @ 2017-12-01 19:39 UTC (permalink / raw)
  To: Michel Dänzer
  Cc: Andy Shevchenko, Andy Shevchenko, Platform Driver, linux-kernel

On Tue, Nov 28, 2017 at 08:41:47PM +0100, Michel Dänzer wrote:
> On 2017-11-28 08:30 PM, Andy Shevchenko wrote:
> > On Tue, Nov 28, 2017 at 8:06 PM, Michel Dänzer <michel@daenzer.net> wrote:
> >> On 2017-11-28 05:57 PM, Darren Hart wrote:
> >>> On Tue, Nov 28, 2017 at 04:17:58PM +0100, Michel Dänzer wrote:
> >>>> We were always checking bit 0 (which represents the docked state)
> >>>> regardless of the mask.
> >>>>
> >>>> Fixes the "tablet mode" state always being reported the same as the
> >>>> docked state, which with current libinput can cause the built-in input
> >>>> devices of laptops to be incorrectly disabled while docked.
> > 
> >>> Merged in 4.15-rc1
> >>
> >> AFAIK commits without
> >>
> >>  Cc: stable@vger.kernel.org
> >>
> >> don't get automatically picked up for stable branches. Can you manually
> >> nominate 9968e12 for stable?
> > 
> > AFAIK Greg picks up patches based on Fixes tag as well.
> > Feel free to ping us or just forward that one yourself if Greg will
> > not pick up in reasonable (month?) time.
> 
> Both 4.14.1 and 4.14.2 were released after Linus merged the fix, but

Based on Documentation/process/stable-kernel-rules.rst, this seems unlikely to
happen automatically.

> neither has it. Given that, and that a fair number of people seem to be
> running into this, seems like a good idea to do it ASAP.

This is our responsibility to check if patches are candidates for stable, and
the Fixes tag should be a trigger for us, the maintainers, to do that check.
Sometimes we miss things, sometimes the dependencies are more than they are
worth. In this case, we just missed it.

You can just send this in yourself using the original fix and following the
process in stable-kernel-rules.rst.

However, that means I need to pay closer attention when Greg's
auto-merge-bot-email lands in my Inbox asking if I object.

I'll send this one to stable myself, thanks for calling our attention to it.

-- 
Darren Hart
VMware Open Source Technology Center

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] platform/x86: hp-wmi: Actually use mask parameter in hp_wmi_hw_state
  2017-11-28 19:41       ` Michel Dänzer
  2017-12-01 19:39         ` Darren Hart
@ 2017-12-01 19:52         ` Andy Shevchenko
  2017-12-01 20:13           ` Darren Hart
  1 sibling, 1 reply; 9+ messages in thread
From: Andy Shevchenko @ 2017-12-01 19:52 UTC (permalink / raw)
  To: Michel Dänzer
  Cc: Darren Hart, Andy Shevchenko, Platform Driver, linux-kernel

On Tue, Nov 28, 2017 at 9:41 PM, Michel Dänzer <michel@daenzer.net> wrote:
> On 2017-11-28 08:30 PM, Andy Shevchenko wrote:
>> On Tue, Nov 28, 2017 at 8:06 PM, Michel Dänzer <michel@daenzer.net> wrote:
>>> On 2017-11-28 05:57 PM, Darren Hart wrote:

>>>> Merged in 4.15-rc1
>>>
>>> AFAIK commits without
>>>
>>>  Cc: stable@vger.kernel.org
>>>
>>> don't get automatically picked up for stable branches. Can you manually
>>> nominate 9968e12 for stable?
>>
>> AFAIK Greg picks up patches based on Fixes tag as well.
>> Feel free to ping us or just forward that one yourself if Greg will
>> not pick up in reasonable (month?) time.
>
> Both 4.14.1 and 4.14.2 were released after Linus merged the fix, but
> neither has it. Given that, and that a fair number of people seem to be
> running into this, seems like a good idea to do it ASAP.

JFYI:

Thu, 30 Nov 2017 14:34:39 +0000 (11/30/2017 04:34:39 PM)

This is a note to let you know that I've just added the patch titled
to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] platform/x86: hp-wmi: Actually use mask parameter in hp_wmi_hw_state
  2017-12-01 19:52         ` Andy Shevchenko
@ 2017-12-01 20:13           ` Darren Hart
  0 siblings, 0 replies; 9+ messages in thread
From: Darren Hart @ 2017-12-01 20:13 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Michel Dänzer, Andy Shevchenko, Platform Driver, linux-kernel

On Fri, Dec 01, 2017 at 09:52:27PM +0200, Andy Shevchenko wrote:
> On Tue, Nov 28, 2017 at 9:41 PM, Michel Dänzer <michel@daenzer.net> wrote:
> > On 2017-11-28 08:30 PM, Andy Shevchenko wrote:
> >> On Tue, Nov 28, 2017 at 8:06 PM, Michel Dänzer <michel@daenzer.net> wrote:
> >>> On 2017-11-28 05:57 PM, Darren Hart wrote:
> 
> >>>> Merged in 4.15-rc1
> >>>
> >>> AFAIK commits without
> >>>
> >>>  Cc: stable@vger.kernel.org
> >>>
> >>> don't get automatically picked up for stable branches. Can you manually
> >>> nominate 9968e12 for stable?
> >>
> >> AFAIK Greg picks up patches based on Fixes tag as well.
> >> Feel free to ping us or just forward that one yourself if Greg will
> >> not pick up in reasonable (month?) time.
> >
> > Both 4.14.1 and 4.14.2 were released after Linus merged the fix, but
> > neither has it. Given that, and that a fair number of people seem to be
> > running into this, seems like a good idea to do it ASAP.
> 
> JFYI:
> 
> Thu, 30 Nov 2017 14:34:39 +0000 (11/30/2017 04:34:39 PM)
> 
> This is a note to let you know that I've just added the patch titled
> to the 4.14-stable tree which can be found at:
>     http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

Ah well, too little too late on my part I guess.

-- 
Darren Hart
VMware Open Source Technology Center

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] platform/x86: hp-wmi: Actually use mask parameter in hp_wmi_hw_state
  2017-12-01 19:39         ` Darren Hart
@ 2017-12-04  8:31           ` Michel Dänzer
  0 siblings, 0 replies; 9+ messages in thread
From: Michel Dänzer @ 2017-12-04  8:31 UTC (permalink / raw)
  To: Darren Hart
  Cc: Andy Shevchenko, Andy Shevchenko, Platform Driver, linux-kernel

On 2017-12-01 08:39 PM, Darren Hart wrote:
> On Tue, Nov 28, 2017 at 08:41:47PM +0100, Michel Dänzer wrote:
>> On 2017-11-28 08:30 PM, Andy Shevchenko wrote:
>>> On Tue, Nov 28, 2017 at 8:06 PM, Michel Dänzer <michel@daenzer.net> wrote:
>>>> On 2017-11-28 05:57 PM, Darren Hart wrote:
>>>>> On Tue, Nov 28, 2017 at 04:17:58PM +0100, Michel Dänzer wrote:
>>>>>> We were always checking bit 0 (which represents the docked state)
>>>>>> regardless of the mask.
>>>>>>
>>>>>> Fixes the "tablet mode" state always being reported the same as the
>>>>>> docked state, which with current libinput can cause the built-in input
>>>>>> devices of laptops to be incorrectly disabled while docked.
>>>
>>>>> Merged in 4.15-rc1
>>>>
>>>> AFAIK commits without
>>>>
>>>>  Cc: stable@vger.kernel.org
>>>>
>>>> don't get automatically picked up for stable branches. Can you manually
>>>> nominate 9968e12 for stable?
>>>
>>> AFAIK Greg picks up patches based on Fixes tag as well.
>>> Feel free to ping us or just forward that one yourself if Greg will
>>> not pick up in reasonable (month?) time.
>>
>> Both 4.14.1 and 4.14.2 were released after Linus merged the fix, but
> 
> Based on Documentation/process/stable-kernel-rules.rst, this seems unlikely to
> happen automatically.

Right, because there's no Cc: stable@vger.kernel.org in the commit log,
that was my point above. :)


>> neither has it. Given that, and that a fair number of people seem to be
>> running into this, seems like a good idea to do it ASAP.
> 
> This is our responsibility to check if patches are candidates for stable, and
> the Fixes tag should be a trigger for us, the maintainers, to do that check.
> Sometimes we miss things, sometimes the dependencies are more than they are
> worth. In this case, we just missed it.
> 
> You can just send this in yourself using the original fix and following the
> process in stable-kernel-rules.rst.

I did, and Greg picked it up promptly. I forgot to Cc you guys on the
nomination e-mail, sorry about that.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-12-04  8:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-28 15:17 [PATCH] platform/x86: hp-wmi: Actually use mask parameter in hp_wmi_hw_state Michel Dänzer
2017-11-28 16:57 ` Darren Hart
2017-11-28 18:06   ` Michel Dänzer
2017-11-28 19:30     ` Andy Shevchenko
2017-11-28 19:41       ` Michel Dänzer
2017-12-01 19:39         ` Darren Hart
2017-12-04  8:31           ` Michel Dänzer
2017-12-01 19:52         ` Andy Shevchenko
2017-12-01 20:13           ` Darren Hart

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).