Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Thinkpad Yoga Gen8, 6.11 regression] Pen is always in eraser mode #440

Closed
inducer opened this issue Sep 18, 2024 · 11 comments
Closed

[Thinkpad Yoga Gen8, 6.11 regression] Pen is always in eraser mode #440

inducer opened this issue Sep 18, 2024 · 11 comments
Assignees

Comments

@inducer
Copy link

inducer commented Sep 18, 2024

As of kernel 6.11 (rc3 is the earliest I know is affected, 6.11 release is, too, 6.9 definitely not), I have the problem that multiple pens I use, including the "Lenovo Precision Pen 2" and the "Dell Active Pen PN579X" seem to always be in eraser mode when used with the Wacom touchscreen device in my machine. libinput reports this as

/dev/input/event7:	Wacom HID 5344 Pen
/dev/input/event8:	Wacom HID 5344 Finger

Here is a libinput event log covering my just bringing the pen into proximity and removing it, my finger is nowhere near the eraser button. Yet still

$ grep -i rubber /tmp/evtlog.txt
    #   Event code 321 (BTN_TOOL_RUBBER)
    - [  0,      0,   1, 321,       1] # EV_KEY / BTN_TOOL_RUBBER           1
    - [  0, 687022,   1, 321,       0] # EV_KEY / BTN_TOOL_RUBBER           0

libinput is at 1.26 as installed by Debian, but this seems to be a kernel issue; it appears and disappears depending on the kernel version.

@RayJW
Copy link

RayJW commented Oct 7, 2024

I reported the issue to libinput as I was unsure where, what was breaking. Seems like this might be the more appropriate place. I'll leave this here in case the additional logs help, and will close my issue if it is confirmed that this is a kernel driver problem.

@jigpu
Copy link
Member

jigpu commented Oct 7, 2024

I suspect the issue might be caused by a recent simplification to our tool type logic.

  1. Please install the "git" command-line tool.
  2. Run git clone https://github.com/jigpu/input-wacom.git -b fix-440 to get a copy of the driver with a potential fix.
  3. Follow the instructions on our Installing input-wacom from source wiki page (building the copy of "input-wacom" from step 2 rather than downloading the most recent release).

After you build and install the driver, reboot and run grep "" /sys/module/wacom*/version to verify the driver version. It should be v2.00-1.2.0.35.gd6fa49e. Check to see if the pen works normally again.

@jigpu jigpu self-assigned this Oct 7, 2024
@RayJW
Copy link

RayJW commented Oct 7, 2024

I suspect the issue might be caused by a recent simplification to our tool type logic.

1. Please install the "git" command-line tool.

2. Run `git clone https://github.com/jigpu/input-wacom.git -b fix-440` to get a copy of the driver with a potential fix.

3. Follow the instructions on our [Installing input-wacom from source](https://github.com/linuxwacom/input-wacom/wiki/Installing-input-wacom-from-source) wiki page (building the copy of "input-wacom" from step 2 rather than downloading the most recent release).

After you build and install the driver, reboot and run grep "" /sys/module/wacom*/version to verify the driver version. It should be v2.00-1.2.0.35.gd6fa49e. Check to see if the pen works normally again.

I just verified that this revert does indeed fix the problem. Everything is working as it did with kernel version 6.11 now :)

@GabriF
Copy link

GabriF commented Oct 7, 2024

IdeapadFlex 14ABR8 same problem. Currently using linux-lts kernel 6.6.54 to make pen work correctly. Does not work with kernel 6.11.1

@jigpu
Copy link
Member

jigpu commented Oct 7, 2024

Thanks, @RayJW . I'll work with the other devs to get this fixed upstream.

@jigpu
Copy link
Member

jigpu commented Oct 8, 2024

@RayJW Could you please test an updated version of the fix for me? We decided to try a more focused approach rather than simply reverting the whole patch. You can get the new version by running git clone https://github.com/jigpu/input-wacom.git -b fix-440b and then rebuilding/reinstalling. This patch should report its version as v2.00-0.49.0.66.gf169e18.

