From: Greg Kroah-Hartman Date: Mon, 26 Aug 2024 11:47:09 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v6.1.107~49 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fec0c52628e974e8bf42cb158304b63a81ac6162;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: hid-microsoft-add-rumble-support-to-latest-xbox-controllers.patch hid-wacom-defer-calculation-of-resolution-until-resolution_code-is-known.patch mips-loongson64-set-timer-mode-in-cpu-probe.patch --- diff --git a/queue-5.10/hid-microsoft-add-rumble-support-to-latest-xbox-controllers.patch b/queue-5.10/hid-microsoft-add-rumble-support-to-latest-xbox-controllers.patch new file mode 100644 index 00000000000..6b68544edf7 --- /dev/null +++ b/queue-5.10/hid-microsoft-add-rumble-support-to-latest-xbox-controllers.patch @@ -0,0 +1,97 @@ +From f5554725f30475b05b5178b998366f11ecb50c7f Mon Sep 17 00:00:00 2001 +From: Siarhei Vishniakou +Date: Tue, 25 Apr 2023 09:38:44 -0700 +Subject: HID: microsoft: Add rumble support to latest xbox controllers + +From: Siarhei Vishniakou + +commit f5554725f30475b05b5178b998366f11ecb50c7f upstream. + +Currently, rumble is only supported via bluetooth on a single xbox +controller, called 'model 1708'. On the back of the device, it's named +'wireless controller for xbox one'. However, in 2021, Microsoft released +a firmware update for this controller. As part of this update, the HID +descriptor of the device changed. The product ID was also changed from +0x02fd to 0x0b20. On this controller, rumble was supported via +hid-microsoft, which matched against the old product id (0x02fd). As a +result, the firmware update broke rumble support on this controller. + +See: +https://news.xbox.com/en-us/2021/09/08/xbox-controller-firmware-update-rolling-out-to-insiders-starting-today/ + +The hid-microsoft driver actually supports rumble on the new firmware, +as well. So simply adding new product id is sufficient to bring back +this support. + +After discussing further with the xbox team, it was pointed out that +another xbox controller, xbox elite series 2, can be supported in a +similar way. + +Add rumble support for all of these devices in this patch. Two of the +devices have received firmware updates that caused their product id's to +change. Both old and new firmware versions of these devices were tested. + +The tested controllers are: + +1. 'wireless controller for xbox one', model 1708 +2. 'xbox wireless controller', model 1914. This is also sometimes + referred to as 'xbox series S|X'. +3. 'elite series 2', model 1797. + +The tested configurations are: +1. model 1708, pid 0x02fd (old firmware) +2. model 1708, pid 0x0b20 (new firmware) +3. model 1914, pid 0x0b13 +4. model 1797, pid 0x0b05 (old firmware) +5. model 1797, pid 0x0b22 (new firmware) + +I verified rumble support on both bluetooth and usb. + +Reviewed-by: Bastien Nocera +Signed-off-by: Siarhei Vishniakou +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hid/hid-ids.h | 10 +++++++++- + drivers/hid/hid-microsoft.c | 11 ++++++++++- + 2 files changed, 19 insertions(+), 2 deletions(-) + +--- a/drivers/hid/hid-ids.h ++++ b/drivers/hid/hid-ids.h +@@ -875,7 +875,15 @@ + #define USB_DEVICE_ID_MS_TYPE_COVER_2 0x07a9 + #define USB_DEVICE_ID_MS_POWER_COVER 0x07da + #define USB_DEVICE_ID_MS_SURFACE3_COVER 0x07de +-#define USB_DEVICE_ID_MS_XBOX_ONE_S_CONTROLLER 0x02fd ++/* ++ * For a description of the Xbox controller models, refer to: ++ * https://en.wikipedia.org/wiki/Xbox_Wireless_Controller#Summary ++ */ ++#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708 0x02fd ++#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708_BLE 0x0b20 ++#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1914 0x0b13 ++#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797 0x0b05 ++#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797_BLE 0x0b22 + #define USB_DEVICE_ID_MS_PIXART_MOUSE 0x00cb + #define USB_DEVICE_ID_8BITDO_SN30_PRO_PLUS 0x02e0 + #define USB_DEVICE_ID_MS_MOUSE_0783 0x0783 +--- a/drivers/hid/hid-microsoft.c ++++ b/drivers/hid/hid-microsoft.c +@@ -446,7 +446,16 @@ static const struct hid_device_id ms_dev + .driver_data = MS_PRESENTER }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, 0x091B), + .driver_data = MS_SURFACE_DIAL }, +- { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_ONE_S_CONTROLLER), ++ ++ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708), ++ .driver_data = MS_QUIRK_FF }, ++ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708_BLE), ++ .driver_data = MS_QUIRK_FF }, ++ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1914), ++ .driver_data = MS_QUIRK_FF }, ++ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797), ++ .driver_data = MS_QUIRK_FF }, ++ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797_BLE), + .driver_data = MS_QUIRK_FF }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_8BITDO_SN30_PRO_PLUS), + .driver_data = MS_QUIRK_FF }, diff --git a/queue-5.10/hid-wacom-defer-calculation-of-resolution-until-resolution_code-is-known.patch b/queue-5.10/hid-wacom-defer-calculation-of-resolution-until-resolution_code-is-known.patch new file mode 100644 index 00000000000..cae5208bda9 --- /dev/null +++ b/queue-5.10/hid-wacom-defer-calculation-of-resolution-until-resolution_code-is-known.patch @@ -0,0 +1,49 @@ +From 1b8f9c1fb464968a5b18d3acc1da8c00bad24fad Mon Sep 17 00:00:00 2001 +From: Jason Gerecke +Date: Tue, 30 Jul 2024 08:51:55 -0700 +Subject: HID: wacom: Defer calculation of resolution until resolution_code is known + +From: Jason Gerecke + +commit 1b8f9c1fb464968a5b18d3acc1da8c00bad24fad upstream. + +The Wacom driver maps the HID_DG_TWIST usage to ABS_Z (rather than ABS_RZ) +for historic reasons. When the code to support twist was introduced in +commit 50066a042da5 ("HID: wacom: generic: Add support for height, tilt, +and twist usages"), we were careful to write it in such a way that it had +HID calculate the resolution of the twist axis assuming ABS_RZ instead +(so that we would get correct angular behavior). This was broken with +the introduction of commit 08a46b4190d3 ("HID: wacom: Set a default +resolution for older tablets"), which moved the resolution calculation +to occur *before* the adjustment from ABS_Z to ABS_RZ occurred. + +This commit moves the calculation of resolution after the point that +we are finished setting things up for its proper use. + +Signed-off-by: Jason Gerecke +Fixes: 08a46b4190d3 ("HID: wacom: Set a default resolution for older tablets") +Cc: stable@vger.kernel.org +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hid/wacom_wac.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/hid/wacom_wac.c ++++ b/drivers/hid/wacom_wac.c +@@ -1920,12 +1920,14 @@ static void wacom_map_usage(struct input + int fmax = field->logical_maximum; + unsigned int equivalent_usage = wacom_equivalent_usage(usage->hid); + int resolution_code = code; +- int resolution = hidinput_calc_abs_res(field, resolution_code); ++ int resolution; + + if (equivalent_usage == HID_DG_TWIST) { + resolution_code = ABS_RZ; + } + ++ resolution = hidinput_calc_abs_res(field, resolution_code); ++ + if (equivalent_usage == HID_GD_X) { + fmin += features->offset_left; + fmax -= features->offset_right; diff --git a/queue-5.10/mips-loongson64-set-timer-mode-in-cpu-probe.patch b/queue-5.10/mips-loongson64-set-timer-mode-in-cpu-probe.patch new file mode 100644 index 00000000000..d0cb0a29d5e --- /dev/null +++ b/queue-5.10/mips-loongson64-set-timer-mode-in-cpu-probe.patch @@ -0,0 +1,47 @@ +From 1cb6ab446424649f03c82334634360c2e3043684 Mon Sep 17 00:00:00 2001 +From: Jiaxun Yang +Date: Tue, 23 Jul 2024 17:15:44 +0800 +Subject: MIPS: Loongson64: Set timer mode in cpu-probe + +From: Jiaxun Yang + +commit 1cb6ab446424649f03c82334634360c2e3043684 upstream. + +Loongson64 C and G processors have EXTIMER feature which +is conflicting with CP0 counter. + +Although the processor resets in EXTIMER disabled & INTIMER +enabled mode, which is compatible with MIPS CP0 compare, firmware +may attempt to enable EXTIMER and interfere CP0 compare. + +Set timer mode back to MIPS compatible mode to fix booting on +systems with such firmware before we have an actual driver for +EXTIMER. + +Cc: stable@vger.kernel.org +Signed-off-by: Jiaxun Yang +Signed-off-by: Thomas Bogendoerfer +Signed-off-by: Greg Kroah-Hartman +--- + arch/mips/kernel/cpu-probe.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/arch/mips/kernel/cpu-probe.c ++++ b/arch/mips/kernel/cpu-probe.c +@@ -1769,12 +1769,16 @@ static inline void cpu_probe_loongson(st + c->ases |= (MIPS_ASE_LOONGSON_MMI | MIPS_ASE_LOONGSON_CAM | + MIPS_ASE_LOONGSON_EXT | MIPS_ASE_LOONGSON_EXT2); + c->ases &= ~MIPS_ASE_VZ; /* VZ of Loongson-3A2000/3000 is incomplete */ ++ change_c0_config6(LOONGSON_CONF6_EXTIMER | LOONGSON_CONF6_INTIMER, ++ LOONGSON_CONF6_INTIMER); + break; + case PRID_IMP_LOONGSON_64G: + __cpu_name[cpu] = "ICT Loongson-3"; + set_elf_platform(cpu, "loongson3a"); + set_isa(c, MIPS_CPU_ISA_M64R2); + decode_cpucfg(c); ++ change_c0_config6(LOONGSON_CONF6_EXTIMER | LOONGSON_CONF6_INTIMER, ++ LOONGSON_CONF6_INTIMER); + break; + default: + panic("Unknown Loongson Processor ID!"); diff --git a/queue-5.10/series b/queue-5.10/series index 789d9ec83d4..8ef81813e80 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -108,3 +108,6 @@ drm-msm-dp-reset-the-link-phy-params-before-link-tra.patch mmc-mmc_test-fix-null-dereference-on-allocation-fail.patch bluetooth-mgmt-add-error-handling-to-pair_device.patch binfmt_misc-pass-binfmt_misc-flags-to-the-interpreter.patch +mips-loongson64-set-timer-mode-in-cpu-probe.patch +hid-wacom-defer-calculation-of-resolution-until-resolution_code-is-known.patch +hid-microsoft-add-rumble-support-to-latest-xbox-controllers.patch