--- /dev/null
+From 34851431ceca1bf457d85895bd38a4e7967e2055 Mon Sep 17 00:00:00 2001
+From: Kenny Levinsen <kl@kl.wtf>
+Date: Wed, 20 Nov 2024 00:53:17 +0100
+Subject: HID: i2c-hid: Revert to using power commands to wake on resume
+
+From: Kenny Levinsen <kl@kl.wtf>
+
+commit 34851431ceca1bf457d85895bd38a4e7967e2055 upstream.
+
+commit 7d6f065de37c ("HID: i2c-hid: Use address probe to wake on resume")
+replaced the retry of power commands with the dummy read "bus probe" we
+use on boot which accounts for a necessary delay before retry.
+
+This made at least one Weida device (2575:0910 in an ASUS Vivobook S14)
+very unhappy, as the bus probe despite being successful somehow lead to
+the following power command failing so hard that the device never lets
+go of the bus. This means that even retries of the power command would
+fail on a timeout as the bus remains busy.
+
+Remove the bus probe on resume and instead reintroduce retry of the
+power command for wake-up purposes while respecting the newly
+established wake-up retry timings.
+
+Fixes: 7d6f065de37c ("HID: i2c-hid: Use address probe to wake on resume")
+Cc: stable@vger.kernel.org
+Reported-by: Michael <auslands-kv@gmx.de>
+Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219440
+Link: https://lore.kernel.org/r/d5acb485-7377-4139-826d-4df04d21b5ed@leemhuis.info/
+Signed-off-by: Kenny Levinsen <kl@kl.wtf>
+Link: https://patch.msgid.link/20241119235615.23902-1-kl@kl.wtf
+Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hid/i2c-hid/i2c-hid-core.c | 20 ++++++++++++--------
+ 1 file changed, 12 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
+index 43664a24176f..4e87380d3edd 100644
+--- a/drivers/hid/i2c-hid/i2c-hid-core.c
++++ b/drivers/hid/i2c-hid/i2c-hid-core.c
+@@ -414,7 +414,19 @@ static int i2c_hid_set_power(struct i2c_hid *ihid, int power_state)
+
+ i2c_hid_dbg(ihid, "%s\n", __func__);
+
++ /*
++ * Some STM-based devices need 400µs after a rising clock edge to wake
++ * from deep sleep, in which case the first request will fail due to
++ * the address not being acknowledged. Try after a short sleep to see
++ * if the device came alive on the bus. Certain Weida Tech devices also
++ * need this.
++ */
+ ret = i2c_hid_set_power_command(ihid, power_state);
++ if (ret && power_state == I2C_HID_PWR_ON) {
++ usleep_range(400, 500);
++ ret = i2c_hid_set_power_command(ihid, I2C_HID_PWR_ON);
++ }
++
+ if (ret)
+ dev_err(&ihid->client->dev,
+ "failed to change power setting.\n");
+@@ -976,14 +988,6 @@ static int i2c_hid_core_resume(struct i2c_hid *ihid)
+
+ enable_irq(client->irq);
+
+- /* Make sure the device is awake on the bus */
+- ret = i2c_hid_probe_address(ihid);
+- if (ret < 0) {
+- dev_err(&client->dev, "nothing at address after resume: %d\n",
+- ret);
+- return -ENXIO;
+- }
+-
+ /* On Goodix 27c6:0d42 wait extra time before device wakeup.
+ * It's not clear why but if we send wakeup too early, the device will
+ * never trigger input interrupts.
+--
+2.47.1
+
--- /dev/null
+From 59548215b76be98cf3422eea9a67d6ea578aca3d Mon Sep 17 00:00:00 2001
+From: WangYuli <wangyuli@uniontech.com>
+Date: Mon, 25 Nov 2024 13:26:16 +0800
+Subject: HID: wacom: fix when get product name maybe null pointer
+
+From: WangYuli <wangyuli@uniontech.com>
+
+commit 59548215b76be98cf3422eea9a67d6ea578aca3d upstream.
+
+Due to incorrect dev->product reporting by certain devices, null
+pointer dereferences occur when dev->product is empty, leading to
+potential system crashes.
+
+This issue was found on EXCELSIOR DL37-D05 device with
+Loongson-LS3A6000-7A2000-DL37 motherboard.
+
+Kernel logs:
+[ 56.470885] usb 4-3: new full-speed USB device number 4 using ohci-pci
+[ 56.671638] usb 4-3: string descriptor 0 read error: -22
+[ 56.671644] usb 4-3: New USB device found, idVendor=056a, idProduct=0374, bcdDevice= 1.07
+[ 56.671647] usb 4-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
+[ 56.678839] hid-generic 0003:056A:0374.0004: hiddev0,hidraw3: USB HID v1.10 Device [HID 056a:0374] on usb-0000:00:05.0-3/input0
+[ 56.697719] CPU 2 Unable to handle kernel paging request at virtual address 0000000000000000, era == 90000000066e35c8, ra == ffff800004f98a80
+[ 56.697732] Oops[#1]:
+[ 56.697734] CPU: 2 PID: 2742 Comm: (udev-worker) Tainted: G OE 6.6.0-loong64-desktop #25.00.2000.015
+[ 56.697737] Hardware name: Inspur CE520L2/C09901N000000000, BIOS 2.09.00 10/11/2024
+[ 56.697739] pc 90000000066e35c8 ra ffff800004f98a80 tp 9000000125478000 sp 900000012547b8a0
+[ 56.697741] a0 0000000000000000 a1 ffff800004818b28 a2 0000000000000000 a3 0000000000000000
+[ 56.697743] a4 900000012547b8f0 a5 0000000000000000 a6 0000000000000000 a7 0000000000000000
+[ 56.697745] t0 ffff800004818b2d t1 0000000000000000 t2 0000000000000003 t3 0000000000000005
+[ 56.697747] t4 0000000000000000 t5 0000000000000000 t6 0000000000000000 t7 0000000000000000
+[ 56.697748] t8 0000000000000000 u0 0000000000000000 s9 0000000000000000 s0 900000011aa48028
+[ 56.697750] s1 0000000000000000 s2 0000000000000000 s3 ffff800004818e80 s4 ffff800004810000
+[ 56.697751] s5 90000001000b98d0 s6 ffff800004811f88 s7 ffff800005470440 s8 0000000000000000
+[ 56.697753] ra: ffff800004f98a80 wacom_update_name+0xe0/0x300 [wacom]
+[ 56.697802] ERA: 90000000066e35c8 strstr+0x28/0x120
+[ 56.697806] CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE)
+[ 56.697816] PRMD: 0000000c (PPLV0 +PIE +PWE)
+[ 56.697821] EUEN: 00000000 (-FPE -SXE -ASXE -BTE)
+[ 56.697827] ECFG: 00071c1d (LIE=0,2-4,10-12 VS=7)
+[ 56.697831] ESTAT: 00010000 [PIL] (IS= ECode=1 EsubCode=0)
+[ 56.697835] BADV: 0000000000000000
+[ 56.697836] PRID: 0014d000 (Loongson-64bit, Loongson-3A6000)
+[ 56.697838] Modules linked in: wacom(+) bnep bluetooth rfkill qrtr nls_iso8859_1 nls_cp437 snd_hda_codec_conexant snd_hda_codec_generic ledtrig_audio snd_hda_codec_hdmi snd_hda_intel snd_intel_dspcfg snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_timer snd soundcore input_leds mousedev led_class joydev deepin_netmonitor(OE) fuse nfnetlink dmi_sysfs ip_tables x_tables overlay amdgpu amdxcp drm_exec gpu_sched drm_buddy radeon drm_suballoc_helper i2c_algo_bit drm_ttm_helper r8169 ttm drm_display_helper spi_loongson_pci xhci_pci cec xhci_pci_renesas spi_loongson_core hid_generic realtek gpio_loongson_64bit
+[ 56.697887] Process (udev-worker) (pid: 2742, threadinfo=00000000aee0d8b4, task=00000000a9eff1f3)
+[ 56.697890] Stack : 0000000000000000 ffff800004817e00 0000000000000000 0000251c00000000
+[ 56.697896] 0000000000000000 00000011fffffffd 0000000000000000 0000000000000000
+[ 56.697901] 0000000000000000 1b67a968695184b9 0000000000000000 90000001000b98d0
+[ 56.697906] 90000001000bb8d0 900000011aa48028 0000000000000000 ffff800004f9d74c
+[ 56.697911] 90000001000ba000 ffff800004f9ce58 0000000000000000 ffff800005470440
+[ 56.697916] ffff800004811f88 90000001000b98d0 9000000100da2aa8 90000001000bb8d0
+[ 56.697921] 0000000000000000 90000001000ba000 900000011aa48028 ffff800004f9d74c
+[ 56.697926] ffff8000054704e8 90000001000bb8b8 90000001000ba000 0000000000000000
+[ 56.697931] 90000001000bb8d0 9000000006307564 9000000005e666e0 90000001752359b8
+[ 56.697936] 9000000008cbe400 900000000804d000 9000000005e666e0 0000000000000000
+[ 56.697941] ...
+[ 56.697944] Call Trace:
+[ 56.697945] [<90000000066e35c8>] strstr+0x28/0x120
+[ 56.697950] [<ffff800004f98a80>] wacom_update_name+0xe0/0x300 [wacom]
+[ 56.698000] [<ffff800004f9ce58>] wacom_parse_and_register+0x338/0x900 [wacom]
+[ 56.698050] [<ffff800004f9d74c>] wacom_probe+0x32c/0x420 [wacom]
+[ 56.698099] [<9000000006307564>] hid_device_probe+0x144/0x260
+[ 56.698103] [<9000000005e65d68>] really_probe+0x208/0x540
+[ 56.698109] [<9000000005e661dc>] __driver_probe_device+0x13c/0x1e0
+[ 56.698112] [<9000000005e66620>] driver_probe_device+0x40/0x100
+[ 56.698116] [<9000000005e6680c>] __device_attach_driver+0x12c/0x180
+[ 56.698119] [<9000000005e62bc8>] bus_for_each_drv+0x88/0x160
+[ 56.698123] [<9000000005e66468>] __device_attach+0x108/0x260
+[ 56.698126] [<9000000005e63918>] device_reprobe+0x78/0x100
+[ 56.698129] [<9000000005e62a68>] bus_for_each_dev+0x88/0x160
+[ 56.698132] [<9000000006304e54>] __hid_bus_driver_added+0x34/0x80
+[ 56.698134] [<9000000005e62bc8>] bus_for_each_drv+0x88/0x160
+[ 56.698137] [<9000000006304df0>] __hid_register_driver+0x70/0xa0
+[ 56.698142] [<9000000004e10fe4>] do_one_initcall+0x104/0x320
+[ 56.698146] [<9000000004f38150>] do_init_module+0x90/0x2c0
+[ 56.698151] [<9000000004f3a3d8>] init_module_from_file+0xb8/0x120
+[ 56.698155] [<9000000004f3a590>] idempotent_init_module+0x150/0x3a0
+[ 56.698159] [<9000000004f3a890>] sys_finit_module+0xb0/0x140
+[ 56.698163] [<900000000671e4e8>] do_syscall+0x88/0xc0
+[ 56.698166] [<9000000004e12404>] handle_syscall+0xc4/0x160
+[ 56.698171] Code: 0011958f 00150224 5800cd85 <2a00022c> 00150004 4000c180 0015022c 03400000 03400000
+[ 56.698192] ---[ end trace 0000000000000000 ]---
+
+Fixes: 09dc28acaec7 ("HID: wacom: Improve generic name generation")
+Reported-by: Zhenxing Chen <chenzhenxing@uniontech.com>
+Co-developed-by: Xu Rao <raoxu@uniontech.com>
+Signed-off-by: Xu Rao <raoxu@uniontech.com>
+Signed-off-by: WangYuli <wangyuli@uniontech.com>
+Link: https://patch.msgid.link/B31757FE8E1544CF+20241125052616.18261-1-wangyuli@uniontech.com
+Cc: stable@vger.kernel.org
+Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hid/wacom_sys.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/hid/wacom_sys.c
++++ b/drivers/hid/wacom_sys.c
+@@ -2241,7 +2241,8 @@ static void wacom_update_name(struct wac
+ if (hid_is_usb(wacom->hdev)) {
+ struct usb_interface *intf = to_usb_interface(wacom->hdev->dev.parent);
+ struct usb_device *dev = interface_to_usbdev(intf);
+- product_name = dev->product;
++ if (dev->product != NULL)
++ product_name = dev->product;
+ }
+
+ if (wacom->hdev->bus == BUS_I2C) {
--- /dev/null
+From 60fc1e6750133620e404d40b93df5afe32e3e6c6 Mon Sep 17 00:00:00 2001
+From: Miguel Ojeda <ojeda@kernel.org>
+Date: Sat, 16 Nov 2024 19:15:37 +0100
+Subject: rust: allow `clippy::needless_lifetimes`
+
+From: Miguel Ojeda <ojeda@kernel.org>
+
+commit 60fc1e6750133620e404d40b93df5afe32e3e6c6 upstream.
+
+In beta Clippy (i.e. Rust 1.83.0), the `needless_lifetimes` lint has
+been extended [1] to suggest eliding `impl` lifetimes, e.g.
+
+ error: the following explicit lifetimes could be elided: 'a
+ --> rust/kernel/list.rs:647:6
+ |
+ 647 | impl<'a, T: ?Sized + ListItem<ID>, const ID: u64> FusedIterator for Iter<'a, T, ID> {}
+ | ^^ ^^
+ |
+ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
+ = note: `-D clippy::needless-lifetimes` implied by `-D warnings`
+ = help: to override `-D warnings` add `#[allow(clippy::needless_lifetimes)]`
+ help: elide the lifetimes
+ |
+ 647 - impl<'a, T: ?Sized + ListItem<ID>, const ID: u64> FusedIterator for Iter<'a, T, ID> {}
+ 647 + impl<T: ?Sized + ListItem<ID>, const ID: u64> FusedIterator for Iter<'_, T, ID> {}
+
+A possibility would have been to clean them -- the RFC patch [2] did
+this, while asking if we wanted these cleanups. There is an open issue
+[3] in Clippy about being able to differentiate some of the new cases,
+e.g. those that do not involve introducing `'_`. Thus it seems others
+feel similarly.
+
+Thus, for the time being, we decided to `allow` the lint.
+
+Link: https://github.com/rust-lang/rust-clippy/pull/13286 [1]
+Link: https://lore.kernel.org/rust-for-linux/20241012231300.397010-1-ojeda@kernel.org/ [2]
+Link: https://github.com/rust-lang/rust-clippy/issues/13514 [3]
+Reviewed-by: Alice Ryhl <aliceryhl@google.com>
+Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
+Link: https://lore.kernel.org/r/20241116181538.369355-1-ojeda@kernel.org
+Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/Makefile
++++ b/Makefile
+@@ -456,6 +456,7 @@ export rust_common_flags := --edition=20
+ -Wclippy::mut_mut \
+ -Wclippy::needless_bitwise_bool \
+ -Wclippy::needless_continue \
++ -Aclippy::needless_lifetimes \
+ -Wclippy::no_mangle_with_rust_abi \
+ -Wclippy::dbg_macro
+
bpf-handle-in-place-update-for-full-lpm-trie-correct.patch
bpf-fix-exact-match-conditions-in-trie_get_next_key.patch
x86-cpu-amd-warn-when-setting-efer.autoibrs-if-and-o.patch
+rust-allow-clippy-needless_lifetimes.patch
+hid-i2c-hid-revert-to-using-power-commands-to-wake-on-resume.patch
+hid-wacom-fix-when-get-product-name-maybe-null-pointer.patch