If this updated version still works well, I'll send it upstream to the LKML so that it gets fixed ASAP.

@RayJW
Copy link

RayJW commented Oct 8, 2024

@RayJW Could you please test an updated version of the fix for me? We decided to try a more focused approach rather than simply reverting the whole patch. You can get the new version by running git clone https://github.com/jigpu/input-wacom.git -b fix-440b and then rebuilding/reinstalling. This patch should report its version as v2.00-0.49.0.66.gf169e18.

If this updated version still works well, I'll send it upstream to the LKML so that it gets fixed ASAP.

Hmm, for some reason when I run grep "" /sys/module/wacom*/version it reports v2.00-1.2.0.36.g7fe0cda but since that does differ from the previous fix I'll assume that this is correct. I can confirm with the driver from branch fix-440b the pen works as expected, and as it did with the 6.10 kernel.

@jigpu
Copy link
Member

jigpu commented Oct 9, 2024

Thanks for testing. I got the wrong version number for some reason. The version that you listed looks correct (it has the expected commit hash at the end, unlike the number I posted). I'll go ahead and get the changes sent off to the LKML.

@inducer
Copy link
Author

inducer commented Oct 9, 2024

Just to confirm: I've now also tested the patch (by applying it directly on top of 6.11.2), and I'm happy to report that this seems to address the issue. Thanks for putting together a fix!

jigpu added a commit to jigpu/input-wacom that referenced this issue Oct 11, 2024
Unlike EMR tools which encode type information in their tool ID, tools
for AES sensors are all "generic pens". It is inappropriate to make use
of the wacom_intuos_get_tool_type function when dealing with these kinds
of devices. Instead, we should only ever report BTN_TOOL_PEN or
BTN_TOOL_RUBBER, as depending on the state of the Eraser and Invert
bits.

Reported-by: Daniel Jutz <[email protected]>
Closes: https://lore.kernel.org/linux-input/[email protected]/
Bisected-by: Christian Heusel <[email protected]>
Fixes: 9c2913b962da ("HID: wacom: more appropriate tool type categorization")
Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1041
Link: linuxwacom#440
Signed-off-by: Jason Gerecke <[email protected]>
Cc: [email protected]
Acked-by: Benjamin Tissoires <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
[[email protected]: Imported into input-wacom (2934b12281ab)]
Signed-off-by: Jason Gerecke <[email protected]>
@jigpu
Copy link
Member

jigpu commented Oct 11, 2024

Patch has been accepted upstream for Linux 6.12. It should also be automatically backported to stable kernels in the future once its a bit further along the LKML processes.

I've pushed the fix to the master branch of input-wacom, so you should also get the fix when building from source.

@jigpu jigpu closed this as completed Oct 11, 2024
@RayJW
Copy link

RayJW commented Oct 11, 2024

Patch has been accepted upstream for Linux 6.12. It should also be automatically backported to stable kernels in the future once its a bit further along the LKML processes.

I've pushed the fix to the master branch of input-wacom, so you should also get the fix when building from source.

Thank you for the great work! I assume master doesn't differ from the patch on branch fix-440b, so reinstalling isn't really necessary?

torvalds pushed a commit to torvalds/linux that referenced this issue Oct 13, 2024
Unlike EMR tools which encode type information in their tool ID, tools
for AES sensors are all "generic pens". It is inappropriate to make use
of the wacom_intuos_get_tool_type function when dealing with these kinds
of devices. Instead, we should only ever report BTN_TOOL_PEN or
BTN_TOOL_RUBBER, as depending on the state of the Eraser and Invert
bits.

