]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Jun 2023 18:20:12 +0000 (20:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Jun 2023 18:20:12 +0000 (20:20 +0200)
added patches:
hid-logitech-hidpp-add-hidpp_quirk_delayed_init-for-the-t651.patch
hid-wacom-use-ktime_t-rather-than-int-when-dealing-with-timestamps.patch

queue-5.15/hid-logitech-hidpp-add-hidpp_quirk_delayed_init-for-the-t651.patch [new file with mode: 0644]
queue-5.15/hid-wacom-use-ktime_t-rather-than-int-when-dealing-with-timestamps.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/hid-logitech-hidpp-add-hidpp_quirk_delayed_init-for-the-t651.patch b/queue-5.15/hid-logitech-hidpp-add-hidpp_quirk_delayed_init-for-the-t651.patch
new file mode 100644 (file)
index 0000000..026e012
--- /dev/null
@@ -0,0 +1,34 @@
+From 5fe251112646d8626818ea90f7af325bab243efa Mon Sep 17 00:00:00 2001
+From: Mike Hommey <mh@glandium.org>
+Date: Sun, 18 Jun 2023 08:09:57 +0900
+Subject: HID: logitech-hidpp: add HIDPP_QUIRK_DELAYED_INIT for the T651.
+
+From: Mike Hommey <mh@glandium.org>
+
+commit 5fe251112646d8626818ea90f7af325bab243efa upstream.
+
+commit 498ba2069035 ("HID: logitech-hidpp: Don't restart communication if
+not necessary") put restarting communication behind that flag, and this
+was apparently necessary on the T651, but the flag was not set for it.
+
+Fixes: 498ba2069035 ("HID: logitech-hidpp: Don't restart communication if not necessary")
+Cc: stable@vger.kernel.org
+Signed-off-by: Mike Hommey <mh@glandium.org>
+Link: https://lore.kernel.org/r/20230617230957.6mx73th4blv7owqk@glandium.org
+Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hid/hid-logitech-hidpp.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/hid/hid-logitech-hidpp.c
++++ b/drivers/hid/hid-logitech-hidpp.c
+@@ -4295,7 +4295,7 @@ static const struct hid_device_id hidpp_
+       { /* wireless touchpad T651 */
+         HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH,
+               USB_DEVICE_ID_LOGITECH_T651),
+-        .driver_data = HIDPP_QUIRK_CLASS_WTP },
++        .driver_data = HIDPP_QUIRK_CLASS_WTP | HIDPP_QUIRK_DELAYED_INIT },
+       { /* Mouse Logitech Anywhere MX */
+         LDJ_DEVICE(0x1017), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_1P0 },
+       { /* Mouse Logitech Cube */
diff --git a/queue-5.15/hid-wacom-use-ktime_t-rather-than-int-when-dealing-with-timestamps.patch b/queue-5.15/hid-wacom-use-ktime_t-rather-than-int-when-dealing-with-timestamps.patch
new file mode 100644 (file)
index 0000000..b01bc72
--- /dev/null
@@ -0,0 +1,70 @@
+From 9a6c0e28e215535b2938c61ded54603b4e5814c5 Mon Sep 17 00:00:00 2001
+From: Jason Gerecke <jason.gerecke@wacom.com>
+Date: Thu, 8 Jun 2023 14:38:28 -0700
+Subject: HID: wacom: Use ktime_t rather than int when dealing with timestamps
+
+From: Jason Gerecke <jason.gerecke@wacom.com>
+
+commit 9a6c0e28e215535b2938c61ded54603b4e5814c5 upstream.
+
+Code which interacts with timestamps needs to use the ktime_t type
+returned by functions like ktime_get. The int type does not offer
+enough space to store these values, and attempting to use it is a
+recipe for problems. In this particular case, overflows would occur
+when calculating/storing timestamps leading to incorrect values being
+reported to userspace. In some cases these bad timestamps cause input
+handling in userspace to appear hung.
+
+Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/901
+Fixes: 17d793f3ed53 ("HID: wacom: insert timestamp to packed Bluetooth (BT) events")
+CC: stable@vger.kernel.org
+Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
+Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Link: https://lore.kernel.org/r/20230608213828.2108-1-jason.gerecke@wacom.com
+Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hid/wacom_wac.c |    6 +++---
+ drivers/hid/wacom_wac.h |    2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/hid/wacom_wac.c
++++ b/drivers/hid/wacom_wac.c
+@@ -1314,7 +1314,7 @@ static void wacom_intuos_pro2_bt_pen(str
+       struct input_dev *pen_input = wacom->pen_input;
+       unsigned char *data = wacom->data;
+       int number_of_valid_frames = 0;
+-      int time_interval = 15000000;
++      ktime_t time_interval = 15000000;
+       ktime_t time_packet_received = ktime_get();
+       int i;
+@@ -1348,7 +1348,7 @@ static void wacom_intuos_pro2_bt_pen(str
+       if (number_of_valid_frames) {
+               if (wacom->hid_data.time_delayed)
+                       time_interval = ktime_get() - wacom->hid_data.time_delayed;
+-              time_interval /= number_of_valid_frames;
++              time_interval = div_u64(time_interval, number_of_valid_frames);
+               wacom->hid_data.time_delayed = time_packet_received;
+       }
+@@ -1359,7 +1359,7 @@ static void wacom_intuos_pro2_bt_pen(str
+               bool range = frame[0] & 0x20;
+               bool invert = frame[0] & 0x10;
+               int frames_number_reversed = number_of_valid_frames - i - 1;
+-              int event_timestamp = time_packet_received - frames_number_reversed * time_interval;
++              ktime_t event_timestamp = time_packet_received - frames_number_reversed * time_interval;
+               if (!valid)
+                       continue;
+--- a/drivers/hid/wacom_wac.h
++++ b/drivers/hid/wacom_wac.h
+@@ -321,7 +321,7 @@ struct hid_data {
+       int bat_connected;
+       int ps_connected;
+       bool pad_input_event_flag;
+-      int time_delayed;
++      ktime_t time_delayed;
+ };
+ struct wacom_remote_data {
index 15a4b3343644ca418226d2b591c1d32ac3ccba61..cf975ca63390ebfd2d5373a73c87c8599b5e78e4 100644 (file)
@@ -7,3 +7,5 @@ x86-microcode-amd-load-late-on-both-threads-too.patch
 x86-smp-use-dedicated-cache-line-for-mwait_play_dead.patch
 can-isotp-isotp_sendmsg-fix-return-error-fix-on-tx-path.patch
 bpf-ensure-main-program-has-an-extable.patch
+hid-wacom-use-ktime_t-rather-than-int-when-dealing-with-timestamps.patch
+hid-logitech-hidpp-add-hidpp_quirk_delayed_init-for-the-t651.patch