From: Sasha Levin Date: Sat, 16 Dec 2023 21:00:38 +0000 (-0500) Subject: Fixes for 5.4 X-Git-Tag: v5.15.144~45^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5683f2f3f70581dcac96759c7f3b3322e125c712;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.4 Signed-off-by: Sasha Levin --- diff --git a/queue-5.4/asm-generic-qspinlock-fix-queued_spin_value_unlocked.patch b/queue-5.4/asm-generic-qspinlock-fix-queued_spin_value_unlocked.patch new file mode 100644 index 00000000000..dd7e97bf730 --- /dev/null +++ b/queue-5.4/asm-generic-qspinlock-fix-queued_spin_value_unlocked.patch @@ -0,0 +1,51 @@ +From e005c5049343b6f2eb17efe1b93ca764ce19e31a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 9 Nov 2023 22:22:13 -0800 +Subject: asm-generic: qspinlock: fix queued_spin_value_unlocked() + implementation + +From: Linus Torvalds + +[ Upstream commit 125b0bb95dd6bec81b806b997a4ccb026eeecf8f ] + +We really don't want to do atomic_read() or anything like that, since we +already have the value, not the lock. The whole point of this is that +we've loaded the lock from memory, and we want to check whether the +value we loaded was a locked one or not. + +The main use of this is the lockref code, which loads both the lock and +the reference count in one atomic operation, and then works on that +combined value. With the atomic_read(), the compiler would pointlessly +spill the value to the stack, in order to then be able to read it back +"atomically". + +This is the qspinlock version of commit c6f4a9002252 ("asm-generic: +ticket-lock: Optimize arch_spin_value_unlocked()") which fixed this same +bug for ticket locks. + +Cc: Guo Ren +Cc: Ingo Molnar +Cc: Waiman Long +Link: https://lore.kernel.org/all/CAHk-=whNRv0v6kQiV5QO6DJhjH4KEL36vWQ6Re8Csrnh4zbRkQ@mail.gmail.com/ +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + include/asm-generic/qspinlock.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/asm-generic/qspinlock.h b/include/asm-generic/qspinlock.h +index fde943d180e03..6dc2269a5398a 100644 +--- a/include/asm-generic/qspinlock.h ++++ b/include/asm-generic/qspinlock.h +@@ -38,7 +38,7 @@ static __always_inline int queued_spin_is_locked(struct qspinlock *lock) + */ + static __always_inline int queued_spin_value_unlocked(struct qspinlock lock) + { +- return !atomic_read(&lock.val); ++ return !lock.val.counter; + } + + /** +-- +2.43.0 + diff --git a/queue-5.4/bcache-add-code-comments-for-bch_btree_node_get-and-.patch b/queue-5.4/bcache-add-code-comments-for-bch_btree_node_get-and-.patch new file mode 100644 index 00000000000..27c32287202 --- /dev/null +++ b/queue-5.4/bcache-add-code-comments-for-bch_btree_node_get-and-.patch @@ -0,0 +1,50 @@ +From 75813eb147b9a478ceaa7b7f97985e1ea4ad66f5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 20 Nov 2023 13:25:02 +0800 +Subject: bcache: add code comments for bch_btree_node_get() and + __bch_btree_node_alloc() + +From: Coly Li + +[ Upstream commit 31f5b956a197d4ec25c8a07cb3a2ab69d0c0b82f ] + +This patch adds code comments to bch_btree_node_get() and +__bch_btree_node_alloc() that NULL pointer will not be returned and it +is unnecessary to check NULL pointer by the callers of these routines. + +Signed-off-by: Coly Li +Link: https://lore.kernel.org/r/20231120052503.6122-10-colyli@suse.de +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + drivers/md/bcache/btree.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c +index ad1faee2e186b..5db893d6a824e 100644 +--- a/drivers/md/bcache/btree.c ++++ b/drivers/md/bcache/btree.c +@@ -1020,6 +1020,9 @@ static struct btree *mca_alloc(struct cache_set *c, struct btree_op *op, + * + * The btree node will have either a read or a write lock held, depending on + * level and op->lock. ++ * ++ * Note: Only error code or btree pointer will be returned, it is unncessary ++ * for callers to check NULL pointer. + */ + struct btree *bch_btree_node_get(struct cache_set *c, struct btree_op *op, + struct bkey *k, int level, bool write, +@@ -1132,6 +1135,10 @@ static void btree_node_free(struct btree *b) + mutex_unlock(&b->c->bucket_lock); + } + ++/* ++ * Only error code or btree pointer will be returned, it is unncessary for ++ * callers to check NULL pointer. ++ */ + struct btree *__bch_btree_node_alloc(struct cache_set *c, struct btree_op *op, + int level, bool wait, + struct btree *parent) +-- +2.43.0 + diff --git a/queue-5.4/bcache-avoid-null-checking-to-c-root-in-run_cache_se.patch b/queue-5.4/bcache-avoid-null-checking-to-c-root-in-run_cache_se.patch new file mode 100644 index 00000000000..113015a2662 --- /dev/null +++ b/queue-5.4/bcache-avoid-null-checking-to-c-root-in-run_cache_se.patch @@ -0,0 +1,39 @@ +From 7e4b9ee33cd12e8f154e9b3570e82258fc5658fb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 20 Nov 2023 13:25:03 +0800 +Subject: bcache: avoid NULL checking to c->root in run_cache_set() + +From: Coly Li + +[ Upstream commit 3eba5e0b2422aec3c9e79822029599961fdcab97 ] + +In run_cache_set() after c->root returned from bch_btree_node_get(), it +is checked by IS_ERR_OR_NULL(). Indeed it is unncessary to check NULL +because bch_btree_node_get() will not return NULL pointer to caller. + +This patch replaces IS_ERR_OR_NULL() by IS_ERR() for the above reason. + +Signed-off-by: Coly Li +Link: https://lore.kernel.org/r/20231120052503.6122-11-colyli@suse.de +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + drivers/md/bcache/super.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c +index d5f57a9551dda..5d1a4eb816694 100644 +--- a/drivers/md/bcache/super.c ++++ b/drivers/md/bcache/super.c +@@ -1908,7 +1908,7 @@ static int run_cache_set(struct cache_set *c) + c->root = bch_btree_node_get(c, NULL, k, + j->btree_level, + true, NULL); +- if (IS_ERR_OR_NULL(c->root)) ++ if (IS_ERR(c->root)) + goto err; + + list_del_init(&c->root->list); +-- +2.43.0 + diff --git a/queue-5.4/bcache-avoid-oversize-memory-allocation-by-small-str.patch b/queue-5.4/bcache-avoid-oversize-memory-allocation-by-small-str.patch new file mode 100644 index 00000000000..251ad1a6bd2 --- /dev/null +++ b/queue-5.4/bcache-avoid-oversize-memory-allocation-by-small-str.patch @@ -0,0 +1,90 @@ +From 1ef2746d78adb20377ced17349a48b7666c6fff3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 20 Nov 2023 13:24:54 +0800 +Subject: bcache: avoid oversize memory allocation by small stripe_size + +From: Coly Li + +[ Upstream commit baf8fb7e0e5ec54ea0839f0c534f2cdcd79bea9c ] + +Arraies bcache->stripe_sectors_dirty and bcache->full_dirty_stripes are +used for dirty data writeback, their sizes are decided by backing device +capacity and stripe size. Larger backing device capacity or smaller +stripe size make these two arraies occupies more dynamic memory space. + +Currently bcache->stripe_size is directly inherited from +queue->limits.io_opt of underlying storage device. For normal hard +drives, its limits.io_opt is 0, and bcache sets the corresponding +stripe_size to 1TB (1<<31 sectors), it works fine 10+ years. But for +devices do declare value for queue->limits.io_opt, small stripe_size +(comparing to 1TB) becomes an issue for oversize memory allocations of +bcache->stripe_sectors_dirty and bcache->full_dirty_stripes, while the +capacity of hard drives gets much larger in recent decade. + +For example a raid5 array assembled by three 20TB hardrives, the raid +device capacity is 40TB with typical 512KB limits.io_opt. After the math +calculation in bcache code, these two arraies will occupy 400MB dynamic +memory. Even worse Andrea Tomassetti reports that a 4KB limits.io_opt is +declared on a new 2TB hard drive, then these two arraies request 2GB and +512MB dynamic memory from kzalloc(). The result is that bcache device +always fails to initialize on his system. + +To avoid the oversize memory allocation, bcache->stripe_size should not +directly inherited by queue->limits.io_opt from the underlying device. +This patch defines BCH_MIN_STRIPE_SZ (4MB) as minimal bcache stripe size +and set bcache device's stripe size against the declared limits.io_opt +value from the underlying storage device, +- If the declared limits.io_opt > BCH_MIN_STRIPE_SZ, bcache device will + set its stripe size directly by this limits.io_opt value. +- If the declared limits.io_opt < BCH_MIN_STRIPE_SZ, bcache device will + set its stripe size by a value multiplying limits.io_opt and euqal or + large than BCH_MIN_STRIPE_SZ. + +Then the minimal stripe size of a bcache device will always be >= 4MB. +For a 40TB raid5 device with 512KB limits.io_opt, memory occupied by +bcache->stripe_sectors_dirty and bcache->full_dirty_stripes will be 50MB +in total. For a 2TB hard drive with 4KB limits.io_opt, memory occupied +by these two arraies will be 2.5MB in total. + +Such mount of memory allocated for bcache->stripe_sectors_dirty and +bcache->full_dirty_stripes is reasonable for most of storage devices. + +Reported-by: Andrea Tomassetti +Signed-off-by: Coly Li +Reviewed-by: Eric Wheeler +Link: https://lore.kernel.org/r/20231120052503.6122-2-colyli@suse.de +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + drivers/md/bcache/bcache.h | 1 + + drivers/md/bcache/super.c | 2 ++ + 2 files changed, 3 insertions(+) + +diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h +index 1dd9298cb0e02..7bce582788458 100644 +--- a/drivers/md/bcache/bcache.h ++++ b/drivers/md/bcache/bcache.h +@@ -265,6 +265,7 @@ struct bcache_device { + #define BCACHE_DEV_WB_RUNNING 3 + #define BCACHE_DEV_RATE_DW_RUNNING 4 + int nr_stripes; ++#define BCH_MIN_STRIPE_SZ ((4 << 20) >> SECTOR_SHIFT) + unsigned int stripe_size; + atomic_t *stripe_sectors_dirty; + unsigned long *full_dirty_stripes; +diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c +index 6afaa5e852837..d5f57a9551dda 100644 +--- a/drivers/md/bcache/super.c ++++ b/drivers/md/bcache/super.c +@@ -822,6 +822,8 @@ static int bcache_device_init(struct bcache_device *d, unsigned int block_size, + + if (!d->stripe_size) + d->stripe_size = 1 << 31; ++ else if (d->stripe_size < BCH_MIN_STRIPE_SZ) ++ d->stripe_size = roundup(BCH_MIN_STRIPE_SZ, d->stripe_size); + + n = DIV_ROUND_UP_ULL(sectors, d->stripe_size); + if (!n || n > max_stripes) { +-- +2.43.0 + diff --git a/queue-5.4/blk-throttle-fix-lockdep-warning-of-cgroup_mutex-or-.patch b/queue-5.4/blk-throttle-fix-lockdep-warning-of-cgroup_mutex-or-.patch new file mode 100644 index 00000000000..5340c0a9b79 --- /dev/null +++ b/queue-5.4/blk-throttle-fix-lockdep-warning-of-cgroup_mutex-or-.patch @@ -0,0 +1,49 @@ +From 575944aaf0ee1a601cdc0baeedc93aab333fa5b2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 17 Nov 2023 10:35:22 +0800 +Subject: blk-throttle: fix lockdep warning of "cgroup_mutex or RCU read lock + required!" + +From: Ming Lei + +[ Upstream commit 27b13e209ddca5979847a1b57890e0372c1edcee ] + +Inside blkg_for_each_descendant_pre(), both +css_for_each_descendant_pre() and blkg_lookup() requires RCU read lock, +and either cgroup_assert_mutex_or_rcu_locked() or rcu_read_lock_held() +is called. + +Fix the warning by adding rcu read lock. + +Reported-by: Changhui Zhong +Signed-off-by: Ming Lei +Link: https://lore.kernel.org/r/20231117023527.3188627-2-ming.lei@redhat.com +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + block/blk-throttle.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/block/blk-throttle.c b/block/blk-throttle.c +index bd870f9ae4586..43444934b9850 100644 +--- a/block/blk-throttle.c ++++ b/block/blk-throttle.c +@@ -1374,6 +1374,7 @@ static void tg_conf_updated(struct throtl_grp *tg, bool global) + tg_bps_limit(tg, READ), tg_bps_limit(tg, WRITE), + tg_iops_limit(tg, READ), tg_iops_limit(tg, WRITE)); + ++ rcu_read_lock(); + /* + * Update has_rules[] flags for the updated tg's subtree. A tg is + * considered to have rules if either the tg itself or any of its +@@ -1401,6 +1402,7 @@ static void tg_conf_updated(struct throtl_grp *tg, bool global) + this_tg->latency_target = max(this_tg->latency_target, + parent_tg->latency_target); + } ++ rcu_read_unlock(); + + /* + * We're already holding queue_lock and know @tg is valid. Let's +-- +2.43.0 + diff --git a/queue-5.4/hid-add-always_poll-quirk-for-apple-kb.patch b/queue-5.4/hid-add-always_poll-quirk-for-apple-kb.patch new file mode 100644 index 00000000000..05a50446f20 --- /dev/null +++ b/queue-5.4/hid-add-always_poll-quirk-for-apple-kb.patch @@ -0,0 +1,34 @@ +From f338ce22c428b496f8b207334d4a735d056bea40 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 14 Nov 2023 15:54:30 +0100 +Subject: HID: add ALWAYS_POLL quirk for Apple kb + +From: Oliver Neukum + +[ Upstream commit c55092187d9ad7b2f8f5a8645286fa03997d442f ] + +These devices disconnect if suspended without remote wakeup. They can operate +with the standard driver. + +Signed-off-by: Oliver Neukum +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/hid-quirks.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c +index fae784df084d5..fd84661df5fa7 100644 +--- a/drivers/hid/hid-quirks.c ++++ b/drivers/hid/hid-quirks.c +@@ -33,6 +33,7 @@ static const struct hid_device_id hid_quirks[] = { + { HID_USB_DEVICE(USB_VENDOR_ID_AKAI, USB_DEVICE_ID_AKAI_MPKMINI2), HID_QUIRK_NO_INIT_REPORTS }, + { HID_USB_DEVICE(USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD), HID_QUIRK_BADPAD }, + { HID_USB_DEVICE(USB_VENDOR_ID_AMI, USB_DEVICE_ID_AMI_VIRT_KEYBOARD_AND_MOUSE), HID_QUIRK_ALWAYS_POLL }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ANSI), HID_QUIRK_ALWAYS_POLL }, + { HID_USB_DEVICE(USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM), HID_QUIRK_NOGET }, + { HID_USB_DEVICE(USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC), HID_QUIRK_NOGET }, + { HID_USB_DEVICE(USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM), HID_QUIRK_NOGET }, +-- +2.43.0 + diff --git a/queue-5.4/hid-hid-asus-add-const-to-read-only-outgoing-usb-buf.patch b/queue-5.4/hid-hid-asus-add-const-to-read-only-outgoing-usb-buf.patch new file mode 100644 index 00000000000..2531eb23351 --- /dev/null +++ b/queue-5.4/hid-hid-asus-add-const-to-read-only-outgoing-usb-buf.patch @@ -0,0 +1,56 @@ +From 0a31ec5ab060031efc4bada52be553dd01f86bd9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 17 Nov 2023 14:15:55 +1300 +Subject: HID: hid-asus: add const to read-only outgoing usb buffer + +From: Denis Benato + +[ Upstream commit 06ae5afce8cc1f7621cc5c7751e449ce20d68af7 ] + +In the function asus_kbd_set_report the parameter buf is read-only +as it gets copied in a memory portion suitable for USB transfer, +but the parameter is not marked as const: add the missing const and mark +const immutable buffers passed to that function. + +Signed-off-by: Denis Benato +Signed-off-by: Luke D. Jones +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/hid-asus.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c +index ce0fade00a183..dea9268629056 100644 +--- a/drivers/hid/hid-asus.c ++++ b/drivers/hid/hid-asus.c +@@ -336,7 +336,7 @@ static int asus_raw_event(struct hid_device *hdev, + return 0; + } + +-static int asus_kbd_set_report(struct hid_device *hdev, u8 *buf, size_t buf_size) ++static int asus_kbd_set_report(struct hid_device *hdev, const u8 *buf, size_t buf_size) + { + unsigned char *dmabuf; + int ret; +@@ -355,7 +355,7 @@ static int asus_kbd_set_report(struct hid_device *hdev, u8 *buf, size_t buf_size + + static int asus_kbd_init(struct hid_device *hdev) + { +- u8 buf[] = { FEATURE_KBD_REPORT_ID, 0x41, 0x53, 0x55, 0x53, 0x20, 0x54, ++ const u8 buf[] = { FEATURE_KBD_REPORT_ID, 0x41, 0x53, 0x55, 0x53, 0x20, 0x54, + 0x65, 0x63, 0x68, 0x2e, 0x49, 0x6e, 0x63, 0x2e, 0x00 }; + int ret; + +@@ -369,7 +369,7 @@ static int asus_kbd_init(struct hid_device *hdev) + static int asus_kbd_get_functions(struct hid_device *hdev, + unsigned char *kbd_func) + { +- u8 buf[] = { FEATURE_KBD_REPORT_ID, 0x05, 0x20, 0x31, 0x00, 0x08 }; ++ const u8 buf[] = { FEATURE_KBD_REPORT_ID, 0x05, 0x20, 0x31, 0x00, 0x08 }; + u8 *readbuf; + int ret; + +-- +2.43.0 + diff --git a/queue-5.4/hid-hid-asus-reset-the-backlight-brightness-level-on.patch b/queue-5.4/hid-hid-asus-reset-the-backlight-brightness-level-on.patch new file mode 100644 index 00000000000..ce70f2a27a2 --- /dev/null +++ b/queue-5.4/hid-hid-asus-reset-the-backlight-brightness-level-on.patch @@ -0,0 +1,67 @@ +From 09aeeefbde88a3bfc9c855d4aac804b65735f75c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 17 Nov 2023 14:15:56 +1300 +Subject: HID: hid-asus: reset the backlight brightness level on resume + +From: Denis Benato + +[ Upstream commit 546edbd26cff7ae990e480a59150e801a06f77b1 ] + +Some devices managed by this driver automatically set brightness to 0 +before entering a suspended state and reset it back to a default +brightness level after the resume: +this has the effect of having the kernel report wrong brightness +status after a sleep, and on some devices (like the Asus RC71L) that +brightness is the intensity of LEDs directly facing the user. + +Fix the above issue by setting back brightness to the level it had +before entering a sleep state. + +Signed-off-by: Denis Benato +Signed-off-by: Luke D. Jones +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/hid-asus.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c +index e15ba7f5fe0a0..ce0fade00a183 100644 +--- a/drivers/hid/hid-asus.c ++++ b/drivers/hid/hid-asus.c +@@ -908,6 +908,24 @@ static int asus_start_multitouch(struct hid_device *hdev) + return 0; + } + ++static int __maybe_unused asus_resume(struct hid_device *hdev) { ++ struct asus_drvdata *drvdata = hid_get_drvdata(hdev); ++ int ret = 0; ++ ++ if (drvdata->kbd_backlight) { ++ const u8 buf[] = { FEATURE_KBD_REPORT_ID, 0xba, 0xc5, 0xc4, ++ drvdata->kbd_backlight->cdev.brightness }; ++ ret = asus_kbd_set_report(hdev, buf, sizeof(buf)); ++ if (ret < 0) { ++ hid_err(hdev, "Asus failed to set keyboard backlight: %d\n", ret); ++ goto asus_resume_err; ++ } ++ } ++ ++asus_resume_err: ++ return ret; ++} ++ + static int __maybe_unused asus_reset_resume(struct hid_device *hdev) + { + struct asus_drvdata *drvdata = hid_get_drvdata(hdev); +@@ -1185,6 +1203,7 @@ static struct hid_driver asus_driver = { + .input_configured = asus_input_configured, + #ifdef CONFIG_PM + .reset_resume = asus_reset_resume, ++ .resume = asus_resume, + #endif + .event = asus_event, + .raw_event = asus_raw_event +-- +2.43.0 + diff --git a/queue-5.4/hid-multitouch-add-quirk-for-honor-glo-gxxx-touchpad.patch b/queue-5.4/hid-multitouch-add-quirk-for-honor-glo-gxxx-touchpad.patch new file mode 100644 index 00000000000..8b24a1fd651 --- /dev/null +++ b/queue-5.4/hid-multitouch-add-quirk-for-honor-glo-gxxx-touchpad.patch @@ -0,0 +1,46 @@ +From ac0fc385d3f7d3a73bd248c9a773f6a5022e1d60 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 21 Nov 2023 20:23:11 +0800 +Subject: HID: multitouch: Add quirk for HONOR GLO-GXXX touchpad + +From: Aoba K + +[ Upstream commit 9ffccb691adb854e7b7f3ee57fbbda12ff70533f ] + +Honor MagicBook 13 2023 has a touchpad which do not switch to the multitouch +mode until the input mode feature is written by the host. The touchpad do +report the input mode at touchpad(3), while itself working under mouse mode. As +a workaround, it is possible to call MT_QUIRE_FORCE_GET_FEATURE to force set +feature in mt_set_input_mode for such device. + +The touchpad reports as BLTP7853, which cannot retrive any useful manufacture +information on the internel by this string at present. As the serial number of +the laptop is GLO-G52, while DMI info reports the laptop serial number as +GLO-GXXX, this workaround should applied to all models which has the GLO-GXXX. + +Signed-off-by: Aoba K +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/hid-multitouch.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c +index 590b25460456b..c37399f61c67b 100644 +--- a/drivers/hid/hid-multitouch.c ++++ b/drivers/hid/hid-multitouch.c +@@ -2003,6 +2003,11 @@ static const struct hid_device_id mt_devices[] = { + MT_USB_DEVICE(USB_VENDOR_ID_HANVON_ALT, + USB_DEVICE_ID_HANVON_ALT_MULTITOUCH) }, + ++ /* HONOR GLO-GXXX panel */ ++ { .driver_data = MT_CLS_VTL, ++ HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8, ++ 0x347d, 0x7853) }, ++ + /* Ilitek dual touch panel */ + { .driver_data = MT_CLS_NSMU, + MT_USB_DEVICE(USB_VENDOR_ID_ILITEK, +-- +2.43.0 + diff --git a/queue-5.4/net-usb-qmi_wwan-claim-interface-4-for-zte-mf290.patch b/queue-5.4/net-usb-qmi_wwan-claim-interface-4-for-zte-mf290.patch new file mode 100644 index 00000000000..f3e0a598a1c --- /dev/null +++ b/queue-5.4/net-usb-qmi_wwan-claim-interface-4-for-zte-mf290.patch @@ -0,0 +1,68 @@ +From 1519a834e82b94996033fbd816741bfcb24c62c8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 18 Nov 2023 00:19:18 +0100 +Subject: net: usb: qmi_wwan: claim interface 4 for ZTE MF290 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Lech Perczak + +[ Upstream commit 99360d9620f09fb8bc15548d855011bbb198c680 ] + +Interface 4 is used by for QMI interface in stock firmware of MF28D, the +router which uses MF290 modem. Rebind it to qmi_wwan after freeing it up +from option driver. +The proper configuration is: + +Interface mapping is: +0: QCDM, 1: (unknown), 2: AT (PCUI), 2: AT (Modem), 4: QMI + +T: Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 4 Spd=480 MxCh= 0 +D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 +P: Vendor=19d2 ProdID=0189 Rev= 0.00 +S: Manufacturer=ZTE, Incorporated +S: Product=ZTE LTE Technologies MSM +C:* #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA +I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option +E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms +I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option +E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms +I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option +E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms +I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option +E: Ad=84(I) Atr=03(Int.) MxPS= 64 Ivl=2ms +E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms +I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan +E: Ad=86(I) Atr=03(Int.) MxPS= 64 Ivl=2ms +E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms + +Cc: Bjørn Mork +Signed-off-by: Lech Perczak +Link: https://lore.kernel.org/r/20231117231918.100278-3-lech.perczak@gmail.com +Signed-off-by: Paolo Abeni +Signed-off-by: Sasha Levin +--- + drivers/net/usb/qmi_wwan.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c +index ebc1f01d5ea27..c2bd4abce6de5 100644 +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -1247,6 +1247,7 @@ static const struct usb_device_id products[] = { + {QMI_FIXED_INTF(0x19d2, 0x0168, 4)}, + {QMI_FIXED_INTF(0x19d2, 0x0176, 3)}, + {QMI_FIXED_INTF(0x19d2, 0x0178, 3)}, ++ {QMI_FIXED_INTF(0x19d2, 0x0189, 4)}, /* ZTE MF290 */ + {QMI_FIXED_INTF(0x19d2, 0x0191, 4)}, /* ZTE EuFi890 */ + {QMI_FIXED_INTF(0x19d2, 0x0199, 1)}, /* ZTE MF820S */ + {QMI_FIXED_INTF(0x19d2, 0x0200, 1)}, +-- +2.43.0 + diff --git a/queue-5.4/platform-x86-intel_telemetry-fix-kernel-doc-descript.patch b/queue-5.4/platform-x86-intel_telemetry-fix-kernel-doc-descript.patch new file mode 100644 index 00000000000..ba4827d288f --- /dev/null +++ b/queue-5.4/platform-x86-intel_telemetry-fix-kernel-doc-descript.patch @@ -0,0 +1,57 @@ +From 922eab8c94daf366a3d6965c93f2fa714f1279f9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 20 Nov 2023 17:07:56 +0200 +Subject: platform/x86: intel_telemetry: Fix kernel doc descriptions +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Andy Shevchenko + +[ Upstream commit a6584711e64d9d12ab79a450ec3628fd35e4f476 ] + +LKP found issues with a kernel doc in the driver: + +core.c:116: warning: Function parameter or member 'ioss_evtconfig' not described in 'telemetry_update_events' +core.c:188: warning: Function parameter or member 'ioss_evtconfig' not described in 'telemetry_get_eventconfig' + +It looks like it were copy'n'paste typos when these descriptions +had been introduced. Fix the typos. + +Reported-by: kernel test robot +Closes: https://lore.kernel.org/oe-kbuild-all/202310070743.WALmRGSY-lkp@intel.com/ +Signed-off-by: Andy Shevchenko +Link: https://lore.kernel.org/r/20231120150756.1661425-1-andriy.shevchenko@linux.intel.com +Reviewed-by: Rajneesh Bhardwaj +Reviewed-by: Ilpo Järvinen +Signed-off-by: Ilpo Järvinen +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/intel_telemetry_core.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/platform/x86/intel_telemetry_core.c b/drivers/platform/x86/intel_telemetry_core.c +index d4040bb222b48..59fc6624b1ac9 100644 +--- a/drivers/platform/x86/intel_telemetry_core.c ++++ b/drivers/platform/x86/intel_telemetry_core.c +@@ -102,7 +102,7 @@ static const struct telemetry_core_ops telm_defpltops = { + /** + * telemetry_update_events() - Update telemetry Configuration + * @pss_evtconfig: PSS related config. No change if num_evts = 0. +- * @pss_evtconfig: IOSS related config. No change if num_evts = 0. ++ * @ioss_evtconfig: IOSS related config. No change if num_evts = 0. + * + * This API updates the IOSS & PSS Telemetry configuration. Old config + * is overwritten. Call telemetry_reset_events when logging is over +@@ -176,7 +176,7 @@ EXPORT_SYMBOL_GPL(telemetry_reset_events); + /** + * telemetry_get_eventconfig() - Returns the pss and ioss events enabled + * @pss_evtconfig: Pointer to PSS related configuration. +- * @pss_evtconfig: Pointer to IOSS related configuration. ++ * @ioss_evtconfig: Pointer to IOSS related configuration. + * @pss_len: Number of u32 elements allocated for pss_evtconfig array + * @ioss_len: Number of u32 elements allocated for ioss_evtconfig array + * +-- +2.43.0 + diff --git a/queue-5.4/series b/queue-5.4/series index 18e5ad0dd1d..d5a09e6018b 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -14,3 +14,15 @@ vsock-virtio-fix-unsigned-integer-wrap-around-in-vir.patch net-stmmac-use-dev_err_probe-for-reporting-mdio-bus-.patch net-stmmac-handle-disabled-mdio-busses-from-devicetr.patch appletalk-fix-use-after-free-in-atalk_ioctl.patch +usb-aqc111-check-packet-for-fixup-for-true-limit.patch +blk-throttle-fix-lockdep-warning-of-cgroup_mutex-or-.patch +bcache-avoid-oversize-memory-allocation-by-small-str.patch +bcache-add-code-comments-for-bch_btree_node_get-and-.patch +bcache-avoid-null-checking-to-c-root-in-run_cache_se.patch +platform-x86-intel_telemetry-fix-kernel-doc-descript.patch +hid-add-always_poll-quirk-for-apple-kb.patch +hid-hid-asus-reset-the-backlight-brightness-level-on.patch +hid-multitouch-add-quirk-for-honor-glo-gxxx-touchpad.patch +asm-generic-qspinlock-fix-queued_spin_value_unlocked.patch +net-usb-qmi_wwan-claim-interface-4-for-zte-mf290.patch +hid-hid-asus-add-const-to-read-only-outgoing-usb-buf.patch diff --git a/queue-5.4/usb-aqc111-check-packet-for-fixup-for-true-limit.patch b/queue-5.4/usb-aqc111-check-packet-for-fixup-for-true-limit.patch new file mode 100644 index 00000000000..c229d75d19e --- /dev/null +++ b/queue-5.4/usb-aqc111-check-packet-for-fixup-for-true-limit.patch @@ -0,0 +1,58 @@ +From 2afcc69a0de659bfd79b823c2c0a36bf02647b5c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 15 Nov 2023 11:08:57 +0100 +Subject: usb: aqc111: check packet for fixup for true limit + +From: Oliver Neukum + +[ Upstream commit ccab434e674ca95d483788b1895a70c21b7f016a ] + +If a device sends a packet that is inbetween 0 +and sizeof(u64) the value passed to skb_trim() +as length will wrap around ending up as some very +large value. + +The driver will then proceed to parse the header +located at that position, which will either oops or +process some random value. + +The fix is to check against sizeof(u64) rather than +0, which the driver currently does. The issue exists +since the introduction of the driver. + +Signed-off-by: Oliver Neukum +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/usb/aqc111.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c +index 68912e266826b..892d58b38cf5b 100644 +--- a/drivers/net/usb/aqc111.c ++++ b/drivers/net/usb/aqc111.c +@@ -1079,17 +1079,17 @@ static int aqc111_rx_fixup(struct usbnet *dev, struct sk_buff *skb) + u16 pkt_count = 0; + u64 desc_hdr = 0; + u16 vlan_tag = 0; +- u32 skb_len = 0; ++ u32 skb_len; + + if (!skb) + goto err; + +- if (skb->len == 0) ++ skb_len = skb->len; ++ if (skb_len < sizeof(desc_hdr)) + goto err; + +- skb_len = skb->len; + /* RX Descriptor Header */ +- skb_trim(skb, skb->len - sizeof(desc_hdr)); ++ skb_trim(skb, skb_len - sizeof(desc_hdr)); + desc_hdr = le64_to_cpup((u64 *)skb_tail_pointer(skb)); + + /* Check these packets */ +-- +2.43.0 +