Reported-by: Daniel Jutz <[email protected]>
Closes: https://lore.kernel.org/linux-input/[email protected]/
Bisected-by: Christian Heusel <[email protected]>
Fixes: 9c2913b ("HID: wacom: more appropriate tool type categorization")
Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1041
Link: linuxwacom/input-wacom#440
Signed-off-by: Jason Gerecke <[email protected]>
Cc: [email protected]
Acked-by: Benjamin Tissoires <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
mj22226 pushed a commit to mj22226/linux that referenced this issue Oct 14, 2024
commit 2934b12 upstream.

Unlike EMR tools which encode type information in their tool ID, tools
for AES sensors are all "generic pens". It is inappropriate to make use
of the wacom_intuos_get_tool_type function when dealing with these kinds
of devices. Instead, we should only ever report BTN_TOOL_PEN or
BTN_TOOL_RUBBER, as depending on the state of the Eraser and Invert
bits.

Reported-by: Daniel Jutz <[email protected]>
Closes: https://lore.kernel.org/linux-input/[email protected]/
Bisected-by: Christian Heusel <[email protected]>
Fixes: 9c2913b ("HID: wacom: more appropriate tool type categorization")
Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1041
Link: linuxwacom/input-wacom#440
Signed-off-by: Jason Gerecke <[email protected]>
Cc: [email protected]
Acked-by: Benjamin Tissoires <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
johnny-mnemonic pushed a commit to linux-ia64/linux-stable-rc that referenced this issue Oct 15, 2024
commit 2934b12 upstream.

Unlike EMR tools which encode type information in their tool ID, tools
for AES sensors are all "generic pens". It is inappropriate to make use
of the wacom_intuos_get_tool_type function when dealing with these kinds
of devices. Instead, we should only ever report BTN_TOOL_PEN or
BTN_TOOL_RUBBER, as depending on the state of the Eraser and Invert
bits.

Reported-by: Daniel Jutz <[email protected]>
Closes: https://lore.kernel.org/linux-input/[email protected]/
Bisected-by: Christian Heusel <[email protected]>
Fixes: 9c2913b ("HID: wacom: more appropriate tool type categorization")
Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1041
Link: linuxwacom/input-wacom#440
Signed-off-by: Jason Gerecke <[email protected]>
Cc: [email protected]
Acked-by: Benjamin Tissoires <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
KexyBiscuit pushed a commit to AOSC-Tracking/linux that referenced this issue Oct 15, 2024
commit 2934b12 upstream.

Unlike EMR tools which encode type information in their tool ID, tools
for AES sensors are all "generic pens". It is inappropriate to make use
of the wacom_intuos_get_tool_type function when dealing with these kinds
of devices. Instead, we should only ever report BTN_TOOL_PEN or
BTN_TOOL_RUBBER, as depending on the state of the Eraser and Invert
bits.

Reported-by: Daniel Jutz <[email protected]>
Closes: https://lore.kernel.org/linux-input/[email protected]/
Bisected-by: Christian Heusel <[email protected]>
Fixes: 9c2913b ("HID: wacom: more appropriate tool type categorization")
Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1041
Link: linuxwacom/input-wacom#440
Signed-off-by: Jason Gerecke <[email protected]>
Cc: [email protected]
Acked-by: Benjamin Tissoires <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
johnny-mnemonic pushed a commit to linux-ia64/linux-stable-rc that referenced this issue Oct 16, 2024
commit 2934b12 upstream.

Unlike EMR tools which encode type information in their tool ID, tools
for AES sensors are all "generic pens". It is inappropriate to make use
of the wacom_intuos_get_tool_type function when dealing with these kinds
of devices. Instead, we should only ever report BTN_TOOL_PEN or
BTN_TOOL_RUBBER, as depending on the state of the Eraser and Invert
bits.

Reported-by: Daniel Jutz <[email protected]>
Closes: https://lore.kernel.org/linux-input/[email protected]/
Bisected-by: Christian Heusel <[email protected]>
Fixes: 9c2913b ("HID: wacom: more appropriate tool type categorization")
Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1041
Link: linuxwacom/input-wacom#440
Signed-off-by: Jason Gerecke <[email protected]>
Cc: [email protected]
Acked-by: Benjamin Tissoires <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Whissi pushed a commit to Whissi/linux-stable that referenced this issue Oct 17, 2024
commit 2934b12 upstream.

