Skip to contentSkip to conversation

platform/x86: hp-wmi: Actually use mask parameter in hp_wmi_hw_state

PATCH Applied Michel Dänzer 3 participants 9 messages Nov 28, 2017 – Dec 4, 2017 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: hp-wmi: Actually use mask parameter in hp_wmi_hw_state

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.

Fixes ("platform/x86: hp-wmi: Refactor dock and tablet state fetchers")
---
 drivers/platform/x86/hp-wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/hp-wmi.c +1 -1
index b4ed3dc983d5..2bdd6bbdb353 100644
@@ -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)
Signature · 1 line
2.15.0
#1 lore raw
Quoted 19 lines · Michel Dänzer

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.

Fixes ("platform/x86: hp-wmi: Refactor dock and tablet state fetchers")
---
 drivers/platform/x86/hp-wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/hp-wmi.c +0 -0
index b4ed3dc983d5..2bdd6bbdb353 100644

drivers/platform/x86/hp-wmi.c static int hp_wmi_hw_state(int mask) · line 300

Quoted 5 lines
drivers/platform/x86/hp-wmi.c +1 -1
@@ -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

Signature · 2 lines
Darren Hart
VMware Open Source Technology Center
#2 lore raw
Quoted 28 lines · Darren Hart
Quoted 19 lines · Michel Dänzer

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.

Fixes ("platform/x86: hp-wmi: Refactor dock and tablet state fetchers")
---
 drivers/platform/x86/hp-wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/hp-wmi.c +0 -0
index b4ed3dc983d5..2bdd6bbdb353 100644

drivers/platform/x86/hp-wmi.c static int hp_wmi_hw_state(int mask) · line 300

Quoted 5 lines
drivers/platform/x86/hp-wmi.c +1 -1
@@ -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:

Quoted 6 lines

return !!(state & mask);

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

Merged in 4.15-rc1

AFAIK commits without

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

Thanks,

Signature · 2 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
#3 lore raw
Quoted 9 lines · Michel Dänzer
Quoted 7 lines · Darren Hart
Quoted 6 lines · Michel Dänzer

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.

Quoted 8 lines
Quoted 1 line

Merged in 4.15-rc1

AFAIK commits without

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.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#4 lore raw
Quoted 14 lines · Andy Shevchenko
Quoted 13 lines · Michel Dänzer
Quoted 9 lines · Darren Hart
Quoted 6 lines · Michel Dänzer

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

Quoted 8 lines
Quoted 4 lines

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.

Signature · 2 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
#5 lore raw
Quoted 17 lines · Michel Dänzer
Quoted 16 lines · Andy Shevchenko
Quoted 15 lines · Michel Dänzer
Quoted 9 lines · Darren Hart
Quoted 6 lines · Michel Dänzer

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

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

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.

Quoted 2 lines

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.

Signature · 2 lines
Darren Hart
VMware Open Source Technology Center
#6 lore raw
Quoted 21 lines · Darren Hart
Quoted 20 lines · Michel Dänzer
Quoted 19 lines · Andy Shevchenko
Quoted 17 lines · Michel Dänzer
Quoted 9 lines · Darren Hart
Quoted 6 lines · Michel Dänzer

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

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

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

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: [email protected] in the commit log, that was my point above. :)

Quoted 10 lines
Quoted 2 lines

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.

Signature · 2 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
#7 lore raw
In reply to Michel Dänzer
Quoted 13 lines · Michel Dänzer
Quoted 12 lines · Andy Shevchenko
Quoted 10 lines · Michel Dänzer
Quoted 1 line · Darren Hart

Merged in 4.15-rc1

AFAIK commits without

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

Quoted 7 lines
Quoted 3 lines

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

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#8 lore raw
Quoted 22 lines · Andy Shevchenko
Quoted 13 lines · Michel Dänzer
Quoted 12 lines · Andy Shevchenko
Quoted 10 lines · Michel Dänzer
Quoted 1 line · Darren Hart

Merged in 4.15-rc1

AFAIK commits without

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

Quoted 7 lines
Quoted 3 lines

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.

Quoted 7 lines

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.

Signature · 2 lines
Darren Hart
VMware Open Source Technology Center