From: Sasha Levin Date: Wed, 4 Sep 2024 10:27:28 +0000 (-0400) Subject: Fixes for 5.15 X-Git-Tag: v6.1.109~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c2b79f1695ad0aeb5a09a452ce60912caf52c35b;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.15 Signed-off-by: Sasha Levin --- diff --git a/queue-5.15/alsa-hda-conexant-mute-speakers-at-suspend-shutdown.patch b/queue-5.15/alsa-hda-conexant-mute-speakers-at-suspend-shutdown.patch new file mode 100644 index 00000000000..3fbfc0ef0a7 --- /dev/null +++ b/queue-5.15/alsa-hda-conexant-mute-speakers-at-suspend-shutdown.patch @@ -0,0 +1,36 @@ +From 53c3026d8c549ebc7231dc1f34541edce86dc04c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 26 Jul 2024 16:26:20 +0200 +Subject: ALSA: hda/conexant: Mute speakers at suspend / shutdown + +From: Takashi Iwai + +[ Upstream commit 4f61c8fe35202702426cfc0003e15116a01ba885 ] + +Use the new helper to mute speakers at suspend / shutdown for avoiding +click noises. + +Link: https://bugzilla.suse.com/show_bug.cgi?id=1228269 +Link: https://patch.msgid.link/20240726142625.2460-2-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/pci/hda/patch_conexant.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c +index 09a272c65be11..802a33aaa0d62 100644 +--- a/sound/pci/hda/patch_conexant.c ++++ b/sound/pci/hda/patch_conexant.c +@@ -205,6 +205,8 @@ static void cx_auto_shutdown(struct hda_codec *codec) + { + struct conexant_spec *spec = codec->spec; + ++ snd_hda_gen_shutup_speakers(codec); ++ + /* Turn the problematic codec into D3 to avoid spurious noises + from the internal speaker during (and after) reboot */ + cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, false); +-- +2.43.0 + diff --git a/queue-5.15/alsa-hda-generic-add-a-helper-to-mute-speakers-at-su.patch b/queue-5.15/alsa-hda-generic-add-a-helper-to-mute-speakers-at-su.patch new file mode 100644 index 00000000000..e939dbf5b66 --- /dev/null +++ b/queue-5.15/alsa-hda-generic-add-a-helper-to-mute-speakers-at-su.patch @@ -0,0 +1,114 @@ +From 8c594fb2d75dcde59ece8aeba62734d2be29ba15 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 26 Jul 2024 16:26:19 +0200 +Subject: ALSA: hda/generic: Add a helper to mute speakers at suspend/shutdown + +From: Takashi Iwai + +[ Upstream commit 6cd23b26b348fa52c88e1adf9c0e48d68e13f95e ] + +Some devices indicate click noises at suspend or shutdown when the +speakers are unmuted. This patch adds a helper, +snd_hda_gen_shutup_speakers(), to work around it. The new function is +supposed to be called at suspend or shutdown by the codec driver, and +it mutes the speakers. + +The mute status isn't cached, hence the original mute state will be +restored at resume again. + +Link: https://patch.msgid.link/20240726142625.2460-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/pci/hda/hda_generic.c | 63 +++++++++++++++++++++++++++++++++++++ + sound/pci/hda/hda_generic.h | 1 + + 2 files changed, 64 insertions(+) + +diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c +index dbf7aa88e0e31..992cf82da1024 100644 +--- a/sound/pci/hda/hda_generic.c ++++ b/sound/pci/hda/hda_generic.c +@@ -4952,6 +4952,69 @@ void snd_hda_gen_stream_pm(struct hda_codec *codec, hda_nid_t nid, bool on) + } + EXPORT_SYMBOL_GPL(snd_hda_gen_stream_pm); + ++/* forcibly mute the speaker output without caching; return true if updated */ ++static bool force_mute_output_path(struct hda_codec *codec, hda_nid_t nid) ++{ ++ if (!nid) ++ return false; ++ if (!nid_has_mute(codec, nid, HDA_OUTPUT)) ++ return false; /* no mute, skip */ ++ if (snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) & ++ snd_hda_codec_amp_read(codec, nid, 1, HDA_OUTPUT, 0) & ++ HDA_AMP_MUTE) ++ return false; /* both channels already muted, skip */ ++ ++ /* direct amp update without caching */ ++ snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, ++ AC_AMP_SET_OUTPUT | AC_AMP_SET_LEFT | ++ AC_AMP_SET_RIGHT | HDA_AMP_MUTE); ++ return true; ++} ++ ++/** ++ * snd_hda_gen_shutup_speakers - Forcibly mute the speaker outputs ++ * @codec: the HDA codec ++ * ++ * Forcibly mute the speaker outputs, to be called at suspend or shutdown. ++ * ++ * The mute state done by this function isn't cached, hence the original state ++ * will be restored at resume. ++ * ++ * Return true if the mute state has been changed. ++ */ ++bool snd_hda_gen_shutup_speakers(struct hda_codec *codec) ++{ ++ struct hda_gen_spec *spec = codec->spec; ++ const int *paths; ++ const struct nid_path *path; ++ int i, p, num_paths; ++ bool updated = false; ++ ++ /* if already powered off, do nothing */ ++ if (!snd_hdac_is_power_on(&codec->core)) ++ return false; ++ ++ if (spec->autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) { ++ paths = spec->out_paths; ++ num_paths = spec->autocfg.line_outs; ++ } else { ++ paths = spec->speaker_paths; ++ num_paths = spec->autocfg.speaker_outs; ++ } ++ ++ for (i = 0; i < num_paths; i++) { ++ path = snd_hda_get_path_from_idx(codec, paths[i]); ++ if (!path) ++ continue; ++ for (p = 0; p < path->depth; p++) ++ if (force_mute_output_path(codec, path->path[p])) ++ updated = true; ++ } ++ ++ return updated; ++} ++EXPORT_SYMBOL_GPL(snd_hda_gen_shutup_speakers); ++ + /** + * snd_hda_gen_parse_auto_config - Parse the given BIOS configuration and + * set up the hda_gen_spec +diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h +index 362ddcaea15b3..8fdbb4a14eb40 100644 +--- a/sound/pci/hda/hda_generic.h ++++ b/sound/pci/hda/hda_generic.h +@@ -352,5 +352,6 @@ int snd_hda_gen_add_mute_led_cdev(struct hda_codec *codec, + int snd_hda_gen_add_micmute_led_cdev(struct hda_codec *codec, + int (*callback)(struct led_classdev *, + enum led_brightness)); ++bool snd_hda_gen_shutup_speakers(struct hda_codec *codec); + + #endif /* __SOUND_HDA_GENERIC_H */ +-- +2.43.0 + diff --git a/queue-5.15/dma-debug-avoid-deadlock-between-dma-debug-vs-printk.patch b/queue-5.15/dma-debug-avoid-deadlock-between-dma-debug-vs-printk.patch new file mode 100644 index 00000000000..a94c681bc92 --- /dev/null +++ b/queue-5.15/dma-debug-avoid-deadlock-between-dma-debug-vs-printk.patch @@ -0,0 +1,112 @@ +From 549f81ee065406e46dbc3ee04ab39d408cf8e09f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 6 Aug 2024 11:56:45 -0400 +Subject: dma-debug: avoid deadlock between dma debug vs printk and netconsole + +From: Rik van Riel + +[ Upstream commit bd44ca3de49cc1badcff7a96010fa2c64f04868c ] + +Currently the dma debugging code can end up indirectly calling printk +under the radix_lock. This happens when a radix tree node allocation +fails. + +This is a problem because the printk code, when used together with +netconsole, can end up inside the dma debugging code while trying to +transmit a message over netcons. + +This creates the possibility of either a circular deadlock on the same +CPU, with that CPU trying to grab the radix_lock twice, or an ABBA +deadlock between different CPUs, where one CPU grabs the console lock +first and then waits for the radix_lock, while the other CPU is holding +the radix_lock and is waiting for the console lock. + +The trace captured by lockdep is of the ABBA variant. + +-> #2 (&dma_entry_hash[i].lock){-.-.}-{2:2}: + _raw_spin_lock_irqsave+0x5a/0x90 + debug_dma_map_page+0x79/0x180 + dma_map_page_attrs+0x1d2/0x2f0 + bnxt_start_xmit+0x8c6/0x1540 + netpoll_start_xmit+0x13f/0x180 + netpoll_send_skb+0x20d/0x320 + netpoll_send_udp+0x453/0x4a0 + write_ext_msg+0x1b9/0x460 + console_flush_all+0x2ff/0x5a0 + console_unlock+0x55/0x180 + vprintk_emit+0x2e3/0x3c0 + devkmsg_emit+0x5a/0x80 + devkmsg_write+0xfd/0x180 + do_iter_readv_writev+0x164/0x1b0 + vfs_writev+0xf9/0x2b0 + do_writev+0x6d/0x110 + do_syscall_64+0x80/0x150 + entry_SYSCALL_64_after_hwframe+0x4b/0x53 + +-> #0 (console_owner){-.-.}-{0:0}: + __lock_acquire+0x15d1/0x31a0 + lock_acquire+0xe8/0x290 + console_flush_all+0x2ea/0x5a0 + console_unlock+0x55/0x180 + vprintk_emit+0x2e3/0x3c0 + _printk+0x59/0x80 + warn_alloc+0x122/0x1b0 + __alloc_pages_slowpath+0x1101/0x1120 + __alloc_pages+0x1eb/0x2c0 + alloc_slab_page+0x5f/0x150 + new_slab+0x2dc/0x4e0 + ___slab_alloc+0xdcb/0x1390 + kmem_cache_alloc+0x23d/0x360 + radix_tree_node_alloc+0x3c/0xf0 + radix_tree_insert+0xf5/0x230 + add_dma_entry+0xe9/0x360 + dma_map_page_attrs+0x1d2/0x2f0 + __bnxt_alloc_rx_frag+0x147/0x180 + bnxt_alloc_rx_data+0x79/0x160 + bnxt_rx_skb+0x29/0xc0 + bnxt_rx_pkt+0xe22/0x1570 + __bnxt_poll_work+0x101/0x390 + bnxt_poll+0x7e/0x320 + __napi_poll+0x29/0x160 + net_rx_action+0x1e0/0x3e0 + handle_softirqs+0x190/0x510 + run_ksoftirqd+0x4e/0x90 + smpboot_thread_fn+0x1a8/0x270 + kthread+0x102/0x120 + ret_from_fork+0x2f/0x40 + ret_from_fork_asm+0x11/0x20 + +This bug is more likely than it seems, because when one CPU has run out +of memory, chances are the other has too. + +The good news is, this bug is hidden behind the CONFIG_DMA_API_DEBUG, so +not many users are likely to trigger it. + +Signed-off-by: Rik van Riel +Reported-by: Konstantin Ovsepian +Signed-off-by: Christoph Hellwig +Signed-off-by: Sasha Levin +--- + kernel/dma/debug.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c +index 1f9a8cee42241..09ccb4d6bc7b6 100644 +--- a/kernel/dma/debug.c ++++ b/kernel/dma/debug.c +@@ -447,8 +447,11 @@ void debug_dma_dump_mappings(struct device *dev) + * dma_active_cacheline entry to track per event. dma_map_sg(), on the + * other hand, consumes a single dma_debug_entry, but inserts 'nents' + * entries into the tree. ++ * ++ * Use __GFP_NOWARN because the printk from an OOM, to netconsole, could end ++ * up right back in the DMA debugging code, leading to a deadlock. + */ +-static RADIX_TREE(dma_active_cacheline, GFP_ATOMIC); ++static RADIX_TREE(dma_active_cacheline, GFP_ATOMIC | __GFP_NOWARN); + static DEFINE_SPINLOCK(radix_lock); + #define ACTIVE_CACHELINE_MAX_OVERLAP ((1 << RADIX_TREE_MAX_TAGS) - 1) + #define CACHELINE_PER_PAGE_SHIFT (PAGE_SHIFT - L1_CACHE_SHIFT) +-- +2.43.0 + diff --git a/queue-5.15/drm-panel-orientation-quirks-add-quirk-for-orangepi-.patch b/queue-5.15/drm-panel-orientation-quirks-add-quirk-for-orangepi-.patch new file mode 100644 index 00000000000..70da013d6d6 --- /dev/null +++ b/queue-5.15/drm-panel-orientation-quirks-add-quirk-for-orangepi-.patch @@ -0,0 +1,41 @@ +From 95ccbe499dc8177e9f1266a9322da5ae1c2da7cb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 15 Jul 2024 11:57:49 +0700 +Subject: drm: panel-orientation-quirks: Add quirk for OrangePi Neo + +From: Philip Mueller + +[ Upstream commit d60c429610a14560085d98fa6f4cdb43040ca8f0 ] + +This adds a DMI orientation quirk for the OrangePi Neo Linux Gaming +Handheld. + +Signed-off-by: Philip Mueller +Reviewed-by: Hans de Goede +Signed-off-by: Hans de Goede +Link: https://patchwork.freedesktop.org/patch/msgid/20240715045818.1019979-1-philm@manjaro.org +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/drm_panel_orientation_quirks.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/gpu/drm/drm_panel_orientation_quirks.c b/drivers/gpu/drm/drm_panel_orientation_quirks.c +index 43de9dfcba19a..f1091cb87de0c 100644 +--- a/drivers/gpu/drm/drm_panel_orientation_quirks.c ++++ b/drivers/gpu/drm/drm_panel_orientation_quirks.c +@@ -318,6 +318,12 @@ static const struct dmi_system_id orientation_data[] = { + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "ONE XPLAYER"), + }, + .driver_data = (void *)&lcd1600x2560_leftside_up, ++ }, { /* OrangePi Neo */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "OrangePi"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "NEO-01"), ++ }, ++ .driver_data = (void *)&lcd1200x1920_rightside_up, + }, { /* Samsung GalaxyBook 10.6 */ + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), +-- +2.43.0 + diff --git a/queue-5.15/i2c-fix-conditional-for-substituting-empty-acpi-func.patch b/queue-5.15/i2c-fix-conditional-for-substituting-empty-acpi-func.patch new file mode 100644 index 00000000000..136c58718c8 --- /dev/null +++ b/queue-5.15/i2c-fix-conditional-for-substituting-empty-acpi-func.patch @@ -0,0 +1,39 @@ +From 89668d6a28c87c1cce4715c77a9e283f135720f2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 2 Aug 2024 16:22:14 +0100 +Subject: i2c: Fix conditional for substituting empty ACPI functions + +From: Richard Fitzgerald + +[ Upstream commit f17c06c6608ad4ecd2ccf321753fb511812d821b ] + +Add IS_ENABLED(CONFIG_I2C) to the conditional around a bunch of ACPI +functions. + +The conditional around these functions depended only on CONFIG_ACPI. +But the functions are implemented in I2C core, so are only present if +CONFIG_I2C is enabled. + +Signed-off-by: Richard Fitzgerald +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +--- + include/linux/i2c.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/linux/i2c.h b/include/linux/i2c.h +index f071a121ed914..dbb6aa3daf89b 100644 +--- a/include/linux/i2c.h ++++ b/include/linux/i2c.h +@@ -1025,7 +1025,7 @@ static inline int of_i2c_get_board_info(struct device *dev, + struct acpi_resource; + struct acpi_resource_i2c_serialbus; + +-#if IS_ENABLED(CONFIG_ACPI) ++#if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_I2C) + bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares, + struct acpi_resource_i2c_serialbus **i2c); + int i2c_acpi_client_count(struct acpi_device *adev); +-- +2.43.0 + diff --git a/queue-5.15/net-usb-qmi_wwan-add-meig-smart-srm825l.patch b/queue-5.15/net-usb-qmi_wwan-add-meig-smart-srm825l.patch new file mode 100644 index 00000000000..233a9cca27c --- /dev/null +++ b/queue-5.15/net-usb-qmi_wwan-add-meig-smart-srm825l.patch @@ -0,0 +1,64 @@ +From c9e451a7ea9754351c543940a4c046b68a12cc0c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 3 Aug 2024 15:46:51 +0800 +Subject: net: usb: qmi_wwan: add MeiG Smart SRM825L + +From: ZHANG Yuntian + +[ Upstream commit 1ca645a2f74a4290527ae27130c8611391b07dbf ] + +Add support for MeiG Smart SRM825L which is based on Qualcomm 315 chip. + +T: Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=5000 MxCh= 0 +D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 1 +P: Vendor=2dee ProdID=4d22 Rev= 4.14 +S: Manufacturer=MEIG +S: Product=LTE-A Module +S: SerialNumber=6f345e48 +C:* #Ifs= 6 Cfg#= 1 Atr=80 MxPwr=896mA +I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option +E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option +E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms +E: Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option +E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms +E: Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option +E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms +E: Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none) +E: Ad=05(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=88(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=50 Driver=qmi_wwan +E: Ad=89(I) Atr=03(Int.) MxPS= 8 Ivl=32ms +E: Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms + +Signed-off-by: ZHANG Yuntian +Link: https://patch.msgid.link/D1EB81385E405DFE+20240803074656.567061-1-yt@radxa.com +Signed-off-by: Jakub Kicinski +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 773a54c083f61..71ee7a3c3f5b8 100644 +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -1426,6 +1426,7 @@ static const struct usb_device_id products[] = { + {QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */ + {QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 */ + {QMI_QUIRK_SET_DTR(0x33f8, 0x0104, 4)}, /* Rolling RW101 RMNET */ ++ {QMI_FIXED_INTF(0x2dee, 0x4d22, 5)}, /* MeiG Smart SRM825L */ + + /* 4. Gobi 1000 devices */ + {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ +-- +2.43.0 + diff --git a/queue-5.15/series b/queue-5.15/series new file mode 100644 index 00000000000..47073f8f634 --- /dev/null +++ b/queue-5.15/series @@ -0,0 +1,6 @@ +drm-panel-orientation-quirks-add-quirk-for-orangepi-.patch +alsa-hda-generic-add-a-helper-to-mute-speakers-at-su.patch +alsa-hda-conexant-mute-speakers-at-suspend-shutdown.patch +i2c-fix-conditional-for-substituting-empty-acpi-func.patch +dma-debug-avoid-deadlock-between-dma-debug-vs-printk.patch +net-usb-qmi_wwan-add-meig-smart-srm825l.patch