From: Greg Kroah-Hartman Date: Mon, 7 Oct 2024 10:09:47 +0000 (+0200) Subject: 6.6-stable patches X-Git-Tag: v6.6.55~107 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=94dce81f91654a2b81a31ddbee0f52aa3b36940a;p=thirdparty%2Fkernel%2Fstable-queue.git 6.6-stable patches added patches: alsa-core-add-isascii-check-to-card-id-generator.patch alsa-hda-realtek-add-a-quirk-for-hp-pavilion-15z-ec200.patch alsa-hda-realtek-add-quirk-for-huawei-matebook-13-klv-wx9.patch alsa-hda-tas2781-add-new-quirk-for-lenovo-y990-laptop.patch alsa-line6-add-hw-monitor-volume-control-to-pod-hd500x.patch alsa-usb-audio-add-delay-quirk-for-vivo-usb-c-headset.patch alsa-usb-audio-add-native-dsd-support-for-luxman-d-08u.patch drm-consistently-use-struct-drm_mode_rect-for-fb_damage_clips.patch drm-mediatek-ovl_adaptor-add-missing-of_node_put.patch parisc-fix-itlb-miss-handler-for-64-bit-programs.patch perf-core-fix-small-negative-period-being-ignored.patch --- diff --git a/queue-6.6/alsa-core-add-isascii-check-to-card-id-generator.patch b/queue-6.6/alsa-core-add-isascii-check-to-card-id-generator.patch new file mode 100644 index 00000000000..961166c1515 --- /dev/null +++ b/queue-6.6/alsa-core-add-isascii-check-to-card-id-generator.patch @@ -0,0 +1,74 @@ +From d278a9de5e1837edbe57b2f1f95a104ff6c84846 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Oct 2024 21:46:49 +0200 +Subject: ALSA: core: add isascii() check to card ID generator +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Jaroslav Kysela + +commit d278a9de5e1837edbe57b2f1f95a104ff6c84846 upstream. + +The card identifier should contain only safe ASCII characters. The isalnum() +returns true also for characters for non-ASCII characters. + +Link: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4135 +Link: https://lore.kernel.org/linux-sound/yk3WTvKkwheOon_LzZlJ43PPInz6byYfBzpKkbasww1yzuiMRqn7n6Y8vZcXB-xwFCu_vb8hoNjv7DTNwH5TWjpEuiVsyn9HPCEXqwF4120=@protonmail.com/ +Cc: stable@vger.kernel.org +Reported-by: Barnabás Pőcze +Signed-off-by: Jaroslav Kysela +Link: https://patch.msgid.link/20241002194649.1944696-1-perex@perex.cz +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/core/init.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +--- a/sound/core/init.c ++++ b/sound/core/init.c +@@ -666,13 +666,19 @@ void snd_card_free(struct snd_card *card + } + EXPORT_SYMBOL(snd_card_free); + ++/* check, if the character is in the valid ASCII range */ ++static inline bool safe_ascii_char(char c) ++{ ++ return isascii(c) && isalnum(c); ++} ++ + /* retrieve the last word of shortname or longname */ + static const char *retrieve_id_from_card_name(const char *name) + { + const char *spos = name; + + while (*name) { +- if (isspace(*name) && isalnum(name[1])) ++ if (isspace(*name) && safe_ascii_char(name[1])) + spos = name + 1; + name++; + } +@@ -699,12 +705,12 @@ static void copy_valid_id_string(struct + { + char *id = card->id; + +- while (*nid && !isalnum(*nid)) ++ while (*nid && !safe_ascii_char(*nid)) + nid++; + if (isdigit(*nid)) + *id++ = isalpha(*src) ? *src : 'D'; + while (*nid && (size_t)(id - card->id) < sizeof(card->id) - 1) { +- if (isalnum(*nid)) ++ if (safe_ascii_char(*nid)) + *id++ = *nid; + nid++; + } +@@ -800,7 +806,7 @@ static ssize_t id_store(struct device *d + + for (idx = 0; idx < copy; idx++) { + c = buf[idx]; +- if (!isalnum(c) && c != '_' && c != '-') ++ if (!safe_ascii_char(c) && c != '_' && c != '-') + return -EINVAL; + } + memcpy(buf1, buf, copy); diff --git a/queue-6.6/alsa-hda-realtek-add-a-quirk-for-hp-pavilion-15z-ec200.patch b/queue-6.6/alsa-hda-realtek-add-a-quirk-for-hp-pavilion-15z-ec200.patch new file mode 100644 index 00000000000..6210896a5ca --- /dev/null +++ b/queue-6.6/alsa-hda-realtek-add-a-quirk-for-hp-pavilion-15z-ec200.patch @@ -0,0 +1,33 @@ +From d75dba49744478c32f6ce1c16b5f391c2d5cef5f Mon Sep 17 00:00:00 2001 +From: Abhishek Tamboli +Date: Mon, 30 Sep 2024 20:23:00 +0530 +Subject: ALSA: hda/realtek: Add a quirk for HP Pavilion 15z-ec200 + +From: Abhishek Tamboli + +commit d75dba49744478c32f6ce1c16b5f391c2d5cef5f upstream. + +Add the quirk for HP Pavilion Gaming laptop 15z-ec200 for +enabling the mute led. The fix apply the ALC285_FIXUP_HP_MUTE_LED +quirk for this model. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=219303 +Signed-off-by: Abhishek Tamboli +Cc: +Link: https://patch.msgid.link/20240930145300.4604-1-abhishektamboli9@gmail.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -9923,6 +9923,7 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED), + SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), + SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED), ++ SND_PCI_QUIRK(0x103c, 0x88dd, "HP Pavilion 15z-ec200", ALC285_FIXUP_HP_MUTE_LED), + SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED), + SND_PCI_QUIRK(0x103c, 0x890e, "HP 255 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), + SND_PCI_QUIRK(0x103c, 0x8919, "HP Pavilion Aero Laptop 13-be0xxx", ALC287_FIXUP_HP_GPIO_LED), diff --git a/queue-6.6/alsa-hda-realtek-add-quirk-for-huawei-matebook-13-klv-wx9.patch b/queue-6.6/alsa-hda-realtek-add-quirk-for-huawei-matebook-13-klv-wx9.patch new file mode 100644 index 00000000000..62536e2063c --- /dev/null +++ b/queue-6.6/alsa-hda-realtek-add-quirk-for-huawei-matebook-13-klv-wx9.patch @@ -0,0 +1,30 @@ +From dee476950cbd83125655a3f49e00d63b79f6114e Mon Sep 17 00:00:00 2001 +From: Ai Chao +Date: Thu, 26 Sep 2024 14:02:52 +0800 +Subject: ALSA: hda/realtek: Add quirk for Huawei MateBook 13 KLV-WX9 + +From: Ai Chao + +commit dee476950cbd83125655a3f49e00d63b79f6114e upstream. + +The headset mic requires a fixup to be properly detected/used. + +Signed-off-by: Ai Chao +Cc: +Link: https://patch.msgid.link/20240926060252.25630-1-aichao@kylinos.cn +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -10363,6 +10363,7 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC), + SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS), + SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE), ++ SND_PCI_QUIRK(0x19e5, 0x3212, "Huawei KLV-WX9 ", ALC256_FIXUP_ACER_HEADSET_MIC), + SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20), + SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI), + SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101), diff --git a/queue-6.6/alsa-hda-tas2781-add-new-quirk-for-lenovo-y990-laptop.patch b/queue-6.6/alsa-hda-tas2781-add-new-quirk-for-lenovo-y990-laptop.patch new file mode 100644 index 00000000000..aee1ccf3cf5 --- /dev/null +++ b/queue-6.6/alsa-hda-tas2781-add-new-quirk-for-lenovo-y990-laptop.patch @@ -0,0 +1,30 @@ +From 49f5ee951f11f4d6a124f00f71b2590507811a55 Mon Sep 17 00:00:00 2001 +From: Baojun Xu +Date: Thu, 19 Sep 2024 15:57:43 +0800 +Subject: ALSA: hda/tas2781: Add new quirk for Lenovo Y990 Laptop + +From: Baojun Xu + +commit 49f5ee951f11f4d6a124f00f71b2590507811a55 upstream. + +Add new vendor_id and subsystem_id in quirk for Lenovo Y990 Laptop. + +Signed-off-by: Baojun Xu +Cc: +Link: https://patch.msgid.link/20240919075743.259-1-baojun.xu@ti.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -10330,6 +10330,7 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x17aa, 0x38cd, "Y790 VECO DUAL", ALC287_FIXUP_TAS2781_I2C), + SND_PCI_QUIRK(0x17aa, 0x38d2, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN), + SND_PCI_QUIRK(0x17aa, 0x38d7, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN), ++ SND_PCI_QUIRK(0x17aa, 0x38df, "Y990 YG DUAL", ALC287_FIXUP_TAS2781_I2C), + SND_PCI_QUIRK(0x17aa, 0x38f9, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2), + SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2), + SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), diff --git a/queue-6.6/alsa-line6-add-hw-monitor-volume-control-to-pod-hd500x.patch b/queue-6.6/alsa-line6-add-hw-monitor-volume-control-to-pod-hd500x.patch new file mode 100644 index 00000000000..755ca713d1e --- /dev/null +++ b/queue-6.6/alsa-line6-add-hw-monitor-volume-control-to-pod-hd500x.patch @@ -0,0 +1,32 @@ +From 703235a244e533652346844cfa42623afb36eed1 Mon Sep 17 00:00:00 2001 +From: "Hans P. Moller" +Date: Thu, 3 Oct 2024 20:28:28 -0300 +Subject: ALSA: line6: add hw monitor volume control to POD HD500X + +From: Hans P. Moller + +commit 703235a244e533652346844cfa42623afb36eed1 upstream. + +Add hw monitor volume control for POD HD500X. This is done adding +LINE6_CAP_HWMON_CTL to the capabilities + +Signed-off-by: Hans P. Moller +Cc: +Signed-off-by: Takashi Iwai +Link: https://patch.msgid.link/20241003232828.5819-1-hmoller@uc.cl +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/line6/podhd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/usb/line6/podhd.c ++++ b/sound/usb/line6/podhd.c +@@ -507,7 +507,7 @@ static const struct line6_properties pod + [LINE6_PODHD500X] = { + .id = "PODHD500X", + .name = "POD HD500X", +- .capabilities = LINE6_CAP_CONTROL ++ .capabilities = LINE6_CAP_CONTROL | LINE6_CAP_HWMON_CTL + | LINE6_CAP_PCM | LINE6_CAP_HWMON, + .altsetting = 1, + .ep_ctrl_r = 0x81, diff --git a/queue-6.6/alsa-usb-audio-add-delay-quirk-for-vivo-usb-c-headset.patch b/queue-6.6/alsa-usb-audio-add-delay-quirk-for-vivo-usb-c-headset.patch new file mode 100644 index 00000000000..95557af144d --- /dev/null +++ b/queue-6.6/alsa-usb-audio-add-delay-quirk-for-vivo-usb-c-headset.patch @@ -0,0 +1,32 @@ +From 73385f3e0d8088b715ae8f3f66d533c482a376ab Mon Sep 17 00:00:00 2001 +From: Lianqin Hu +Date: Wed, 25 Sep 2024 03:16:29 +0000 +Subject: ALSA: usb-audio: Add delay quirk for VIVO USB-C HEADSET + +From: Lianqin Hu + +commit 73385f3e0d8088b715ae8f3f66d533c482a376ab upstream. + +Audio control requests that sets sampling frequency sometimes fail on +this card. Adding delay between control messages eliminates that problem. + +Signed-off-by: Lianqin Hu +Cc: +Signed-off-by: Takashi Iwai +Link: https://patch.msgid.link/TYUPR06MB62177E629E9DEF2401333BF7D2692@TYUPR06MB6217.apcprd06.prod.outlook.com +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/quirks.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -2181,6 +2181,8 @@ static const struct usb_audio_quirk_flag + QUIRK_FLAG_GENERIC_IMPLICIT_FB), + DEVICE_FLG(0x2b53, 0x0031, /* Fiero SC-01 (firmware v1.1.0) */ + QUIRK_FLAG_GENERIC_IMPLICIT_FB), ++ DEVICE_FLG(0x2d95, 0x8011, /* VIVO USB-C HEADSET */ ++ QUIRK_FLAG_CTL_MSG_DELAY_1M), + DEVICE_FLG(0x2d95, 0x8021, /* VIVO USB-C-XE710 HEADSET */ + QUIRK_FLAG_CTL_MSG_DELAY_1M), + DEVICE_FLG(0x30be, 0x0101, /* Schiit Hel */ diff --git a/queue-6.6/alsa-usb-audio-add-native-dsd-support-for-luxman-d-08u.patch b/queue-6.6/alsa-usb-audio-add-native-dsd-support-for-luxman-d-08u.patch new file mode 100644 index 00000000000..15ab3bd1630 --- /dev/null +++ b/queue-6.6/alsa-usb-audio-add-native-dsd-support-for-luxman-d-08u.patch @@ -0,0 +1,33 @@ +From 6b0bde5d8d4078ca5feec72fd2d828f0e5cf115d Mon Sep 17 00:00:00 2001 +From: Jan Lalinsky +Date: Thu, 3 Oct 2024 05:08:11 +0200 +Subject: ALSA: usb-audio: Add native DSD support for Luxman D-08u + +From: Jan Lalinsky + +commit 6b0bde5d8d4078ca5feec72fd2d828f0e5cf115d upstream. + +Add native DSD support for Luxman D-08u DAC, by adding the PID/VID 1852:5062. +This makes DSD playback work, and also sound quality when playing PCM files +is improved, crackling sounds are gone. + +Signed-off-by: Jan Lalinsky +Cc: +Link: https://patch.msgid.link/20241003030811.2655735-1-lalinsky@c4.cz +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/quirks.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -2123,6 +2123,8 @@ static const struct usb_audio_quirk_flag + QUIRK_FLAG_DISABLE_AUTOSUSPEND), + DEVICE_FLG(0x17aa, 0x104d, /* Lenovo ThinkStation P620 Internal Speaker + Front Headset */ + QUIRK_FLAG_DISABLE_AUTOSUSPEND), ++ DEVICE_FLG(0x1852, 0x5062, /* Luxman D-08u */ ++ QUIRK_FLAG_ITF_USB_DSD_DAC | QUIRK_FLAG_CTL_MSG_DELAY), + DEVICE_FLG(0x1852, 0x5065, /* Luxman DA-06 */ + QUIRK_FLAG_ITF_USB_DSD_DAC | QUIRK_FLAG_CTL_MSG_DELAY), + DEVICE_FLG(0x1901, 0x0191, /* GE B850V3 CP2114 audio interface */ diff --git a/queue-6.6/drm-consistently-use-struct-drm_mode_rect-for-fb_damage_clips.patch b/queue-6.6/drm-consistently-use-struct-drm_mode_rect-for-fb_damage_clips.patch new file mode 100644 index 00000000000..e4b0fdce736 --- /dev/null +++ b/queue-6.6/drm-consistently-use-struct-drm_mode_rect-for-fb_damage_clips.patch @@ -0,0 +1,50 @@ +From 8b0d2f61545545ab5eef923ed6e59fc3be2385e0 Mon Sep 17 00:00:00 2001 +From: Thomas Zimmermann +Date: Mon, 23 Sep 2024 09:58:14 +0200 +Subject: drm: Consistently use struct drm_mode_rect for FB_DAMAGE_CLIPS +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Thomas Zimmermann + +commit 8b0d2f61545545ab5eef923ed6e59fc3be2385e0 upstream. + +FB_DAMAGE_CLIPS is a plane property for damage handling. Its UAPI +should only use UAPI types. Hence replace struct drm_rect with +struct drm_mode_rect in drm_atomic_plane_set_property(). Both types +are identical in practice, so there's no change in behavior. + +Reported-by: Ville Syrjälä +Closes: https://lore.kernel.org/dri-devel/Zu1Ke1TuThbtz15E@intel.com/ +Signed-off-by: Thomas Zimmermann +Fixes: d3b21767821e ("drm: Add a new plane property to send damage during plane update") +Cc: Lukasz Spintzyk +Cc: Deepak Rawat +Cc: Daniel Vetter +Cc: Thomas Hellstrom +Cc: David Airlie +Cc: Simona Vetter +Cc: Maarten Lankhorst +Cc: Maxime Ripard +Cc: Thomas Zimmermann +Cc: dri-devel@lists.freedesktop.org +Cc: # v5.0+ +Reviewed-by: Dmitry Baryshkov +Link: https://patchwork.freedesktop.org/patch/msgid/20240923075841.16231-1-tzimmermann@suse.de +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/drm_atomic_uapi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/drm_atomic_uapi.c ++++ b/drivers/gpu/drm/drm_atomic_uapi.c +@@ -585,7 +585,7 @@ static int drm_atomic_plane_set_property + &state->fb_damage_clips, + val, + -1, +- sizeof(struct drm_rect), ++ sizeof(struct drm_mode_rect), + &replaced); + return ret; + } else if (property == plane->scaling_filter_property) { diff --git a/queue-6.6/drm-mediatek-ovl_adaptor-add-missing-of_node_put.patch b/queue-6.6/drm-mediatek-ovl_adaptor-add-missing-of_node_put.patch new file mode 100644 index 00000000000..8f2834305cf --- /dev/null +++ b/queue-6.6/drm-mediatek-ovl_adaptor-add-missing-of_node_put.patch @@ -0,0 +1,39 @@ +From 5beb6fba25db235b52eab34bde8112f07bb31d75 Mon Sep 17 00:00:00 2001 +From: Javier Carrasco +Date: Mon, 24 Jun 2024 18:43:47 +0200 +Subject: drm/mediatek: ovl_adaptor: Add missing of_node_put() + +From: Javier Carrasco + +commit 5beb6fba25db235b52eab34bde8112f07bb31d75 upstream. + +Error paths that exit for_each_child_of_node() need to call +of_node_put() to decerement the child refcount and avoid memory leaks. + +Add the missing of_node_put(). + +Cc: stable@vger.kernel.org +Fixes: 453c3364632a ("drm/mediatek: Add ovl_adaptor support for MT8195") +Signed-off-by: Javier Carrasco +Reviewed-by: CK Hu +Link: https://patchwork.kernel.org/project/dri-devel/patch/20240624-mtk_disp_ovl_adaptor_scoped-v1-2-9fa1e074d881@gmail.com/ +Signed-off-by: Chun-Kuang Hu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c ++++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c +@@ -436,8 +436,10 @@ static int ovl_adaptor_comp_init(struct + } + + comp_pdev = of_find_device_by_node(node); +- if (!comp_pdev) ++ if (!comp_pdev) { ++ of_node_put(node); + return -EPROBE_DEFER; ++ } + + priv->ovl_adaptor_comp[id] = &comp_pdev->dev; + diff --git a/queue-6.6/parisc-fix-itlb-miss-handler-for-64-bit-programs.patch b/queue-6.6/parisc-fix-itlb-miss-handler-for-64-bit-programs.patch new file mode 100644 index 00000000000..f2a1e84ff20 --- /dev/null +++ b/queue-6.6/parisc-fix-itlb-miss-handler-for-64-bit-programs.patch @@ -0,0 +1,45 @@ +From 9542130937e9dc707dd7c6b7af73326437da2d50 Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Tue, 10 Sep 2024 18:32:24 +0200 +Subject: parisc: Fix itlb miss handler for 64-bit programs + +From: Helge Deller + +commit 9542130937e9dc707dd7c6b7af73326437da2d50 upstream. + +For an itlb miss when executing code above 4 Gb on ILP64 adjust the +iasq/iaoq in the same way isr/ior was adjusted. This fixes signal +delivery for the 64-bit static test program from +http://ftp.parisc-linux.org/src/64bit.tar.gz. Note that signals are +handled by the signal trampoline code in the 64-bit VDSO which is mapped +into high userspace memory region above 4GB for 64-bit processes. + +Signed-off-by: Helge Deller +Cc: stable@vger.kernel.org # v4.19+ +Signed-off-by: Greg Kroah-Hartman +--- + arch/parisc/kernel/entry.S | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +--- a/arch/parisc/kernel/entry.S ++++ b/arch/parisc/kernel/entry.S +@@ -1051,8 +1051,7 @@ ENTRY_CFI(intr_save) /* for os_hpmc */ + STREG %r16, PT_ISR(%r29) + STREG %r17, PT_IOR(%r29) + +-#if 0 && defined(CONFIG_64BIT) +- /* Revisit when we have 64-bit code above 4Gb */ ++#if defined(CONFIG_64BIT) + b,n intr_save2 + + skip_save_ior: +@@ -1060,8 +1059,7 @@ skip_save_ior: + * need to adjust iasq/iaoq here in the same way we adjusted isr/ior + * above. + */ +- extrd,u,* %r8,PSW_W_BIT,1,%r1 +- cmpib,COND(=),n 1,%r1,intr_save2 ++ bb,COND(>=),n %r8,PSW_W_BIT,intr_save2 + LDREG PT_IASQ0(%r29), %r16 + LDREG PT_IAOQ0(%r29), %r17 + /* adjust iasq/iaoq */ diff --git a/queue-6.6/perf-core-fix-small-negative-period-being-ignored.patch b/queue-6.6/perf-core-fix-small-negative-period-being-ignored.patch new file mode 100644 index 00000000000..9529780e954 --- /dev/null +++ b/queue-6.6/perf-core-fix-small-negative-period-being-ignored.patch @@ -0,0 +1,104 @@ +From 62c0b1061593d7012292f781f11145b2d46f43ab Mon Sep 17 00:00:00 2001 +From: Luo Gengkun +Date: Sat, 31 Aug 2024 07:43:15 +0000 +Subject: perf/core: Fix small negative period being ignored + +From: Luo Gengkun + +commit 62c0b1061593d7012292f781f11145b2d46f43ab upstream. + +In perf_adjust_period, we will first calculate period, and then use +this period to calculate delta. However, when delta is less than 0, +there will be a deviation compared to when delta is greater than or +equal to 0. For example, when delta is in the range of [-14,-1], the +range of delta = delta + 7 is between [-7,6], so the final value of +delta/8 is 0. Therefore, the impact of -1 and -2 will be ignored. +This is unacceptable when the target period is very short, because +we will lose a lot of samples. + +Here are some tests and analyzes: +before: + # perf record -e cs -F 1000 ./a.out + [ perf record: Woken up 1 times to write data ] + [ perf record: Captured and wrote 0.022 MB perf.data (518 samples) ] + + # perf script + ... + a.out 396 257.956048: 23 cs: ffffffff81f4eeec schedul> + a.out 396 257.957891: 23 cs: ffffffff81f4eeec schedul> + a.out 396 257.959730: 23 cs: ffffffff81f4eeec schedul> + a.out 396 257.961545: 23 cs: ffffffff81f4eeec schedul> + a.out 396 257.963355: 23 cs: ffffffff81f4eeec schedul> + a.out 396 257.965163: 23 cs: ffffffff81f4eeec schedul> + a.out 396 257.966973: 23 cs: ffffffff81f4eeec schedul> + a.out 396 257.968785: 23 cs: ffffffff81f4eeec schedul> + a.out 396 257.970593: 23 cs: ffffffff81f4eeec schedul> + ... + +after: + # perf record -e cs -F 1000 ./a.out + [ perf record: Woken up 1 times to write data ] + [ perf record: Captured and wrote 0.058 MB perf.data (1466 samples) ] + + # perf script + ... + a.out 395 59.338813: 11 cs: ffffffff81f4eeec schedul> + a.out 395 59.339707: 12 cs: ffffffff81f4eeec schedul> + a.out 395 59.340682: 13 cs: ffffffff81f4eeec schedul> + a.out 395 59.341751: 13 cs: ffffffff81f4eeec schedul> + a.out 395 59.342799: 12 cs: ffffffff81f4eeec schedul> + a.out 395 59.343765: 11 cs: ffffffff81f4eeec schedul> + a.out 395 59.344651: 11 cs: ffffffff81f4eeec schedul> + a.out 395 59.345539: 12 cs: ffffffff81f4eeec schedul> + a.out 395 59.346502: 13 cs: ffffffff81f4eeec schedul> + ... + +test.c + +int main() { + for (int i = 0; i < 20000; i++) + usleep(10); + + return 0; +} + + # time ./a.out + real 0m1.583s + user 0m0.040s + sys 0m0.298s + +The above results were tested on x86-64 qemu with KVM enabled using +test.c as test program. Ideally, we should have around 1500 samples, +but the previous algorithm had only about 500, whereas the modified +algorithm now has about 1400. Further more, the new version shows 1 +sample per 0.001s, while the previous one is 1 sample per 0.002s.This +indicates that the new algorithm is more sensitive to small negative +values compared to old algorithm. + +Fixes: bd2b5b12849a ("perf_counter: More aggressive frequency adjustment") +Signed-off-by: Luo Gengkun +Signed-off-by: Peter Zijlstra (Intel) +Reviewed-by: Adrian Hunter +Reviewed-by: Kan Liang +Cc: stable@vger.kernel.org +Link: https://lkml.kernel.org/r/20240831074316.2106159-2-luogengkun@huaweicloud.com +Signed-off-by: Greg Kroah-Hartman +--- + kernel/events/core.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/kernel/events/core.c ++++ b/kernel/events/core.c +@@ -4104,7 +4104,11 @@ static void perf_adjust_period(struct pe + period = perf_calculate_period(event, nsec, count); + + delta = (s64)(period - hwc->sample_period); +- delta = (delta + 7) / 8; /* low pass filter */ ++ if (delta >= 0) ++ delta += 7; ++ else ++ delta -= 7; ++ delta /= 8; /* low pass filter */ + + sample_period = hwc->sample_period + delta; + diff --git a/queue-6.6/series b/queue-6.6/series index 07c2ee7b608..c2b77ca62a9 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -218,3 +218,14 @@ dt-bindings-clock-exynos7885-fix-duplicated-binding.patch spi-bcm63xx-fix-module-autoloading.patch spi-bcm63xx-fix-missing-pm_runtime_disable.patch power-supply-hwmon-fix-missing-temp1_max_alarm-attribute.patch +perf-core-fix-small-negative-period-being-ignored.patch +parisc-fix-itlb-miss-handler-for-64-bit-programs.patch +drm-mediatek-ovl_adaptor-add-missing-of_node_put.patch +drm-consistently-use-struct-drm_mode_rect-for-fb_damage_clips.patch +alsa-hda-tas2781-add-new-quirk-for-lenovo-y990-laptop.patch +alsa-core-add-isascii-check-to-card-id-generator.patch +alsa-usb-audio-add-delay-quirk-for-vivo-usb-c-headset.patch +alsa-usb-audio-add-native-dsd-support-for-luxman-d-08u.patch +alsa-line6-add-hw-monitor-volume-control-to-pod-hd500x.patch +alsa-hda-realtek-add-quirk-for-huawei-matebook-13-klv-wx9.patch +alsa-hda-realtek-add-a-quirk-for-hp-pavilion-15z-ec200.patch