Bug 211261 - wacom pen hangs system
Summary: wacom pen hangs system
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Input Devices (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_input-devices
URL:
Keywords:
: 211275 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-01-18 13:57 UTC by Lon Willett
Modified: 2021-02-01 16:26 UTC (History)
4 users (show)

See Also:
Kernel Version: 5.10.8
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Patch wacom driver by making wacom_wac->pen_fifo a pointer (1.04 KB, patch)
2021-01-21 00:17 UTC, Valentin
Details | Diff

Description Lon Willett 2021-01-18 13:57:41 UTC
The latest wacom driver (kernel 5.10.8) causes my system (Lenovo Yoga 370) to freeze as soon as the pen is used (with Xorg). By freeze I mean it becomes totally unresponsive (no network, no response to input, nothing in the log files).

Reverting commit 797c128d3c7d95ecc6a2113aae5de109736fba10 ("HID: wacom: Fix memory leakage caused by kfifo_alloc") seems to fix the problem.
Comment 1 Valentin 2021-01-21 00:17:15 UTC
Created attachment 294789 [details]
Patch wacom driver by making wacom_wac->pen_fifo a pointer

This patch fixes the bug on my device. But it might be complete nonsense because I'm not familiar with this kind of problems.


In commit 37309f47e2f5674f3e86cb765312ace42cfcedf5 it was intended to allocate the memory associated with `wacom_wac->pen_fifo` using `devres_alloc()`. This should make sure that memory is freed once it is not needed anymore. However, to my limited understanding this is only possible if `wacom_wac->pen_fifo` is a pointer, which can be allocated by `devres_alloc`.


With this patch `pen_fifo` becomes a pointer, which can be dynamically allocated using `devres_alloc`. I don't know if this is reasonable in any way or has any advantage compared to the code before commit 37309f47e2f5674f3e86cb765312ace42cfcedf5.
Comment 2 Lon Willett 2021-01-21 02:05:49 UTC
I tried the patch from Valentin, and it seems to work for me. Of course, I only tested very briefly. I'll report back should something show up in the coming days.
Comment 3 Benjamin Hennion 2021-01-26 18:07:09 UTC
@Valentin's patch also fixes it for me (thanks Valentin). My symptoms were different (no freeze, simply the pen and touchscreen no longer worked).

See also https://bugzilla.kernel.org/show_bug.cgi?id=211275 (probably a duplicate of this one).

(Also, this should be flagged as a regression).
Comment 4 ff142 2021-01-26 20:49:48 UTC
*** Bug 211275 has been marked as a duplicate of this bug. ***
Comment 5 Lon Willett 2021-02-01 16:26:42 UTC
Patch seems to have been accepted (5.10.12 has it).

Note You need to log in before you can comment on or make changes to this bug.