Unlike EMR tools which encode type information in their tool ID, tools
for AES sensors are all "generic pens". It is inappropriate to make use
of the wacom_intuos_get_tool_type function when dealing with these kinds
of devices. Instead, we should only ever report BTN_TOOL_PEN or
BTN_TOOL_RUBBER, as depending on the state of the Eraser and Invert
bits.

Reported-by: Daniel Jutz <[email protected]>
Closes: https://lore.kernel.org/linux-input/[email protected]/
Bisected-by: Christian Heusel <[email protected]>
Fixes: 9c2913b ("HID: wacom: more appropriate tool type categorization")
Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1041
Link: linuxwacom/input-wacom#440
Signed-off-by: Jason Gerecke <[email protected]>
Cc: [email protected]
Acked-by: Benjamin Tissoires <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
johnny-mnemonic pushed a commit to linux-ia64/linux-stable-rc that referenced this issue Oct 21, 2024
commit 2934b12 upstream.

Unlike EMR tools which encode type information in their tool ID, tools
for AES sensors are all "generic pens". It is inappropriate to make use
of the wacom_intuos_get_tool_type function when dealing with these kinds
of devices. Instead, we should only ever report BTN_TOOL_PEN or
BTN_TOOL_RUBBER, as depending on the state of the Eraser and Invert
bits.

Reported-by: Daniel Jutz <[email protected]>
Closes: https://lore.kernel.org/linux-input/[email protected]/
Bisected-by: Christian Heusel <[email protected]>
Fixes: 9c2913b ("HID: wacom: more appropriate tool type categorization")
Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1041
Link: linuxwacom/input-wacom#440
Signed-off-by: Jason Gerecke <[email protected]>
Cc: [email protected]
Acked-by: Benjamin Tissoires <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
kongwoojin pushed a commit to kongwoojin/linux-kernel that referenced this issue Oct 23, 2024
commit 2934b12 upstream.

Unlike EMR tools which encode type information in their tool ID, tools
for AES sensors are all "generic pens". It is inappropriate to make use
of the wacom_intuos_get_tool_type function when dealing with these kinds
of devices. Instead, we should only ever report BTN_TOOL_PEN or
BTN_TOOL_RUBBER, as depending on the state of the Eraser and Invert
bits.

Reported-by: Daniel Jutz <[email protected]>
Closes: https://lore.kernel.org/linux-input/[email protected]/
Bisected-by: Christian Heusel <[email protected]>
Fixes: 9c2913b ("HID: wacom: more appropriate tool type categorization")
Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1041
Link: linuxwacom/input-wacom#440
Signed-off-by: Jason Gerecke <[email protected]>
Cc: [email protected]
Acked-by: Benjamin Tissoires <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
LorenzoBianconi pushed a commit to LorenzoBianconi/linux-pinctrl that referenced this issue Nov 3, 2024
Unlike EMR tools which encode type information in their tool ID, tools
for AES sensors are all "generic pens". It is inappropriate to make use
of the wacom_intuos_get_tool_type function when dealing with these kinds
of devices. Instead, we should only ever report BTN_TOOL_PEN or
BTN_TOOL_RUBBER, as depending on the state of the Eraser and Invert
bits.

Reported-by: Daniel Jutz <[email protected]>
Closes: https://lore.kernel.org/linux-input/[email protected]/
Bisected-by: Christian Heusel <[email protected]>
Fixes: 9c2913b ("HID: wacom: more appropriate tool type categorization")
Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1041
Link: linuxwacom/input-wacom#440
Signed-off-by: Jason Gerecke <[email protected]>
Cc: [email protected]
Acked-by: Benjamin Tissoires <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants