From: Sasha Levin Date: Thu, 19 Sep 2024 19:36:29 +0000 (-0400) Subject: Fixes for 5.15 X-Git-Tag: v6.1.112~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=678cff8b6a095767aee1c6b750ccd10362bcbe82;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.15 Signed-off-by: Sasha Levin --- diff --git a/queue-5.15/alsa-hda-realtek-fixed-alc256-headphone-no-sound.patch b/queue-5.15/alsa-hda-realtek-fixed-alc256-headphone-no-sound.patch new file mode 100644 index 00000000000..92a1851c56f --- /dev/null +++ b/queue-5.15/alsa-hda-realtek-fixed-alc256-headphone-no-sound.patch @@ -0,0 +1,126 @@ +From dc7362b804dd3801ed2eac0555e407a59596bdd9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 22 Aug 2024 10:54:19 +0800 +Subject: ALSA: hda/realtek - Fixed ALC256 headphone no sound + +From: Kailang Yang + +[ Upstream commit 9b82ff1362f50914c8292902e07be98a9f59d33d ] + +Dell platform, plug headphone or headset, it had a chance to get no +sound from headphone. +Replace depop procedure will solve this issue. + +Signed-off-by: Kailang Yang +Link: https://lore.kernel.org/bb8e2de30d294dc287944efa0667685a@realtek.com +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/pci/hda/patch_realtek.c | 50 ++++++++++++++++++++++++++--------- + 1 file changed, 37 insertions(+), 13 deletions(-) + +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index 52246a65eb893..d2f52bb5dfa4c 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -4905,6 +4905,30 @@ static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, + } + } + ++static void alc_hp_mute_disable(struct hda_codec *codec, unsigned int delay) ++{ ++ if (delay <= 0) ++ delay = 75; ++ snd_hda_codec_write(codec, 0x21, 0, ++ AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); ++ msleep(delay); ++ snd_hda_codec_write(codec, 0x21, 0, ++ AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); ++ msleep(delay); ++} ++ ++static void alc_hp_enable_unmute(struct hda_codec *codec, unsigned int delay) ++{ ++ if (delay <= 0) ++ delay = 75; ++ snd_hda_codec_write(codec, 0x21, 0, ++ AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); ++ msleep(delay); ++ snd_hda_codec_write(codec, 0x21, 0, ++ AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); ++ msleep(delay); ++} ++ + static const struct coef_fw alc225_pre_hsmode[] = { + UPDATE_COEF(0x4a, 1<<8, 0), + UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), +@@ -5006,6 +5030,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec) + case 0x10ec0236: + case 0x10ec0256: + case 0x19e58326: ++ alc_hp_mute_disable(codec, 75); + alc_process_coef_fw(codec, coef0256); + break; + case 0x10ec0234: +@@ -5277,6 +5302,7 @@ static void alc_headset_mode_default(struct hda_codec *codec) + alc_write_coef_idx(codec, 0x45, 0xc089); + msleep(50); + alc_process_coef_fw(codec, coef0256); ++ alc_hp_enable_unmute(codec, 75); + break; + case 0x10ec0234: + case 0x10ec0274: +@@ -5374,6 +5400,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec) + case 0x10ec0256: + case 0x19e58326: + alc_process_coef_fw(codec, coef0256); ++ alc_hp_enable_unmute(codec, 75); + break; + case 0x10ec0234: + case 0x10ec0274: +@@ -5489,6 +5516,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec) + case 0x10ec0256: + case 0x19e58326: + alc_process_coef_fw(codec, coef0256); ++ alc_hp_enable_unmute(codec, 75); + break; + case 0x10ec0234: + case 0x10ec0274: +@@ -5594,25 +5622,21 @@ static void alc_determine_headset_type(struct hda_codec *codec) + alc_write_coef_idx(codec, 0x06, 0x6104); + alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3); + +- snd_hda_codec_write(codec, 0x21, 0, +- AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); +- msleep(80); +- snd_hda_codec_write(codec, 0x21, 0, +- AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); +- + alc_process_coef_fw(codec, coef0255); + msleep(300); + val = alc_read_coef_idx(codec, 0x46); + is_ctia = (val & 0x0070) == 0x0070; +- ++ if (!is_ctia) { ++ alc_write_coef_idx(codec, 0x45, 0xe089); ++ msleep(100); ++ val = alc_read_coef_idx(codec, 0x46); ++ if ((val & 0x0070) == 0x0070) ++ is_ctia = false; ++ else ++ is_ctia = true; ++ } + alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3); + alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); +- +- snd_hda_codec_write(codec, 0x21, 0, +- AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); +- msleep(80); +- snd_hda_codec_write(codec, 0x21, 0, +- AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); + break; + case 0x10ec0234: + case 0x10ec0274: +-- +2.43.0 + diff --git a/queue-5.15/alsa-hda-realtek-fixed-alc256-headphone-no-sound.patch-10398 b/queue-5.15/alsa-hda-realtek-fixed-alc256-headphone-no-sound.patch-10398 new file mode 100644 index 00000000000..92a1851c56f --- /dev/null +++ b/queue-5.15/alsa-hda-realtek-fixed-alc256-headphone-no-sound.patch-10398 @@ -0,0 +1,126 @@ +From dc7362b804dd3801ed2eac0555e407a59596bdd9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 22 Aug 2024 10:54:19 +0800 +Subject: ALSA: hda/realtek - Fixed ALC256 headphone no sound + +From: Kailang Yang + +[ Upstream commit 9b82ff1362f50914c8292902e07be98a9f59d33d ] + +Dell platform, plug headphone or headset, it had a chance to get no +sound from headphone. +Replace depop procedure will solve this issue. + +Signed-off-by: Kailang Yang +Link: https://lore.kernel.org/bb8e2de30d294dc287944efa0667685a@realtek.com +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/pci/hda/patch_realtek.c | 50 ++++++++++++++++++++++++++--------- + 1 file changed, 37 insertions(+), 13 deletions(-) + +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index 52246a65eb893..d2f52bb5dfa4c 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -4905,6 +4905,30 @@ static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, + } + } + ++static void alc_hp_mute_disable(struct hda_codec *codec, unsigned int delay) ++{ ++ if (delay <= 0) ++ delay = 75; ++ snd_hda_codec_write(codec, 0x21, 0, ++ AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); ++ msleep(delay); ++ snd_hda_codec_write(codec, 0x21, 0, ++ AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); ++ msleep(delay); ++} ++ ++static void alc_hp_enable_unmute(struct hda_codec *codec, unsigned int delay) ++{ ++ if (delay <= 0) ++ delay = 75; ++ snd_hda_codec_write(codec, 0x21, 0, ++ AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); ++ msleep(delay); ++ snd_hda_codec_write(codec, 0x21, 0, ++ AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); ++ msleep(delay); ++} ++ + static const struct coef_fw alc225_pre_hsmode[] = { + UPDATE_COEF(0x4a, 1<<8, 0), + UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), +@@ -5006,6 +5030,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec) + case 0x10ec0236: + case 0x10ec0256: + case 0x19e58326: ++ alc_hp_mute_disable(codec, 75); + alc_process_coef_fw(codec, coef0256); + break; + case 0x10ec0234: +@@ -5277,6 +5302,7 @@ static void alc_headset_mode_default(struct hda_codec *codec) + alc_write_coef_idx(codec, 0x45, 0xc089); + msleep(50); + alc_process_coef_fw(codec, coef0256); ++ alc_hp_enable_unmute(codec, 75); + break; + case 0x10ec0234: + case 0x10ec0274: +@@ -5374,6 +5400,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec) + case 0x10ec0256: + case 0x19e58326: + alc_process_coef_fw(codec, coef0256); ++ alc_hp_enable_unmute(codec, 75); + break; + case 0x10ec0234: + case 0x10ec0274: +@@ -5489,6 +5516,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec) + case 0x10ec0256: + case 0x19e58326: + alc_process_coef_fw(codec, coef0256); ++ alc_hp_enable_unmute(codec, 75); + break; + case 0x10ec0234: + case 0x10ec0274: +@@ -5594,25 +5622,21 @@ static void alc_determine_headset_type(struct hda_codec *codec) + alc_write_coef_idx(codec, 0x06, 0x6104); + alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3); + +- snd_hda_codec_write(codec, 0x21, 0, +- AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); +- msleep(80); +- snd_hda_codec_write(codec, 0x21, 0, +- AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); +- + alc_process_coef_fw(codec, coef0255); + msleep(300); + val = alc_read_coef_idx(codec, 0x46); + is_ctia = (val & 0x0070) == 0x0070; +- ++ if (!is_ctia) { ++ alc_write_coef_idx(codec, 0x45, 0xe089); ++ msleep(100); ++ val = alc_read_coef_idx(codec, 0x46); ++ if ((val & 0x0070) == 0x0070) ++ is_ctia = false; ++ else ++ is_ctia = true; ++ } + alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3); + alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); +- +- snd_hda_codec_write(codec, 0x21, 0, +- AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); +- msleep(80); +- snd_hda_codec_write(codec, 0x21, 0, +- AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); + break; + case 0x10ec0234: + case 0x10ec0274: +-- +2.43.0 + diff --git a/queue-5.15/alsa-hda-realtek-fixed-alc285-headphone-no-sound.patch b/queue-5.15/alsa-hda-realtek-fixed-alc285-headphone-no-sound.patch new file mode 100644 index 00000000000..43d00388646 --- /dev/null +++ b/queue-5.15/alsa-hda-realtek-fixed-alc285-headphone-no-sound.patch @@ -0,0 +1,100 @@ +From 99cf78b04ae5498520c355a4297571e423af6849 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 22 Aug 2024 16:46:56 +0800 +Subject: ALSA: hda/realtek - FIxed ALC285 headphone no sound + +From: Kailang Yang + +[ Upstream commit 1fa7b099d60ad64f559bd3b8e3f0d94b2e015514 ] + +Dell platform with ALC215 ALC285 ALC289 ALC225 ALC295 ALC299, plug +headphone or headset. +It had a chance to get no sound from headphone. +Replace depop procedure will solve this issue. + +Signed-off-by: Kailang Yang +Link: https://lore.kernel.org/d0de1b03fd174520945dde216d765223@realtek.com +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/pci/hda/patch_realtek.c | 26 ++++++++++++++------------ + 1 file changed, 14 insertions(+), 12 deletions(-) + +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index d2f52bb5dfa4c..7e035d69f9de5 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -5065,6 +5065,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec) + case 0x10ec0295: + case 0x10ec0289: + case 0x10ec0299: ++ alc_hp_mute_disable(codec, 75); + alc_process_coef_fw(codec, alc225_pre_hsmode); + alc_process_coef_fw(codec, coef0225); + break; +@@ -5290,6 +5291,7 @@ static void alc_headset_mode_default(struct hda_codec *codec) + case 0x10ec0299: + alc_process_coef_fw(codec, alc225_pre_hsmode); + alc_process_coef_fw(codec, coef0225); ++ alc_hp_enable_unmute(codec, 75); + break; + case 0x10ec0255: + alc_process_coef_fw(codec, coef0255); +@@ -5449,6 +5451,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec) + alc_process_coef_fw(codec, coef0225_2); + else + alc_process_coef_fw(codec, coef0225_1); ++ alc_hp_enable_unmute(codec, 75); + break; + case 0x10ec0867: + alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); +@@ -5554,6 +5557,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec) + case 0x10ec0289: + case 0x10ec0299: + alc_process_coef_fw(codec, coef0225); ++ alc_hp_enable_unmute(codec, 75); + break; + } + codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n"); +@@ -5713,12 +5717,6 @@ static void alc_determine_headset_type(struct hda_codec *codec) + case 0x10ec0295: + case 0x10ec0289: + case 0x10ec0299: +- snd_hda_codec_write(codec, 0x21, 0, +- AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); +- msleep(80); +- snd_hda_codec_write(codec, 0x21, 0, +- AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); +- + alc_process_coef_fw(codec, alc225_pre_hsmode); + alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000); + val = alc_read_coef_idx(codec, 0x45); +@@ -5735,15 +5733,19 @@ static void alc_determine_headset_type(struct hda_codec *codec) + val = alc_read_coef_idx(codec, 0x46); + is_ctia = (val & 0x00f0) == 0x00f0; + } ++ if (!is_ctia) { ++ alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x38<<10); ++ alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); ++ msleep(100); ++ val = alc_read_coef_idx(codec, 0x46); ++ if ((val & 0x00f0) == 0x00f0) ++ is_ctia = false; ++ else ++ is_ctia = true; ++ } + alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6); + alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4); + alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); +- +- snd_hda_codec_write(codec, 0x21, 0, +- AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); +- msleep(80); +- snd_hda_codec_write(codec, 0x21, 0, +- AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); + break; + case 0x10ec0867: + is_ctia = true; +-- +2.43.0 + diff --git a/queue-5.15/alsa-hda-realtek-fixed-alc285-headphone-no-sound.patch-13701 b/queue-5.15/alsa-hda-realtek-fixed-alc285-headphone-no-sound.patch-13701 new file mode 100644 index 00000000000..43d00388646 --- /dev/null +++ b/queue-5.15/alsa-hda-realtek-fixed-alc285-headphone-no-sound.patch-13701 @@ -0,0 +1,100 @@ +From 99cf78b04ae5498520c355a4297571e423af6849 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 22 Aug 2024 16:46:56 +0800 +Subject: ALSA: hda/realtek - FIxed ALC285 headphone no sound + +From: Kailang Yang + +[ Upstream commit 1fa7b099d60ad64f559bd3b8e3f0d94b2e015514 ] + +Dell platform with ALC215 ALC285 ALC289 ALC225 ALC295 ALC299, plug +headphone or headset. +It had a chance to get no sound from headphone. +Replace depop procedure will solve this issue. + +Signed-off-by: Kailang Yang +Link: https://lore.kernel.org/d0de1b03fd174520945dde216d765223@realtek.com +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/pci/hda/patch_realtek.c | 26 ++++++++++++++------------ + 1 file changed, 14 insertions(+), 12 deletions(-) + +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index d2f52bb5dfa4c..7e035d69f9de5 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -5065,6 +5065,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec) + case 0x10ec0295: + case 0x10ec0289: + case 0x10ec0299: ++ alc_hp_mute_disable(codec, 75); + alc_process_coef_fw(codec, alc225_pre_hsmode); + alc_process_coef_fw(codec, coef0225); + break; +@@ -5290,6 +5291,7 @@ static void alc_headset_mode_default(struct hda_codec *codec) + case 0x10ec0299: + alc_process_coef_fw(codec, alc225_pre_hsmode); + alc_process_coef_fw(codec, coef0225); ++ alc_hp_enable_unmute(codec, 75); + break; + case 0x10ec0255: + alc_process_coef_fw(codec, coef0255); +@@ -5449,6 +5451,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec) + alc_process_coef_fw(codec, coef0225_2); + else + alc_process_coef_fw(codec, coef0225_1); ++ alc_hp_enable_unmute(codec, 75); + break; + case 0x10ec0867: + alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); +@@ -5554,6 +5557,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec) + case 0x10ec0289: + case 0x10ec0299: + alc_process_coef_fw(codec, coef0225); ++ alc_hp_enable_unmute(codec, 75); + break; + } + codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n"); +@@ -5713,12 +5717,6 @@ static void alc_determine_headset_type(struct hda_codec *codec) + case 0x10ec0295: + case 0x10ec0289: + case 0x10ec0299: +- snd_hda_codec_write(codec, 0x21, 0, +- AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); +- msleep(80); +- snd_hda_codec_write(codec, 0x21, 0, +- AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); +- + alc_process_coef_fw(codec, alc225_pre_hsmode); + alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000); + val = alc_read_coef_idx(codec, 0x45); +@@ -5735,15 +5733,19 @@ static void alc_determine_headset_type(struct hda_codec *codec) + val = alc_read_coef_idx(codec, 0x46); + is_ctia = (val & 0x00f0) == 0x00f0; + } ++ if (!is_ctia) { ++ alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x38<<10); ++ alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); ++ msleep(100); ++ val = alc_read_coef_idx(codec, 0x46); ++ if ((val & 0x00f0) == 0x00f0) ++ is_ctia = false; ++ else ++ is_ctia = true; ++ } + alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6); + alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4); + alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); +- +- snd_hda_codec_write(codec, 0x21, 0, +- AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); +- msleep(80); +- snd_hda_codec_write(codec, 0x21, 0, +- AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); + break; + case 0x10ec0867: + is_ctia = true; +-- +2.43.0 + diff --git a/queue-5.15/asoc-allow-module-autoloading-for-table-db1200_pids.patch b/queue-5.15/asoc-allow-module-autoloading-for-table-db1200_pids.patch new file mode 100644 index 00000000000..f7e304f0305 --- /dev/null +++ b/queue-5.15/asoc-allow-module-autoloading-for-table-db1200_pids.patch @@ -0,0 +1,35 @@ +From cb75b80dc550c0bdd99a595bd5a9d8ed63e3343b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 21 Aug 2024 14:19:54 +0800 +Subject: ASoC: allow module autoloading for table db1200_pids + +From: Hongbo Li + +[ Upstream commit 0e9fdab1e8df490354562187cdbb8dec643eae2c ] + +Add MODULE_DEVICE_TABLE(), so modules could be properly +autoloaded based on the alias from platform_device_id table. + +Signed-off-by: Hongbo Li +Link: https://patch.msgid.link/20240821061955.2273782-2-lihongbo22@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/au1x/db1200.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/au1x/db1200.c b/sound/soc/au1x/db1200.c +index 5f8baad37a401..48243164b7ac8 100644 +--- a/sound/soc/au1x/db1200.c ++++ b/sound/soc/au1x/db1200.c +@@ -44,6 +44,7 @@ static const struct platform_device_id db1200_pids[] = { + }, + {}, + }; ++MODULE_DEVICE_TABLE(platform, db1200_pids); + + /*------------------------- AC97 PART ---------------------------*/ + +-- +2.43.0 + diff --git a/queue-5.15/asoc-allow-module-autoloading-for-table-db1200_pids.patch-15912 b/queue-5.15/asoc-allow-module-autoloading-for-table-db1200_pids.patch-15912 new file mode 100644 index 00000000000..f7e304f0305 --- /dev/null +++ b/queue-5.15/asoc-allow-module-autoloading-for-table-db1200_pids.patch-15912 @@ -0,0 +1,35 @@ +From cb75b80dc550c0bdd99a595bd5a9d8ed63e3343b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 21 Aug 2024 14:19:54 +0800 +Subject: ASoC: allow module autoloading for table db1200_pids + +From: Hongbo Li + +[ Upstream commit 0e9fdab1e8df490354562187cdbb8dec643eae2c ] + +Add MODULE_DEVICE_TABLE(), so modules could be properly +autoloaded based on the alias from platform_device_id table. + +Signed-off-by: Hongbo Li +Link: https://patch.msgid.link/20240821061955.2273782-2-lihongbo22@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/au1x/db1200.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/au1x/db1200.c b/sound/soc/au1x/db1200.c +index 5f8baad37a401..48243164b7ac8 100644 +--- a/sound/soc/au1x/db1200.c ++++ b/sound/soc/au1x/db1200.c +@@ -44,6 +44,7 @@ static const struct platform_device_id db1200_pids[] = { + }, + {}, + }; ++MODULE_DEVICE_TABLE(platform, db1200_pids); + + /*------------------------- AC97 PART ---------------------------*/ + +-- +2.43.0 + diff --git a/queue-5.15/asoc-intel-fix-module-autoloading.patch b/queue-5.15/asoc-intel-fix-module-autoloading.patch new file mode 100644 index 00000000000..4b788b90eea --- /dev/null +++ b/queue-5.15/asoc-intel-fix-module-autoloading.patch @@ -0,0 +1,35 @@ +From 2f3ec0aac4316e6e9abd968e1803829ea976ddb8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 26 Aug 2024 08:49:21 +0000 +Subject: ASoC: intel: fix module autoloading + +From: Liao Chen + +[ Upstream commit ae61a3391088d29aa8605c9f2db84295ab993a49 ] + +Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded +based on the alias from of_device_id table. + +Signed-off-by: Liao Chen +Link: https://patch.msgid.link/20240826084924.368387-2-liaochen4@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/intel/keembay/kmb_platform.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/intel/keembay/kmb_platform.c b/sound/soc/intel/keembay/kmb_platform.c +index a6fb74ba1c424..86a4c32686e73 100644 +--- a/sound/soc/intel/keembay/kmb_platform.c ++++ b/sound/soc/intel/keembay/kmb_platform.c +@@ -815,6 +815,7 @@ static const struct of_device_id kmb_plat_of_match[] = { + { .compatible = "intel,keembay-tdm", .data = &intel_kmb_tdm_dai}, + {} + }; ++MODULE_DEVICE_TABLE(of, kmb_plat_of_match); + + static int kmb_plat_dai_probe(struct platform_device *pdev) + { +-- +2.43.0 + diff --git a/queue-5.15/asoc-intel-fix-module-autoloading.patch-32698 b/queue-5.15/asoc-intel-fix-module-autoloading.patch-32698 new file mode 100644 index 00000000000..4b788b90eea --- /dev/null +++ b/queue-5.15/asoc-intel-fix-module-autoloading.patch-32698 @@ -0,0 +1,35 @@ +From 2f3ec0aac4316e6e9abd968e1803829ea976ddb8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 26 Aug 2024 08:49:21 +0000 +Subject: ASoC: intel: fix module autoloading + +From: Liao Chen + +[ Upstream commit ae61a3391088d29aa8605c9f2db84295ab993a49 ] + +Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded +based on the alias from of_device_id table. + +Signed-off-by: Liao Chen +Link: https://patch.msgid.link/20240826084924.368387-2-liaochen4@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/intel/keembay/kmb_platform.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/intel/keembay/kmb_platform.c b/sound/soc/intel/keembay/kmb_platform.c +index a6fb74ba1c424..86a4c32686e73 100644 +--- a/sound/soc/intel/keembay/kmb_platform.c ++++ b/sound/soc/intel/keembay/kmb_platform.c +@@ -815,6 +815,7 @@ static const struct of_device_id kmb_plat_of_match[] = { + { .compatible = "intel,keembay-tdm", .data = &intel_kmb_tdm_dai}, + {} + }; ++MODULE_DEVICE_TABLE(of, kmb_plat_of_match); + + static int kmb_plat_dai_probe(struct platform_device *pdev) + { +-- +2.43.0 + diff --git a/queue-5.15/asoc-tda7419-fix-module-autoloading.patch b/queue-5.15/asoc-tda7419-fix-module-autoloading.patch new file mode 100644 index 00000000000..2272ff4e2d3 --- /dev/null +++ b/queue-5.15/asoc-tda7419-fix-module-autoloading.patch @@ -0,0 +1,35 @@ +From 7aefc3aee145250b06c59728a2e419690480a364 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 26 Aug 2024 08:49:23 +0000 +Subject: ASoC: tda7419: fix module autoloading + +From: Liao Chen + +[ Upstream commit 934b44589da9aa300201a00fe139c5c54f421563 ] + +Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded +based on the alias from of_device_id table. + +Signed-off-by: Liao Chen +Link: https://patch.msgid.link/20240826084924.368387-4-liaochen4@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/tda7419.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/codecs/tda7419.c b/sound/soc/codecs/tda7419.c +index 83d220054c96f..9183db51547d3 100644 +--- a/sound/soc/codecs/tda7419.c ++++ b/sound/soc/codecs/tda7419.c +@@ -624,6 +624,7 @@ static const struct of_device_id tda7419_of_match[] = { + { .compatible = "st,tda7419" }, + { }, + }; ++MODULE_DEVICE_TABLE(of, tda7419_of_match); + + static struct i2c_driver tda7419_driver = { + .driver = { +-- +2.43.0 + diff --git a/queue-5.15/asoc-tda7419-fix-module-autoloading.patch-8698 b/queue-5.15/asoc-tda7419-fix-module-autoloading.patch-8698 new file mode 100644 index 00000000000..2272ff4e2d3 --- /dev/null +++ b/queue-5.15/asoc-tda7419-fix-module-autoloading.patch-8698 @@ -0,0 +1,35 @@ +From 7aefc3aee145250b06c59728a2e419690480a364 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 26 Aug 2024 08:49:23 +0000 +Subject: ASoC: tda7419: fix module autoloading + +From: Liao Chen + +[ Upstream commit 934b44589da9aa300201a00fe139c5c54f421563 ] + +Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded +based on the alias from of_device_id table. + +Signed-off-by: Liao Chen +Link: https://patch.msgid.link/20240826084924.368387-4-liaochen4@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/tda7419.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/codecs/tda7419.c b/sound/soc/codecs/tda7419.c +index 83d220054c96f..9183db51547d3 100644 +--- a/sound/soc/codecs/tda7419.c ++++ b/sound/soc/codecs/tda7419.c +@@ -624,6 +624,7 @@ static const struct of_device_id tda7419_of_match[] = { + { .compatible = "st,tda7419" }, + { }, + }; ++MODULE_DEVICE_TABLE(of, tda7419_of_match); + + static struct i2c_driver tda7419_driver = { + .driver = { +-- +2.43.0 + diff --git a/queue-5.15/drm-komeda-fix-an-issue-related-to-normalized-zpos.patch b/queue-5.15/drm-komeda-fix-an-issue-related-to-normalized-zpos.patch new file mode 100644 index 00000000000..7f6e528a84a --- /dev/null +++ b/queue-5.15/drm-komeda-fix-an-issue-related-to-normalized-zpos.patch @@ -0,0 +1,79 @@ +From 935644e841d438ef8308f05d0375f2906811d90f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 26 Aug 2024 10:45:17 +0800 +Subject: drm: komeda: Fix an issue related to normalized zpos + +From: hongchi.peng + +[ Upstream commit 258905cb9a6414be5c9ca4aa20ef855f8dc894d4 ] + +We use komeda_crtc_normalize_zpos to normalize zpos of affected planes +to their blending zorder in CU. If there's only one slave plane in +affected planes and its layer_split property is enabled, order++ for +its split layer, so that when calculating the normalized_zpos +of master planes, the split layer of the slave plane is included, but +the max_slave_zorder does not include the split layer and keep zero +because there's only one slave plane in affacted planes, although we +actually use two slave layers in this commit. + +In most cases, this bug does not result in a commit failure, but assume +the following situation: + slave_layer 0: zpos = 0, layer split enabled, normalized_zpos = + 0;(use slave_layer 2 as its split layer) + master_layer 0: zpos = 2, layer_split enabled, normalized_zpos = + 2;(use master_layer 2 as its split layer) + master_layer 1: zpos = 4, normalized_zpos = 4; + master_layer 3: zpos = 5, normalized_zpos = 5; + kcrtc_st->max_slave_zorder = 0; +When we use master_layer 3 as a input of CU in function +komeda_compiz_set_input and check it with function +komeda_component_check_input, the parameter idx is equal to +normailzed_zpos minus max_slave_zorder, the value of idx is 5 +and is euqal to CU's max_active_inputs, so that +komeda_component_check_input returns a -EINVAL value. + +To fix the bug described above, when calculating the max_slave_zorder +with the layer_split enabled, count the split layer in this calculation +directly. + +Signed-off-by: hongchi.peng +Acked-by: Liviu Dudau +Signed-off-by: Liviu Dudau +Link: https://patchwork.freedesktop.org/patch/msgid/20240826024517.3739-1-hongchi.peng@siengine.com +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c +index 327051bba5b68..cee7b8d58830c 100644 +--- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c ++++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c +@@ -163,6 +163,7 @@ static int komeda_crtc_normalize_zpos(struct drm_crtc *crtc, + struct drm_plane *plane; + struct list_head zorder_list; + int order = 0, err; ++ u32 slave_zpos = 0; + + DRM_DEBUG_ATOMIC("[CRTC:%d:%s] calculating normalized zpos values\n", + crtc->base.id, crtc->name); +@@ -202,10 +203,13 @@ static int komeda_crtc_normalize_zpos(struct drm_crtc *crtc, + plane_st->zpos, plane_st->normalized_zpos); + + /* calculate max slave zorder */ +- if (has_bit(drm_plane_index(plane), kcrtc->slave_planes)) ++ if (has_bit(drm_plane_index(plane), kcrtc->slave_planes)) { ++ slave_zpos = plane_st->normalized_zpos; ++ if (to_kplane_st(plane_st)->layer_split) ++ slave_zpos++; + kcrtc_st->max_slave_zorder = +- max(plane_st->normalized_zpos, +- kcrtc_st->max_slave_zorder); ++ max(slave_zpos, kcrtc_st->max_slave_zorder); ++ } + } + + crtc_st->zpos_changed = true; +-- +2.43.0 + diff --git a/queue-5.15/drm-komeda-fix-an-issue-related-to-normalized-zpos.patch-18123 b/queue-5.15/drm-komeda-fix-an-issue-related-to-normalized-zpos.patch-18123 new file mode 100644 index 00000000000..7f6e528a84a --- /dev/null +++ b/queue-5.15/drm-komeda-fix-an-issue-related-to-normalized-zpos.patch-18123 @@ -0,0 +1,79 @@ +From 935644e841d438ef8308f05d0375f2906811d90f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 26 Aug 2024 10:45:17 +0800 +Subject: drm: komeda: Fix an issue related to normalized zpos + +From: hongchi.peng + +[ Upstream commit 258905cb9a6414be5c9ca4aa20ef855f8dc894d4 ] + +We use komeda_crtc_normalize_zpos to normalize zpos of affected planes +to their blending zorder in CU. If there's only one slave plane in +affected planes and its layer_split property is enabled, order++ for +its split layer, so that when calculating the normalized_zpos +of master planes, the split layer of the slave plane is included, but +the max_slave_zorder does not include the split layer and keep zero +because there's only one slave plane in affacted planes, although we +actually use two slave layers in this commit. + +In most cases, this bug does not result in a commit failure, but assume +the following situation: + slave_layer 0: zpos = 0, layer split enabled, normalized_zpos = + 0;(use slave_layer 2 as its split layer) + master_layer 0: zpos = 2, layer_split enabled, normalized_zpos = + 2;(use master_layer 2 as its split layer) + master_layer 1: zpos = 4, normalized_zpos = 4; + master_layer 3: zpos = 5, normalized_zpos = 5; + kcrtc_st->max_slave_zorder = 0; +When we use master_layer 3 as a input of CU in function +komeda_compiz_set_input and check it with function +komeda_component_check_input, the parameter idx is equal to +normailzed_zpos minus max_slave_zorder, the value of idx is 5 +and is euqal to CU's max_active_inputs, so that +komeda_component_check_input returns a -EINVAL value. + +To fix the bug described above, when calculating the max_slave_zorder +with the layer_split enabled, count the split layer in this calculation +directly. + +Signed-off-by: hongchi.peng +Acked-by: Liviu Dudau +Signed-off-by: Liviu Dudau +Link: https://patchwork.freedesktop.org/patch/msgid/20240826024517.3739-1-hongchi.peng@siengine.com +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c +index 327051bba5b68..cee7b8d58830c 100644 +--- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c ++++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c +@@ -163,6 +163,7 @@ static int komeda_crtc_normalize_zpos(struct drm_crtc *crtc, + struct drm_plane *plane; + struct list_head zorder_list; + int order = 0, err; ++ u32 slave_zpos = 0; + + DRM_DEBUG_ATOMIC("[CRTC:%d:%s] calculating normalized zpos values\n", + crtc->base.id, crtc->name); +@@ -202,10 +203,13 @@ static int komeda_crtc_normalize_zpos(struct drm_crtc *crtc, + plane_st->zpos, plane_st->normalized_zpos); + + /* calculate max slave zorder */ +- if (has_bit(drm_plane_index(plane), kcrtc->slave_planes)) ++ if (has_bit(drm_plane_index(plane), kcrtc->slave_planes)) { ++ slave_zpos = plane_st->normalized_zpos; ++ if (to_kplane_st(plane_st)->layer_split) ++ slave_zpos++; + kcrtc_st->max_slave_zorder = +- max(plane_st->normalized_zpos, +- kcrtc_st->max_slave_zorder); ++ max(slave_zpos, kcrtc_st->max_slave_zorder); ++ } + } + + crtc_st->zpos_changed = true; +-- +2.43.0 + diff --git a/queue-5.15/microblaze-don-t-treat-zero-reserved-memory-regions-.patch b/queue-5.15/microblaze-don-t-treat-zero-reserved-memory-regions-.patch new file mode 100644 index 00000000000..b3da5710e12 --- /dev/null +++ b/queue-5.15/microblaze-don-t-treat-zero-reserved-memory-regions-.patch @@ -0,0 +1,51 @@ +From 407f5873629910bce1cacbbf6e1a9a07f39eb4f4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 29 Jul 2024 08:33:27 +0300 +Subject: microblaze: don't treat zero reserved memory regions as error + +From: Mike Rapoport + +[ Upstream commit 0075df288dd8a7abfe03b3766176c393063591dd ] + +Before commit 721f4a6526da ("mm/memblock: remove empty dummy entry") the +check for non-zero of memblock.reserved.cnt in mmu_init() would always +be true either because memblock.reserved.cnt is initialized to 1 or +because there were memory reservations earlier. + +The removal of dummy empty entry in memblock caused this check to fail +because now memblock.reserved.cnt is initialized to 0. + +Remove the check for non-zero of memblock.reserved.cnt because it's +perfectly fine to have an empty memblock.reserved array that early in +boot. + +Reported-by: Guenter Roeck +Signed-off-by: Mike Rapoport +Reviewed-by: Wei Yang +Tested-by: Guenter Roeck +Link: https://lore.kernel.org/r/20240729053327.4091459-1-rppt@kernel.org +Signed-off-by: Guenter Roeck +Signed-off-by: Sasha Levin +--- + arch/microblaze/mm/init.c | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c +index 952f35b335b26..71ad7ffc3eff3 100644 +--- a/arch/microblaze/mm/init.c ++++ b/arch/microblaze/mm/init.c +@@ -192,11 +192,6 @@ asmlinkage void __init mmu_init(void) + { + unsigned int kstart, ksize; + +- if (!memblock.reserved.cnt) { +- pr_emerg("Error memory count\n"); +- machine_restart(NULL); +- } +- + if ((u32) memblock.memory.regions[0].size < 0x400000) { + pr_emerg("Memory must be greater than 4MB\n"); + machine_restart(NULL); +-- +2.43.0 + diff --git a/queue-5.15/microblaze-don-t-treat-zero-reserved-memory-regions-.patch-7529 b/queue-5.15/microblaze-don-t-treat-zero-reserved-memory-regions-.patch-7529 new file mode 100644 index 00000000000..b3da5710e12 --- /dev/null +++ b/queue-5.15/microblaze-don-t-treat-zero-reserved-memory-regions-.patch-7529 @@ -0,0 +1,51 @@ +From 407f5873629910bce1cacbbf6e1a9a07f39eb4f4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 29 Jul 2024 08:33:27 +0300 +Subject: microblaze: don't treat zero reserved memory regions as error + +From: Mike Rapoport + +[ Upstream commit 0075df288dd8a7abfe03b3766176c393063591dd ] + +Before commit 721f4a6526da ("mm/memblock: remove empty dummy entry") the +check for non-zero of memblock.reserved.cnt in mmu_init() would always +be true either because memblock.reserved.cnt is initialized to 1 or +because there were memory reservations earlier. + +The removal of dummy empty entry in memblock caused this check to fail +because now memblock.reserved.cnt is initialized to 0. + +Remove the check for non-zero of memblock.reserved.cnt because it's +perfectly fine to have an empty memblock.reserved array that early in +boot. + +Reported-by: Guenter Roeck +Signed-off-by: Mike Rapoport +Reviewed-by: Wei Yang +Tested-by: Guenter Roeck +Link: https://lore.kernel.org/r/20240729053327.4091459-1-rppt@kernel.org +Signed-off-by: Guenter Roeck +Signed-off-by: Sasha Levin +--- + arch/microblaze/mm/init.c | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c +index 952f35b335b26..71ad7ffc3eff3 100644 +--- a/arch/microblaze/mm/init.c ++++ b/arch/microblaze/mm/init.c +@@ -192,11 +192,6 @@ asmlinkage void __init mmu_init(void) + { + unsigned int kstart, ksize; + +- if (!memblock.reserved.cnt) { +- pr_emerg("Error memory count\n"); +- machine_restart(NULL); +- } +- + if ((u32) memblock.memory.regions[0].size < 0x400000) { + pr_emerg("Memory must be greater than 4MB\n"); + machine_restart(NULL); +-- +2.43.0 + diff --git a/queue-5.15/net-ftgmac100-ensure-tx-descriptor-updates-are-visib.patch b/queue-5.15/net-ftgmac100-ensure-tx-descriptor-updates-are-visib.patch new file mode 100644 index 00000000000..be6907f49ac --- /dev/null +++ b/queue-5.15/net-ftgmac100-ensure-tx-descriptor-updates-are-visib.patch @@ -0,0 +1,109 @@ +From b09ccb4d92573511debce6112b4d9720c0f81710 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 22 Aug 2024 15:30:06 +0800 +Subject: net: ftgmac100: Ensure tx descriptor updates are visible + +From: Jacky Chou + +[ Upstream commit 4186c8d9e6af57bab0687b299df10ebd47534a0a ] + +The driver must ensure TX descriptor updates are visible +before updating TX pointer and TX clear pointer. + +This resolves TX hangs observed on AST2600 when running +iperf3. + +Signed-off-by: Jacky Chou +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/faraday/ftgmac100.c | 26 ++++++++++++++++-------- + 1 file changed, 18 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c +index 11f76e56d0316..9179014e90d11 100644 +--- a/drivers/net/ethernet/faraday/ftgmac100.c ++++ b/drivers/net/ethernet/faraday/ftgmac100.c +@@ -569,7 +569,7 @@ static bool ftgmac100_rx_packet(struct ftgmac100 *priv, int *processed) + (*processed)++; + return true; + +- drop: ++drop: + /* Clean rxdes0 (which resets own bit) */ + rxdes->rxdes0 = cpu_to_le32(status & priv->rxdes0_edorr_mask); + priv->rx_pointer = ftgmac100_next_rx_pointer(priv, pointer); +@@ -653,6 +653,11 @@ static bool ftgmac100_tx_complete_packet(struct ftgmac100 *priv) + ftgmac100_free_tx_packet(priv, pointer, skb, txdes, ctl_stat); + txdes->txdes0 = cpu_to_le32(ctl_stat & priv->txdes0_edotr_mask); + ++ /* Ensure the descriptor config is visible before setting the tx ++ * pointer. ++ */ ++ smp_wmb(); ++ + priv->tx_clean_pointer = ftgmac100_next_tx_pointer(priv, pointer); + + return true; +@@ -806,6 +811,11 @@ static netdev_tx_t ftgmac100_hard_start_xmit(struct sk_buff *skb, + dma_wmb(); + first->txdes0 = cpu_to_le32(f_ctl_stat); + ++ /* Ensure the descriptor config is visible before setting the tx ++ * pointer. ++ */ ++ smp_wmb(); ++ + /* Update next TX pointer */ + priv->tx_pointer = pointer; + +@@ -826,7 +836,7 @@ static netdev_tx_t ftgmac100_hard_start_xmit(struct sk_buff *skb, + + return NETDEV_TX_OK; + +- dma_err: ++dma_err: + if (net_ratelimit()) + netdev_err(netdev, "map tx fragment failed\n"); + +@@ -848,7 +858,7 @@ static netdev_tx_t ftgmac100_hard_start_xmit(struct sk_buff *skb, + * last fragment, so we know ftgmac100_free_tx_packet() + * hasn't freed the skb yet. + */ +- drop: ++drop: + /* Drop the packet */ + dev_kfree_skb_any(skb); + netdev->stats.tx_dropped++; +@@ -1448,7 +1458,7 @@ static void ftgmac100_reset_task(struct work_struct *work) + ftgmac100_init_all(priv, true); + + netdev_dbg(netdev, "Reset done !\n"); +- bail: ++bail: + if (priv->mii_bus) + mutex_unlock(&priv->mii_bus->mdio_lock); + if (netdev->phydev) +@@ -1519,15 +1529,15 @@ static int ftgmac100_open(struct net_device *netdev) + + return 0; + +- err_ncsi: ++err_ncsi: + napi_disable(&priv->napi); + netif_stop_queue(netdev); +- err_alloc: ++err_alloc: + ftgmac100_free_buffers(priv); + free_irq(netdev->irq, netdev); +- err_irq: ++err_irq: + netif_napi_del(&priv->napi); +- err_hw: ++err_hw: + iowrite32(0, priv->base + FTGMAC100_OFFSET_IER); + ftgmac100_free_rings(priv); + return err; +-- +2.43.0 + diff --git a/queue-5.15/net-ftgmac100-ensure-tx-descriptor-updates-are-visib.patch-10277 b/queue-5.15/net-ftgmac100-ensure-tx-descriptor-updates-are-visib.patch-10277 new file mode 100644 index 00000000000..be6907f49ac --- /dev/null +++ b/queue-5.15/net-ftgmac100-ensure-tx-descriptor-updates-are-visib.patch-10277 @@ -0,0 +1,109 @@ +From b09ccb4d92573511debce6112b4d9720c0f81710 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 22 Aug 2024 15:30:06 +0800 +Subject: net: ftgmac100: Ensure tx descriptor updates are visible + +From: Jacky Chou + +[ Upstream commit 4186c8d9e6af57bab0687b299df10ebd47534a0a ] + +The driver must ensure TX descriptor updates are visible +before updating TX pointer and TX clear pointer. + +This resolves TX hangs observed on AST2600 when running +iperf3. + +Signed-off-by: Jacky Chou +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/faraday/ftgmac100.c | 26 ++++++++++++++++-------- + 1 file changed, 18 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c +index 11f76e56d0316..9179014e90d11 100644 +--- a/drivers/net/ethernet/faraday/ftgmac100.c ++++ b/drivers/net/ethernet/faraday/ftgmac100.c +@@ -569,7 +569,7 @@ static bool ftgmac100_rx_packet(struct ftgmac100 *priv, int *processed) + (*processed)++; + return true; + +- drop: ++drop: + /* Clean rxdes0 (which resets own bit) */ + rxdes->rxdes0 = cpu_to_le32(status & priv->rxdes0_edorr_mask); + priv->rx_pointer = ftgmac100_next_rx_pointer(priv, pointer); +@@ -653,6 +653,11 @@ static bool ftgmac100_tx_complete_packet(struct ftgmac100 *priv) + ftgmac100_free_tx_packet(priv, pointer, skb, txdes, ctl_stat); + txdes->txdes0 = cpu_to_le32(ctl_stat & priv->txdes0_edotr_mask); + ++ /* Ensure the descriptor config is visible before setting the tx ++ * pointer. ++ */ ++ smp_wmb(); ++ + priv->tx_clean_pointer = ftgmac100_next_tx_pointer(priv, pointer); + + return true; +@@ -806,6 +811,11 @@ static netdev_tx_t ftgmac100_hard_start_xmit(struct sk_buff *skb, + dma_wmb(); + first->txdes0 = cpu_to_le32(f_ctl_stat); + ++ /* Ensure the descriptor config is visible before setting the tx ++ * pointer. ++ */ ++ smp_wmb(); ++ + /* Update next TX pointer */ + priv->tx_pointer = pointer; + +@@ -826,7 +836,7 @@ static netdev_tx_t ftgmac100_hard_start_xmit(struct sk_buff *skb, + + return NETDEV_TX_OK; + +- dma_err: ++dma_err: + if (net_ratelimit()) + netdev_err(netdev, "map tx fragment failed\n"); + +@@ -848,7 +858,7 @@ static netdev_tx_t ftgmac100_hard_start_xmit(struct sk_buff *skb, + * last fragment, so we know ftgmac100_free_tx_packet() + * hasn't freed the skb yet. + */ +- drop: ++drop: + /* Drop the packet */ + dev_kfree_skb_any(skb); + netdev->stats.tx_dropped++; +@@ -1448,7 +1458,7 @@ static void ftgmac100_reset_task(struct work_struct *work) + ftgmac100_init_all(priv, true); + + netdev_dbg(netdev, "Reset done !\n"); +- bail: ++bail: + if (priv->mii_bus) + mutex_unlock(&priv->mii_bus->mdio_lock); + if (netdev->phydev) +@@ -1519,15 +1529,15 @@ static int ftgmac100_open(struct net_device *netdev) + + return 0; + +- err_ncsi: ++err_ncsi: + napi_disable(&priv->napi); + netif_stop_queue(netdev); +- err_alloc: ++err_alloc: + ftgmac100_free_buffers(priv); + free_irq(netdev->irq, netdev); +- err_irq: ++err_irq: + netif_napi_del(&priv->napi); +- err_hw: ++err_hw: + iowrite32(0, priv->base + FTGMAC100_OFFSET_IER); + ftgmac100_free_rings(priv); + return err; +-- +2.43.0 + diff --git a/queue-5.15/ocfs2-add-bounds-checking-to-ocfs2_xattr_find_entry.patch b/queue-5.15/ocfs2-add-bounds-checking-to-ocfs2_xattr_find_entry.patch new file mode 100644 index 00000000000..a2dc73e4d44 --- /dev/null +++ b/queue-5.15/ocfs2-add-bounds-checking-to-ocfs2_xattr_find_entry.patch @@ -0,0 +1,85 @@ +From cc54cb294cbd7d62a902cb55876d5c7586a5191c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 20 May 2024 10:40:23 +0800 +Subject: ocfs2: add bounds checking to ocfs2_xattr_find_entry() + +From: Ferry Meng + +[ Upstream commit 9e3041fecdc8f78a5900c3aa51d3d756e73264d6 ] + +Add a paranoia check to make sure it doesn't stray beyond valid memory +region containing ocfs2 xattr entries when scanning for a match. It will +prevent out-of-bound access in case of crafted images. + +Link: https://lkml.kernel.org/r/20240520024024.1976129-1-joseph.qi@linux.alibaba.com +Signed-off-by: Ferry Meng +Signed-off-by: Joseph Qi +Reported-by: lei lu +Reviewed-by: Joseph Qi +Cc: Mark Fasheh +Cc: Joel Becker +Cc: Junxiao Bi +Cc: Changwei Ge +Cc: Gang He +Cc: Jun Piao +Signed-off-by: Andrew Morton +Stable-dep-of: af77c4fc1871 ("ocfs2: strict bound check before memcmp in ocfs2_xattr_find_entry()") +Signed-off-by: Sasha Levin +--- + fs/ocfs2/xattr.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c +index c101a71a52ae8..884e45d27564b 100644 +--- a/fs/ocfs2/xattr.c ++++ b/fs/ocfs2/xattr.c +@@ -1066,7 +1066,7 @@ ssize_t ocfs2_listxattr(struct dentry *dentry, + return i_ret + b_ret; + } + +-static int ocfs2_xattr_find_entry(int name_index, ++static int ocfs2_xattr_find_entry(struct inode *inode, int name_index, + const char *name, + struct ocfs2_xattr_search *xs) + { +@@ -1080,6 +1080,10 @@ static int ocfs2_xattr_find_entry(int name_index, + name_len = strlen(name); + entry = xs->here; + for (i = 0; i < le16_to_cpu(xs->header->xh_count); i++) { ++ if ((void *)entry >= xs->end) { ++ ocfs2_error(inode->i_sb, "corrupted xattr entries"); ++ return -EFSCORRUPTED; ++ } + cmp = name_index - ocfs2_xattr_get_type(entry); + if (!cmp) + cmp = name_len - entry->xe_name_len; +@@ -1170,7 +1174,7 @@ static int ocfs2_xattr_ibody_get(struct inode *inode, + xs->base = (void *)xs->header; + xs->here = xs->header->xh_entries; + +- ret = ocfs2_xattr_find_entry(name_index, name, xs); ++ ret = ocfs2_xattr_find_entry(inode, name_index, name, xs); + if (ret) + return ret; + size = le64_to_cpu(xs->here->xe_value_size); +@@ -2702,7 +2706,7 @@ static int ocfs2_xattr_ibody_find(struct inode *inode, + + /* Find the named attribute. */ + if (oi->ip_dyn_features & OCFS2_INLINE_XATTR_FL) { +- ret = ocfs2_xattr_find_entry(name_index, name, xs); ++ ret = ocfs2_xattr_find_entry(inode, name_index, name, xs); + if (ret && ret != -ENODATA) + return ret; + xs->not_found = ret; +@@ -2837,7 +2841,7 @@ static int ocfs2_xattr_block_find(struct inode *inode, + xs->end = (void *)(blk_bh->b_data) + blk_bh->b_size; + xs->here = xs->header->xh_entries; + +- ret = ocfs2_xattr_find_entry(name_index, name, xs); ++ ret = ocfs2_xattr_find_entry(inode, name_index, name, xs); + } else + ret = ocfs2_xattr_index_block_find(inode, blk_bh, + name_index, +-- +2.43.0 + diff --git a/queue-5.15/ocfs2-add-bounds-checking-to-ocfs2_xattr_find_entry.patch-32409 b/queue-5.15/ocfs2-add-bounds-checking-to-ocfs2_xattr_find_entry.patch-32409 new file mode 100644 index 00000000000..a2dc73e4d44 --- /dev/null +++ b/queue-5.15/ocfs2-add-bounds-checking-to-ocfs2_xattr_find_entry.patch-32409 @@ -0,0 +1,85 @@ +From cc54cb294cbd7d62a902cb55876d5c7586a5191c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 20 May 2024 10:40:23 +0800 +Subject: ocfs2: add bounds checking to ocfs2_xattr_find_entry() + +From: Ferry Meng + +[ Upstream commit 9e3041fecdc8f78a5900c3aa51d3d756e73264d6 ] + +Add a paranoia check to make sure it doesn't stray beyond valid memory +region containing ocfs2 xattr entries when scanning for a match. It will +prevent out-of-bound access in case of crafted images. + +Link: https://lkml.kernel.org/r/20240520024024.1976129-1-joseph.qi@linux.alibaba.com +Signed-off-by: Ferry Meng +Signed-off-by: Joseph Qi +Reported-by: lei lu +Reviewed-by: Joseph Qi +Cc: Mark Fasheh +Cc: Joel Becker +Cc: Junxiao Bi +Cc: Changwei Ge +Cc: Gang He +Cc: Jun Piao +Signed-off-by: Andrew Morton +Stable-dep-of: af77c4fc1871 ("ocfs2: strict bound check before memcmp in ocfs2_xattr_find_entry()") +Signed-off-by: Sasha Levin +--- + fs/ocfs2/xattr.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c +index c101a71a52ae8..884e45d27564b 100644 +--- a/fs/ocfs2/xattr.c ++++ b/fs/ocfs2/xattr.c +@@ -1066,7 +1066,7 @@ ssize_t ocfs2_listxattr(struct dentry *dentry, + return i_ret + b_ret; + } + +-static int ocfs2_xattr_find_entry(int name_index, ++static int ocfs2_xattr_find_entry(struct inode *inode, int name_index, + const char *name, + struct ocfs2_xattr_search *xs) + { +@@ -1080,6 +1080,10 @@ static int ocfs2_xattr_find_entry(int name_index, + name_len = strlen(name); + entry = xs->here; + for (i = 0; i < le16_to_cpu(xs->header->xh_count); i++) { ++ if ((void *)entry >= xs->end) { ++ ocfs2_error(inode->i_sb, "corrupted xattr entries"); ++ return -EFSCORRUPTED; ++ } + cmp = name_index - ocfs2_xattr_get_type(entry); + if (!cmp) + cmp = name_len - entry->xe_name_len; +@@ -1170,7 +1174,7 @@ static int ocfs2_xattr_ibody_get(struct inode *inode, + xs->base = (void *)xs->header; + xs->here = xs->header->xh_entries; + +- ret = ocfs2_xattr_find_entry(name_index, name, xs); ++ ret = ocfs2_xattr_find_entry(inode, name_index, name, xs); + if (ret) + return ret; + size = le64_to_cpu(xs->here->xe_value_size); +@@ -2702,7 +2706,7 @@ static int ocfs2_xattr_ibody_find(struct inode *inode, + + /* Find the named attribute. */ + if (oi->ip_dyn_features & OCFS2_INLINE_XATTR_FL) { +- ret = ocfs2_xattr_find_entry(name_index, name, xs); ++ ret = ocfs2_xattr_find_entry(inode, name_index, name, xs); + if (ret && ret != -ENODATA) + return ret; + xs->not_found = ret; +@@ -2837,7 +2841,7 @@ static int ocfs2_xattr_block_find(struct inode *inode, + xs->end = (void *)(blk_bh->b_data) + blk_bh->b_size; + xs->here = xs->header->xh_entries; + +- ret = ocfs2_xattr_find_entry(name_index, name, xs); ++ ret = ocfs2_xattr_find_entry(inode, name_index, name, xs); + } else + ret = ocfs2_xattr_index_block_find(inode, blk_bh, + name_index, +-- +2.43.0 + diff --git a/queue-5.15/ocfs2-strict-bound-check-before-memcmp-in-ocfs2_xatt.patch b/queue-5.15/ocfs2-strict-bound-check-before-memcmp-in-ocfs2_xatt.patch new file mode 100644 index 00000000000..9330ecd450a --- /dev/null +++ b/queue-5.15/ocfs2-strict-bound-check-before-memcmp-in-ocfs2_xatt.patch @@ -0,0 +1,67 @@ +From b7f5fb33c1a8082e27f435d865b8e97f155d90e8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 20 May 2024 10:40:24 +0800 +Subject: ocfs2: strict bound check before memcmp in ocfs2_xattr_find_entry() + +From: Ferry Meng + +[ Upstream commit af77c4fc1871847b528d58b7fdafb4aa1f6a9262 ] + +xattr in ocfs2 maybe 'non-indexed', which saved with additional space +requested. It's better to check if the memory is out of bound before +memcmp, although this possibility mainly comes from crafted poisonous +images. + +Link: https://lkml.kernel.org/r/20240520024024.1976129-2-joseph.qi@linux.alibaba.com +Signed-off-by: Ferry Meng +Signed-off-by: Joseph Qi +Reported-by: lei lu +Reviewed-by: Joseph Qi +Cc: Changwei Ge +Cc: Gang He +Cc: Joel Becker +Cc: Jun Piao +Cc: Junxiao Bi +Cc: Mark Fasheh +Signed-off-by: Andrew Morton +Signed-off-by: Sasha Levin +--- + fs/ocfs2/xattr.c | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c +index 884e45d27564b..ea1cbdff76622 100644 +--- a/fs/ocfs2/xattr.c ++++ b/fs/ocfs2/xattr.c +@@ -1072,7 +1072,7 @@ static int ocfs2_xattr_find_entry(struct inode *inode, int name_index, + { + struct ocfs2_xattr_entry *entry; + size_t name_len; +- int i, cmp = 1; ++ int i, name_offset, cmp = 1; + + if (name == NULL) + return -EINVAL; +@@ -1087,10 +1087,15 @@ static int ocfs2_xattr_find_entry(struct inode *inode, int name_index, + cmp = name_index - ocfs2_xattr_get_type(entry); + if (!cmp) + cmp = name_len - entry->xe_name_len; +- if (!cmp) +- cmp = memcmp(name, (xs->base + +- le16_to_cpu(entry->xe_name_offset)), +- name_len); ++ if (!cmp) { ++ name_offset = le16_to_cpu(entry->xe_name_offset); ++ if ((xs->base + name_offset + name_len) > xs->end) { ++ ocfs2_error(inode->i_sb, ++ "corrupted xattr entries"); ++ return -EFSCORRUPTED; ++ } ++ cmp = memcmp(name, (xs->base + name_offset), name_len); ++ } + if (cmp == 0) + break; + entry += 1; +-- +2.43.0 + diff --git a/queue-5.15/ocfs2-strict-bound-check-before-memcmp-in-ocfs2_xatt.patch-5953 b/queue-5.15/ocfs2-strict-bound-check-before-memcmp-in-ocfs2_xatt.patch-5953 new file mode 100644 index 00000000000..9330ecd450a --- /dev/null +++ b/queue-5.15/ocfs2-strict-bound-check-before-memcmp-in-ocfs2_xatt.patch-5953 @@ -0,0 +1,67 @@ +From b7f5fb33c1a8082e27f435d865b8e97f155d90e8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 20 May 2024 10:40:24 +0800 +Subject: ocfs2: strict bound check before memcmp in ocfs2_xattr_find_entry() + +From: Ferry Meng + +[ Upstream commit af77c4fc1871847b528d58b7fdafb4aa1f6a9262 ] + +xattr in ocfs2 maybe 'non-indexed', which saved with additional space +requested. It's better to check if the memory is out of bound before +memcmp, although this possibility mainly comes from crafted poisonous +images. + +Link: https://lkml.kernel.org/r/20240520024024.1976129-2-joseph.qi@linux.alibaba.com +Signed-off-by: Ferry Meng +Signed-off-by: Joseph Qi +Reported-by: lei lu +Reviewed-by: Joseph Qi +Cc: Changwei Ge +Cc: Gang He +Cc: Joel Becker +Cc: Jun Piao +Cc: Junxiao Bi +Cc: Mark Fasheh +Signed-off-by: Andrew Morton +Signed-off-by: Sasha Levin +--- + fs/ocfs2/xattr.c | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c +index 884e45d27564b..ea1cbdff76622 100644 +--- a/fs/ocfs2/xattr.c ++++ b/fs/ocfs2/xattr.c +@@ -1072,7 +1072,7 @@ static int ocfs2_xattr_find_entry(struct inode *inode, int name_index, + { + struct ocfs2_xattr_entry *entry; + size_t name_len; +- int i, cmp = 1; ++ int i, name_offset, cmp = 1; + + if (name == NULL) + return -EINVAL; +@@ -1087,10 +1087,15 @@ static int ocfs2_xattr_find_entry(struct inode *inode, int name_index, + cmp = name_index - ocfs2_xattr_get_type(entry); + if (!cmp) + cmp = name_len - entry->xe_name_len; +- if (!cmp) +- cmp = memcmp(name, (xs->base + +- le16_to_cpu(entry->xe_name_offset)), +- name_len); ++ if (!cmp) { ++ name_offset = le16_to_cpu(entry->xe_name_offset); ++ if ((xs->base + name_offset + name_len) > xs->end) { ++ ocfs2_error(inode->i_sb, ++ "corrupted xattr entries"); ++ return -EFSCORRUPTED; ++ } ++ cmp = memcmp(name, (xs->base + name_offset), name_len); ++ } + if (cmp == 0) + break; + entry += 1; +-- +2.43.0 + diff --git a/queue-5.15/pinctrl-at91-make-it-work-with-current-gpiolib.patch b/queue-5.15/pinctrl-at91-make-it-work-with-current-gpiolib.patch new file mode 100644 index 00000000000..8edb2e18037 --- /dev/null +++ b/queue-5.15/pinctrl-at91-make-it-work-with-current-gpiolib.patch @@ -0,0 +1,51 @@ +From 884e55febfc0c27300bd2c354b5c72a22b6e2f5b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jul 2024 01:16:26 +0200 +Subject: pinctrl: at91: make it work with current gpiolib + +From: Thomas Blocher + +[ Upstream commit 752f387faaae0ae2e84d3f496922524785e77d60 ] + +pinctrl-at91 currently does not support the gpio-groups devicetree +property and has no pin-range. +Because of this at91 gpios stopped working since patch +commit 2ab73c6d8323fa1e ("gpio: Support GPIO controllers without pin-ranges") +This was discussed in the patches +commit fc328a7d1fcce263 ("gpio: Revert regression in sysfs-gpio (gpiolib.c)") +commit 56e337f2cf132632 ("Revert "gpio: Revert regression in sysfs-gpio (gpiolib.c)"") + +As a workaround manually set pin-range via gpiochip_add_pin_range() until +a) pinctrl-at91 is reworked to support devicetree gpio-groups +b) another solution as mentioned in +commit 56e337f2cf132632 ("Revert "gpio: Revert regression in sysfs-gpio (gpiolib.c)"") +is found + +Signed-off-by: Thomas Blocher +Link: https://lore.kernel.org/5b992862-355d-f0de-cd3d-ff99e67a4ff1@ek-dev.de +Signed-off-by: Linus Walleij +Signed-off-by: Sasha Levin +--- + drivers/pinctrl/pinctrl-at91.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c +index 3b0341c730ee0..9c92838428b8f 100644 +--- a/drivers/pinctrl/pinctrl-at91.c ++++ b/drivers/pinctrl/pinctrl-at91.c +@@ -1403,8 +1403,11 @@ static int at91_pinctrl_probe(struct platform_device *pdev) + + /* We will handle a range of GPIO pins */ + for (i = 0; i < gpio_banks; i++) +- if (gpio_chips[i]) ++ if (gpio_chips[i]) { + pinctrl_add_gpio_range(info->pctl, &gpio_chips[i]->range); ++ gpiochip_add_pin_range(&gpio_chips[i]->chip, dev_name(info->pctl->dev), 0, ++ gpio_chips[i]->range.pin_base, gpio_chips[i]->range.npins); ++ } + + dev_info(&pdev->dev, "initialized AT91 pinctrl driver\n"); + +-- +2.43.0 + diff --git a/queue-5.15/pinctrl-at91-make-it-work-with-current-gpiolib.patch-16699 b/queue-5.15/pinctrl-at91-make-it-work-with-current-gpiolib.patch-16699 new file mode 100644 index 00000000000..8edb2e18037 --- /dev/null +++ b/queue-5.15/pinctrl-at91-make-it-work-with-current-gpiolib.patch-16699 @@ -0,0 +1,51 @@ +From 884e55febfc0c27300bd2c354b5c72a22b6e2f5b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jul 2024 01:16:26 +0200 +Subject: pinctrl: at91: make it work with current gpiolib + +From: Thomas Blocher + +[ Upstream commit 752f387faaae0ae2e84d3f496922524785e77d60 ] + +pinctrl-at91 currently does not support the gpio-groups devicetree +property and has no pin-range. +Because of this at91 gpios stopped working since patch +commit 2ab73c6d8323fa1e ("gpio: Support GPIO controllers without pin-ranges") +This was discussed in the patches +commit fc328a7d1fcce263 ("gpio: Revert regression in sysfs-gpio (gpiolib.c)") +commit 56e337f2cf132632 ("Revert "gpio: Revert regression in sysfs-gpio (gpiolib.c)"") + +As a workaround manually set pin-range via gpiochip_add_pin_range() until +a) pinctrl-at91 is reworked to support devicetree gpio-groups +b) another solution as mentioned in +commit 56e337f2cf132632 ("Revert "gpio: Revert regression in sysfs-gpio (gpiolib.c)"") +is found + +Signed-off-by: Thomas Blocher +Link: https://lore.kernel.org/5b992862-355d-f0de-cd3d-ff99e67a4ff1@ek-dev.de +Signed-off-by: Linus Walleij +Signed-off-by: Sasha Levin +--- + drivers/pinctrl/pinctrl-at91.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c +index 3b0341c730ee0..9c92838428b8f 100644 +--- a/drivers/pinctrl/pinctrl-at91.c ++++ b/drivers/pinctrl/pinctrl-at91.c +@@ -1403,8 +1403,11 @@ static int at91_pinctrl_probe(struct platform_device *pdev) + + /* We will handle a range of GPIO pins */ + for (i = 0; i < gpio_banks; i++) +- if (gpio_chips[i]) ++ if (gpio_chips[i]) { + pinctrl_add_gpio_range(info->pctl, &gpio_chips[i]->range); ++ gpiochip_add_pin_range(&gpio_chips[i]->chip, dev_name(info->pctl->dev), 0, ++ gpio_chips[i]->range.pin_base, gpio_chips[i]->range.npins); ++ } + + dev_info(&pdev->dev, "initialized AT91 pinctrl driver\n"); + +-- +2.43.0 + diff --git a/queue-5.15/scsi-lpfc-fix-overflow-build-issue.patch b/queue-5.15/scsi-lpfc-fix-overflow-build-issue.patch new file mode 100644 index 00000000000..c9797bf6a0b --- /dev/null +++ b/queue-5.15/scsi-lpfc-fix-overflow-build-issue.patch @@ -0,0 +1,54 @@ +From 7e544bdaab2811643563aec1dbba5cb1ed7b937f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 20 Aug 2024 23:51:31 -0700 +Subject: scsi: lpfc: Fix overflow build issue + +From: Sherry Yang + +[ Upstream commit 3417c9574e368f0330637505f00d3814ca8854d2 ] + +Build failed while enabling "CONFIG_GCOV_KERNEL=y" and +"CONFIG_GCOV_PROFILE_ALL=y" with following error: + +BUILDSTDERR: drivers/scsi/lpfc/lpfc_bsg.c: In function 'lpfc_get_cgnbuf_info': +BUILDSTDERR: ./include/linux/fortify-string.h:114:33: error: '__builtin_memcpy' accessing 18446744073709551615 bytes at offsets 0 and 0 overlaps 9223372036854775807 bytes at offset -9223372036854775808 [-Werror=restrict] +BUILDSTDERR: 114 | #define __underlying_memcpy __builtin_memcpy +BUILDSTDERR: | ^ +BUILDSTDERR: ./include/linux/fortify-string.h:637:9: note: in expansion of macro '__underlying_memcpy' +BUILDSTDERR: 637 | __underlying_##op(p, q, __fortify_size); \ +BUILDSTDERR: | ^~~~~~~~~~~~~ +BUILDSTDERR: ./include/linux/fortify-string.h:682:26: note: in expansion of macro '__fortify_memcpy_chk' +BUILDSTDERR: 682 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ +BUILDSTDERR: | ^~~~~~~~~~~~~~~~~~~~ +BUILDSTDERR: drivers/scsi/lpfc/lpfc_bsg.c:5468:9: note: in expansion of macro 'memcpy' +BUILDSTDERR: 5468 | memcpy(cgn_buff, cp, cinfosz); +BUILDSTDERR: | ^~~~~~ + +This happens from the commit 06bb7fc0feee ("kbuild: turn on -Wrestrict by +default"). Address this issue by using size_t type. + +Signed-off-by: Sherry Yang +Link: https://lore.kernel.org/r/20240821065131.1180791-1-sherry.yang@oracle.com +Reviewed-by: Justin Tee +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/lpfc/lpfc_bsg.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c +index ed827f198cb68..45c59006945b9 100644 +--- a/drivers/scsi/lpfc/lpfc_bsg.c ++++ b/drivers/scsi/lpfc/lpfc_bsg.c +@@ -5761,7 +5761,7 @@ lpfc_get_cgnbuf_info(struct bsg_job *job) + struct get_cgnbuf_info_req *cgnbuf_req; + struct lpfc_cgn_info *cp; + uint8_t *cgn_buff; +- int size, cinfosz; ++ size_t size, cinfosz; + int rc = 0; + + if (job->request_len < sizeof(struct fc_bsg_request) + +-- +2.43.0 + diff --git a/queue-5.15/scsi-lpfc-fix-overflow-build-issue.patch-31175 b/queue-5.15/scsi-lpfc-fix-overflow-build-issue.patch-31175 new file mode 100644 index 00000000000..c9797bf6a0b --- /dev/null +++ b/queue-5.15/scsi-lpfc-fix-overflow-build-issue.patch-31175 @@ -0,0 +1,54 @@ +From 7e544bdaab2811643563aec1dbba5cb1ed7b937f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 20 Aug 2024 23:51:31 -0700 +Subject: scsi: lpfc: Fix overflow build issue + +From: Sherry Yang + +[ Upstream commit 3417c9574e368f0330637505f00d3814ca8854d2 ] + +Build failed while enabling "CONFIG_GCOV_KERNEL=y" and +"CONFIG_GCOV_PROFILE_ALL=y" with following error: + +BUILDSTDERR: drivers/scsi/lpfc/lpfc_bsg.c: In function 'lpfc_get_cgnbuf_info': +BUILDSTDERR: ./include/linux/fortify-string.h:114:33: error: '__builtin_memcpy' accessing 18446744073709551615 bytes at offsets 0 and 0 overlaps 9223372036854775807 bytes at offset -9223372036854775808 [-Werror=restrict] +BUILDSTDERR: 114 | #define __underlying_memcpy __builtin_memcpy +BUILDSTDERR: | ^ +BUILDSTDERR: ./include/linux/fortify-string.h:637:9: note: in expansion of macro '__underlying_memcpy' +BUILDSTDERR: 637 | __underlying_##op(p, q, __fortify_size); \ +BUILDSTDERR: | ^~~~~~~~~~~~~ +BUILDSTDERR: ./include/linux/fortify-string.h:682:26: note: in expansion of macro '__fortify_memcpy_chk' +BUILDSTDERR: 682 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ +BUILDSTDERR: | ^~~~~~~~~~~~~~~~~~~~ +BUILDSTDERR: drivers/scsi/lpfc/lpfc_bsg.c:5468:9: note: in expansion of macro 'memcpy' +BUILDSTDERR: 5468 | memcpy(cgn_buff, cp, cinfosz); +BUILDSTDERR: | ^~~~~~ + +This happens from the commit 06bb7fc0feee ("kbuild: turn on -Wrestrict by +default"). Address this issue by using size_t type. + +Signed-off-by: Sherry Yang +Link: https://lore.kernel.org/r/20240821065131.1180791-1-sherry.yang@oracle.com +Reviewed-by: Justin Tee +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/lpfc/lpfc_bsg.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c +index ed827f198cb68..45c59006945b9 100644 +--- a/drivers/scsi/lpfc/lpfc_bsg.c ++++ b/drivers/scsi/lpfc/lpfc_bsg.c +@@ -5761,7 +5761,7 @@ lpfc_get_cgnbuf_info(struct bsg_job *job) + struct get_cgnbuf_info_req *cgnbuf_req; + struct lpfc_cgn_info *cp; + uint8_t *cgn_buff; +- int size, cinfosz; ++ size_t size, cinfosz; + int rc = 0; + + if (job->request_len < sizeof(struct fc_bsg_request) + +-- +2.43.0 + diff --git a/queue-5.15/series b/queue-5.15/series index b777983bcd5..209bd01fbcd 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -42,3 +42,45 @@ spi-nxp-fspi-fix-the-kasan-report-out-of-bounds-bug.patch soundwire-stream-revert-soundwire-stream-fix-programming-slave-ports-for-non-continous-port-maps.patch dma-buf-heaps-fix-off-by-one-in-cma-heap-fault-handler.patch asoc-meson-axg-card-fix-use-after-free.patch +asoc-allow-module-autoloading-for-table-db1200_pids.patch +alsa-hda-realtek-fixed-alc256-headphone-no-sound.patch +alsa-hda-realtek-fixed-alc285-headphone-no-sound.patch +scsi-lpfc-fix-overflow-build-issue.patch +pinctrl-at91-make-it-work-with-current-gpiolib.patch +microblaze-don-t-treat-zero-reserved-memory-regions-.patch +net-ftgmac100-ensure-tx-descriptor-updates-are-visib.patch +wifi-iwlwifi-lower-message-level-for-fw-buffer-desti.patch +wifi-iwlwifi-mvm-fix-iwl_mvm_scan_fits-calculation.patch +wifi-iwlwifi-mvm-pause-tcm-when-the-firmware-is-stop.patch +wifi-iwlwifi-mvm-don-t-wait-for-tx-queues-if-firmwar.patch +wifi-iwlwifi-clear-trans-state-earlier-upon-error.patch +asoc-intel-fix-module-autoloading.patch +asoc-tda7419-fix-module-autoloading.patch +spi-spidev-add-an-entry-for-elgin-jg10309-01.patch +drm-komeda-fix-an-issue-related-to-normalized-zpos.patch +spi-bcm63xx-enable-module-autoloading.patch +x86-hyperv-set-x86_feature_tsc_known_freq-when-hyper.patch +spi-spidev-add-missing-spi_device_id-for-jg10309-01.patch +ocfs2-add-bounds-checking-to-ocfs2_xattr_find_entry.patch +ocfs2-strict-bound-check-before-memcmp-in-ocfs2_xatt.patch +asoc-allow-module-autoloading-for-table-db1200_pids.patch-15912 +alsa-hda-realtek-fixed-alc256-headphone-no-sound.patch-10398 +alsa-hda-realtek-fixed-alc285-headphone-no-sound.patch-13701 +scsi-lpfc-fix-overflow-build-issue.patch-31175 +pinctrl-at91-make-it-work-with-current-gpiolib.patch-16699 +microblaze-don-t-treat-zero-reserved-memory-regions-.patch-7529 +net-ftgmac100-ensure-tx-descriptor-updates-are-visib.patch-10277 +wifi-iwlwifi-lower-message-level-for-fw-buffer-desti.patch-1448 +wifi-iwlwifi-mvm-fix-iwl_mvm_scan_fits-calculation.patch-20772 +wifi-iwlwifi-mvm-pause-tcm-when-the-firmware-is-stop.patch-18801 +wifi-iwlwifi-mvm-don-t-wait-for-tx-queues-if-firmwar.patch-15491 +wifi-iwlwifi-clear-trans-state-earlier-upon-error.patch-29543 +asoc-intel-fix-module-autoloading.patch-32698 +asoc-tda7419-fix-module-autoloading.patch-8698 +spi-spidev-add-an-entry-for-elgin-jg10309-01.patch-48 +drm-komeda-fix-an-issue-related-to-normalized-zpos.patch-18123 +spi-bcm63xx-enable-module-autoloading.patch-13541 +x86-hyperv-set-x86_feature_tsc_known_freq-when-hyper.patch-27755 +spi-spidev-add-missing-spi_device_id-for-jg10309-01.patch-32506 +ocfs2-add-bounds-checking-to-ocfs2_xattr_find_entry.patch-32409 +ocfs2-strict-bound-check-before-memcmp-in-ocfs2_xatt.patch-5953 diff --git a/queue-5.15/spi-bcm63xx-enable-module-autoloading.patch b/queue-5.15/spi-bcm63xx-enable-module-autoloading.patch new file mode 100644 index 00000000000..ad105fe1e52 --- /dev/null +++ b/queue-5.15/spi-bcm63xx-enable-module-autoloading.patch @@ -0,0 +1,35 @@ +From 1e167dd861724fdd04a6ee58d38940c2ffec7456 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 31 Aug 2024 09:42:31 +0000 +Subject: spi: bcm63xx: Enable module autoloading + +From: Liao Chen + +[ Upstream commit 709df70a20e990d262c473ad9899314039e8ec82 ] + +Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based +on the alias from of_device_id table. + +Signed-off-by: Liao Chen +Link: https://patch.msgid.link/20240831094231.795024-1-liaochen4@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/spi/spi-bcm63xx.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c +index 147199002df1e..a9921dcd6b797 100644 +--- a/drivers/spi/spi-bcm63xx.c ++++ b/drivers/spi/spi-bcm63xx.c +@@ -482,6 +482,7 @@ static const struct of_device_id bcm63xx_spi_of_match[] = { + { .compatible = "brcm,bcm6358-spi", .data = &bcm6358_spi_reg_offsets }, + { }, + }; ++MODULE_DEVICE_TABLE(of, bcm63xx_spi_of_match); + + static int bcm63xx_spi_probe(struct platform_device *pdev) + { +-- +2.43.0 + diff --git a/queue-5.15/spi-bcm63xx-enable-module-autoloading.patch-13541 b/queue-5.15/spi-bcm63xx-enable-module-autoloading.patch-13541 new file mode 100644 index 00000000000..ad105fe1e52 --- /dev/null +++ b/queue-5.15/spi-bcm63xx-enable-module-autoloading.patch-13541 @@ -0,0 +1,35 @@ +From 1e167dd861724fdd04a6ee58d38940c2ffec7456 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 31 Aug 2024 09:42:31 +0000 +Subject: spi: bcm63xx: Enable module autoloading + +From: Liao Chen + +[ Upstream commit 709df70a20e990d262c473ad9899314039e8ec82 ] + +Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based +on the alias from of_device_id table. + +Signed-off-by: Liao Chen +Link: https://patch.msgid.link/20240831094231.795024-1-liaochen4@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/spi/spi-bcm63xx.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c +index 147199002df1e..a9921dcd6b797 100644 +--- a/drivers/spi/spi-bcm63xx.c ++++ b/drivers/spi/spi-bcm63xx.c +@@ -482,6 +482,7 @@ static const struct of_device_id bcm63xx_spi_of_match[] = { + { .compatible = "brcm,bcm6358-spi", .data = &bcm6358_spi_reg_offsets }, + { }, + }; ++MODULE_DEVICE_TABLE(of, bcm63xx_spi_of_match); + + static int bcm63xx_spi_probe(struct platform_device *pdev) + { +-- +2.43.0 + diff --git a/queue-5.15/spi-spidev-add-an-entry-for-elgin-jg10309-01.patch b/queue-5.15/spi-spidev-add-an-entry-for-elgin-jg10309-01.patch new file mode 100644 index 00000000000..9fd54c0d91f --- /dev/null +++ b/queue-5.15/spi-spidev-add-an-entry-for-elgin-jg10309-01.patch @@ -0,0 +1,38 @@ +From 8b99de466b2ff82bd771850a1f41a6421f8024a5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 28 Aug 2024 15:00:56 -0300 +Subject: spi: spidev: Add an entry for elgin,jg10309-01 + +From: Fabio Estevam + +[ Upstream commit 5f3eee1eef5d0edd23d8ac0974f56283649a1512 ] + +The rv1108-elgin-r1 board has an LCD controlled via SPI in userspace. +The marking on the LCD is JG10309-01. + +Add the "elgin,jg10309-01" compatible string. + +Signed-off-by: Fabio Estevam +Reviewed-by: Heiko Stuebner +Link: https://patch.msgid.link/20240828180057.3167190-2-festevam@gmail.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/spi/spidev.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c +index 0b97e5b97a018..8570cd35b7e50 100644 +--- a/drivers/spi/spidev.c ++++ b/drivers/spi/spidev.c +@@ -712,6 +712,7 @@ static int spidev_of_check(struct device *dev) + static const struct of_device_id spidev_dt_ids[] = { + { .compatible = "cisco,spi-petra", .data = &spidev_of_check }, + { .compatible = "dh,dhcom-board", .data = &spidev_of_check }, ++ { .compatible = "elgin,jg10309-01", .data = &spidev_of_check }, + { .compatible = "lineartechnology,ltc2488", .data = &spidev_of_check }, + { .compatible = "lwn,bk4", .data = &spidev_of_check }, + { .compatible = "menlo,m53cpld", .data = &spidev_of_check }, +-- +2.43.0 + diff --git a/queue-5.15/spi-spidev-add-an-entry-for-elgin-jg10309-01.patch-48 b/queue-5.15/spi-spidev-add-an-entry-for-elgin-jg10309-01.patch-48 new file mode 100644 index 00000000000..9fd54c0d91f --- /dev/null +++ b/queue-5.15/spi-spidev-add-an-entry-for-elgin-jg10309-01.patch-48 @@ -0,0 +1,38 @@ +From 8b99de466b2ff82bd771850a1f41a6421f8024a5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 28 Aug 2024 15:00:56 -0300 +Subject: spi: spidev: Add an entry for elgin,jg10309-01 + +From: Fabio Estevam + +[ Upstream commit 5f3eee1eef5d0edd23d8ac0974f56283649a1512 ] + +The rv1108-elgin-r1 board has an LCD controlled via SPI in userspace. +The marking on the LCD is JG10309-01. + +Add the "elgin,jg10309-01" compatible string. + +Signed-off-by: Fabio Estevam +Reviewed-by: Heiko Stuebner +Link: https://patch.msgid.link/20240828180057.3167190-2-festevam@gmail.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/spi/spidev.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c +index 0b97e5b97a018..8570cd35b7e50 100644 +--- a/drivers/spi/spidev.c ++++ b/drivers/spi/spidev.c +@@ -712,6 +712,7 @@ static int spidev_of_check(struct device *dev) + static const struct of_device_id spidev_dt_ids[] = { + { .compatible = "cisco,spi-petra", .data = &spidev_of_check }, + { .compatible = "dh,dhcom-board", .data = &spidev_of_check }, ++ { .compatible = "elgin,jg10309-01", .data = &spidev_of_check }, + { .compatible = "lineartechnology,ltc2488", .data = &spidev_of_check }, + { .compatible = "lwn,bk4", .data = &spidev_of_check }, + { .compatible = "menlo,m53cpld", .data = &spidev_of_check }, +-- +2.43.0 + diff --git a/queue-5.15/spi-spidev-add-missing-spi_device_id-for-jg10309-01.patch b/queue-5.15/spi-spidev-add-missing-spi_device_id-for-jg10309-01.patch new file mode 100644 index 00000000000..69482ab791a --- /dev/null +++ b/queue-5.15/spi-spidev-add-missing-spi_device_id-for-jg10309-01.patch @@ -0,0 +1,42 @@ +From 95a4b9d6bab70535c14f298387e5544e11e7aa94 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 3 Sep 2024 14:32:27 +0200 +Subject: spi: spidev: Add missing spi_device_id for jg10309-01 + +From: Geert Uytterhoeven + +[ Upstream commit 5478a4f7b94414def7b56d2f18bc2ed9b0f3f1f2 ] + +When the of_device_id entry for "elgin,jg10309-01" was added, the +corresponding spi_device_id was forgotten, causing a warning message +during boot-up: + + SPI driver spidev has no spi_device_id for elgin,jg10309-01 + +Fix module autoloading and shut up the warning by adding the missing +entry. + +Fixes: 5f3eee1eef5d0edd ("spi: spidev: Add an entry for elgin,jg10309-01") +Signed-off-by: Geert Uytterhoeven +Link: https://patch.msgid.link/54bbb9d8a8db7e52d13e266f2d4a9bcd8b42a98a.1725366625.git.geert+renesas@glider.be +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/spi/spidev.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c +index 8570cd35b7e50..2ea29fb819410 100644 +--- a/drivers/spi/spidev.c ++++ b/drivers/spi/spidev.c +@@ -684,6 +684,7 @@ static struct class *spidev_class; + static const struct spi_device_id spidev_spi_ids[] = { + { .name = "bh2228fv" }, + { .name = "dh2228fv" }, ++ { .name = "jg10309-01" }, + { .name = "ltc2488" }, + { .name = "sx1301" }, + { .name = "bk4" }, +-- +2.43.0 + diff --git a/queue-5.15/spi-spidev-add-missing-spi_device_id-for-jg10309-01.patch-32506 b/queue-5.15/spi-spidev-add-missing-spi_device_id-for-jg10309-01.patch-32506 new file mode 100644 index 00000000000..69482ab791a --- /dev/null +++ b/queue-5.15/spi-spidev-add-missing-spi_device_id-for-jg10309-01.patch-32506 @@ -0,0 +1,42 @@ +From 95a4b9d6bab70535c14f298387e5544e11e7aa94 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 3 Sep 2024 14:32:27 +0200 +Subject: spi: spidev: Add missing spi_device_id for jg10309-01 + +From: Geert Uytterhoeven + +[ Upstream commit 5478a4f7b94414def7b56d2f18bc2ed9b0f3f1f2 ] + +When the of_device_id entry for "elgin,jg10309-01" was added, the +corresponding spi_device_id was forgotten, causing a warning message +during boot-up: + + SPI driver spidev has no spi_device_id for elgin,jg10309-01 + +Fix module autoloading and shut up the warning by adding the missing +entry. + +Fixes: 5f3eee1eef5d0edd ("spi: spidev: Add an entry for elgin,jg10309-01") +Signed-off-by: Geert Uytterhoeven +Link: https://patch.msgid.link/54bbb9d8a8db7e52d13e266f2d4a9bcd8b42a98a.1725366625.git.geert+renesas@glider.be +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/spi/spidev.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c +index 8570cd35b7e50..2ea29fb819410 100644 +--- a/drivers/spi/spidev.c ++++ b/drivers/spi/spidev.c +@@ -684,6 +684,7 @@ static struct class *spidev_class; + static const struct spi_device_id spidev_spi_ids[] = { + { .name = "bh2228fv" }, + { .name = "dh2228fv" }, ++ { .name = "jg10309-01" }, + { .name = "ltc2488" }, + { .name = "sx1301" }, + { .name = "bk4" }, +-- +2.43.0 + diff --git a/queue-5.15/wifi-iwlwifi-clear-trans-state-earlier-upon-error.patch b/queue-5.15/wifi-iwlwifi-clear-trans-state-earlier-upon-error.patch new file mode 100644 index 00000000000..98b0479acf3 --- /dev/null +++ b/queue-5.15/wifi-iwlwifi-clear-trans-state-earlier-upon-error.patch @@ -0,0 +1,72 @@ +From ae0409853c28b2c804c175e2197552069d038ec3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 25 Aug 2024 19:17:01 +0300 +Subject: wifi: iwlwifi: clear trans->state earlier upon error + +From: Emmanuel Grumbach + +[ Upstream commit 094513f8a2fbddee51b055d8035f995551f98fce ] + +When the firmware crashes, we first told the op_mode and only then, +changed the transport's state. This is a problem if the op_mode's +nic_error() handler needs to send a host command: it'll see that the +transport's state still reflects that the firmware is alive. + +Today, this has no consequences since we set the STATUS_FW_ERROR bit and +that will prevent sending host commands. iwl_fw_dbg_stop_restart_recording +looks at this bit to know not to send a host command for example. + +To fix the hibernation, we needed to reset the firmware without having +an error and checking STATUS_FW_ERROR to see whether the firmware is +alive will no longer hold, so this change is necessary as well. + +Change the flow a bit. +Change trans->state before calling the op_mode's nic_error() method and +check trans->state instead of STATUS_FW_ERROR. This will keep the +current behavior of iwl_fw_dbg_stop_restart_recording upon firmware +error, and it'll allow us to call iwl_fw_dbg_stop_restart_recording +safely even if STATUS_FW_ERROR is clear, but yet, the firmware is not +alive. + +Signed-off-by: Emmanuel Grumbach +Signed-off-by: Miri Korenblit +Link: https://patch.msgid.link/20240825191257.9d7427fbdfd7.Ia056ca57029a382c921d6f7b6a6b28fc480f2f22@changeid +[I missed this was a dependency for the hibernation fix, changed + the commit message a bit accordingly] +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 2 +- + drivers/net/wireless/intel/iwlwifi/iwl-trans.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +index f34a02b33ccd4..fc630a0d9c83c 100644 +--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c ++++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +@@ -2862,7 +2862,7 @@ void iwl_fw_dbg_stop_restart_recording(struct iwl_fw_runtime *fwrt, + { + int ret __maybe_unused = 0; + +- if (test_bit(STATUS_FW_ERROR, &fwrt->trans->status)) ++ if (!iwl_trans_fw_running(fwrt->trans)) + return; + + if (fw_has_capa(&fwrt->fw->ucode_capa, +diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h +index a2919a32d7081..d2b31599340fc 100644 +--- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h ++++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h +@@ -1393,8 +1393,8 @@ static inline void iwl_trans_fw_error(struct iwl_trans *trans, bool sync) + + /* prevent double restarts due to the same erroneous FW */ + if (!test_and_set_bit(STATUS_FW_ERROR, &trans->status)) { +- iwl_op_mode_nic_error(trans->op_mode, sync); + trans->state = IWL_TRANS_NO_FW; ++ iwl_op_mode_nic_error(trans->op_mode, sync); + } + } + +-- +2.43.0 + diff --git a/queue-5.15/wifi-iwlwifi-clear-trans-state-earlier-upon-error.patch-29543 b/queue-5.15/wifi-iwlwifi-clear-trans-state-earlier-upon-error.patch-29543 new file mode 100644 index 00000000000..98b0479acf3 --- /dev/null +++ b/queue-5.15/wifi-iwlwifi-clear-trans-state-earlier-upon-error.patch-29543 @@ -0,0 +1,72 @@ +From ae0409853c28b2c804c175e2197552069d038ec3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 25 Aug 2024 19:17:01 +0300 +Subject: wifi: iwlwifi: clear trans->state earlier upon error + +From: Emmanuel Grumbach + +[ Upstream commit 094513f8a2fbddee51b055d8035f995551f98fce ] + +When the firmware crashes, we first told the op_mode and only then, +changed the transport's state. This is a problem if the op_mode's +nic_error() handler needs to send a host command: it'll see that the +transport's state still reflects that the firmware is alive. + +Today, this has no consequences since we set the STATUS_FW_ERROR bit and +that will prevent sending host commands. iwl_fw_dbg_stop_restart_recording +looks at this bit to know not to send a host command for example. + +To fix the hibernation, we needed to reset the firmware without having +an error and checking STATUS_FW_ERROR to see whether the firmware is +alive will no longer hold, so this change is necessary as well. + +Change the flow a bit. +Change trans->state before calling the op_mode's nic_error() method and +check trans->state instead of STATUS_FW_ERROR. This will keep the +current behavior of iwl_fw_dbg_stop_restart_recording upon firmware +error, and it'll allow us to call iwl_fw_dbg_stop_restart_recording +safely even if STATUS_FW_ERROR is clear, but yet, the firmware is not +alive. + +Signed-off-by: Emmanuel Grumbach +Signed-off-by: Miri Korenblit +Link: https://patch.msgid.link/20240825191257.9d7427fbdfd7.Ia056ca57029a382c921d6f7b6a6b28fc480f2f22@changeid +[I missed this was a dependency for the hibernation fix, changed + the commit message a bit accordingly] +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 2 +- + drivers/net/wireless/intel/iwlwifi/iwl-trans.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +index f34a02b33ccd4..fc630a0d9c83c 100644 +--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c ++++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +@@ -2862,7 +2862,7 @@ void iwl_fw_dbg_stop_restart_recording(struct iwl_fw_runtime *fwrt, + { + int ret __maybe_unused = 0; + +- if (test_bit(STATUS_FW_ERROR, &fwrt->trans->status)) ++ if (!iwl_trans_fw_running(fwrt->trans)) + return; + + if (fw_has_capa(&fwrt->fw->ucode_capa, +diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h +index a2919a32d7081..d2b31599340fc 100644 +--- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h ++++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h +@@ -1393,8 +1393,8 @@ static inline void iwl_trans_fw_error(struct iwl_trans *trans, bool sync) + + /* prevent double restarts due to the same erroneous FW */ + if (!test_and_set_bit(STATUS_FW_ERROR, &trans->status)) { +- iwl_op_mode_nic_error(trans->op_mode, sync); + trans->state = IWL_TRANS_NO_FW; ++ iwl_op_mode_nic_error(trans->op_mode, sync); + } + } + +-- +2.43.0 + diff --git a/queue-5.15/wifi-iwlwifi-lower-message-level-for-fw-buffer-desti.patch b/queue-5.15/wifi-iwlwifi-lower-message-level-for-fw-buffer-desti.patch new file mode 100644 index 00000000000..399c92ce3ac --- /dev/null +++ b/queue-5.15/wifi-iwlwifi-lower-message-level-for-fw-buffer-desti.patch @@ -0,0 +1,41 @@ +From 6413c9500fcbf428c33258f32a3c1be651be0516 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 25 Aug 2024 19:17:13 +0300 +Subject: wifi: iwlwifi: lower message level for FW buffer destination + +From: Benjamin Berg + +[ Upstream commit f8a129c1e10256c785164ed5efa5d17d45fbd81b ] + +An invalid buffer destination is not a problem for the driver and it +does not make sense to report it with the KERN_ERR message level. As +such, change the message to use IWL_DEBUG_FW. + +Reported-by: Len Brown +Closes: https://lore.kernel.org/r/CAJvTdKkcxJss=DM2sxgv_MR5BeZ4_OC-3ad6tA40TYH2yqHCWw@mail.gmail.com +Signed-off-by: Benjamin Berg +Signed-off-by: Miri Korenblit +Link: https://patch.msgid.link/20240825191257.20abf78f05bc.Ifbcecc2ae9fb40b9698302507dcba8b922c8d856@changeid +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c +index 239a722cd79d8..ae55bde3a57a4 100644 +--- a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c ++++ b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c +@@ -64,7 +64,8 @@ iwl_pcie_ctxt_info_dbg_enable(struct iwl_trans *trans, + } + break; + default: +- IWL_ERR(trans, "WRT: Invalid buffer destination\n"); ++ IWL_DEBUG_FW(trans, "WRT: Invalid buffer destination (%d)\n", ++ le32_to_cpu(fw_mon_cfg->buf_location)); + } + out: + if (dbg_flags) +-- +2.43.0 + diff --git a/queue-5.15/wifi-iwlwifi-lower-message-level-for-fw-buffer-desti.patch-1448 b/queue-5.15/wifi-iwlwifi-lower-message-level-for-fw-buffer-desti.patch-1448 new file mode 100644 index 00000000000..399c92ce3ac --- /dev/null +++ b/queue-5.15/wifi-iwlwifi-lower-message-level-for-fw-buffer-desti.patch-1448 @@ -0,0 +1,41 @@ +From 6413c9500fcbf428c33258f32a3c1be651be0516 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 25 Aug 2024 19:17:13 +0300 +Subject: wifi: iwlwifi: lower message level for FW buffer destination + +From: Benjamin Berg + +[ Upstream commit f8a129c1e10256c785164ed5efa5d17d45fbd81b ] + +An invalid buffer destination is not a problem for the driver and it +does not make sense to report it with the KERN_ERR message level. As +such, change the message to use IWL_DEBUG_FW. + +Reported-by: Len Brown +Closes: https://lore.kernel.org/r/CAJvTdKkcxJss=DM2sxgv_MR5BeZ4_OC-3ad6tA40TYH2yqHCWw@mail.gmail.com +Signed-off-by: Benjamin Berg +Signed-off-by: Miri Korenblit +Link: https://patch.msgid.link/20240825191257.20abf78f05bc.Ifbcecc2ae9fb40b9698302507dcba8b922c8d856@changeid +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c +index 239a722cd79d8..ae55bde3a57a4 100644 +--- a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c ++++ b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c +@@ -64,7 +64,8 @@ iwl_pcie_ctxt_info_dbg_enable(struct iwl_trans *trans, + } + break; + default: +- IWL_ERR(trans, "WRT: Invalid buffer destination\n"); ++ IWL_DEBUG_FW(trans, "WRT: Invalid buffer destination (%d)\n", ++ le32_to_cpu(fw_mon_cfg->buf_location)); + } + out: + if (dbg_flags) +-- +2.43.0 + diff --git a/queue-5.15/wifi-iwlwifi-mvm-don-t-wait-for-tx-queues-if-firmwar.patch b/queue-5.15/wifi-iwlwifi-mvm-don-t-wait-for-tx-queues-if-firmwar.patch new file mode 100644 index 00000000000..7f69fef6fb3 --- /dev/null +++ b/queue-5.15/wifi-iwlwifi-mvm-don-t-wait-for-tx-queues-if-firmwar.patch @@ -0,0 +1,60 @@ +From 7564dccdeb0959863097dc1b9f9766350b7d899b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 25 Aug 2024 19:17:04 +0300 +Subject: wifi: iwlwifi: mvm: don't wait for tx queues if firmware is dead + +From: Emmanuel Grumbach + +[ Upstream commit 3a84454f5204718ca5b4ad2c1f0bf2031e2403d1 ] + +There is a WARNING in iwl_trans_wait_tx_queues_empty() (that was +recently converted from just a message), that can be hit if we +wait for TX queues to become empty after firmware died. Clearly, +we can't expect anything from the firmware after it's declared dead. + +Don't call iwl_trans_wait_tx_queues_empty() in this case. While it could +be a good idea to stop the flow earlier, the flush functions do some +maintenance work that is not related to the firmware, so keep that part +of the code running even when the firmware is not running. + +Signed-off-by: Emmanuel Grumbach +Signed-off-by: Miri Korenblit +Link: https://patch.msgid.link/20240825191257.a7cbd794cee9.I44a739fbd4ffcc46b83844dd1c7b2eb0c7b270f6@changeid +[edit commit message] +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +index fa7de3e47b8cc..0e2841fc84dcd 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +@@ -4776,6 +4776,10 @@ static void iwl_mvm_flush_no_vif(struct iwl_mvm *mvm, u32 queues, bool drop) + int i; + + if (!iwl_mvm_has_new_tx_api(mvm)) { ++ /* we can't ask the firmware anything if it is dead */ ++ if (test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, ++ &mvm->status)) ++ return; + if (drop) { + mutex_lock(&mvm->mutex); + iwl_mvm_flush_tx_path(mvm, +@@ -4857,8 +4861,11 @@ static void iwl_mvm_mac_flush(struct ieee80211_hw *hw, + + /* this can take a while, and we may need/want other operations + * to succeed while doing this, so do it without the mutex held ++ * If the firmware is dead, this can't work... + */ +- if (!drop && !iwl_mvm_has_new_tx_api(mvm)) ++ if (!drop && !iwl_mvm_has_new_tx_api(mvm) && ++ !test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, ++ &mvm->status)) + iwl_trans_wait_tx_queues_empty(mvm->trans, msk); + } + +-- +2.43.0 + diff --git a/queue-5.15/wifi-iwlwifi-mvm-don-t-wait-for-tx-queues-if-firmwar.patch-15491 b/queue-5.15/wifi-iwlwifi-mvm-don-t-wait-for-tx-queues-if-firmwar.patch-15491 new file mode 100644 index 00000000000..7f69fef6fb3 --- /dev/null +++ b/queue-5.15/wifi-iwlwifi-mvm-don-t-wait-for-tx-queues-if-firmwar.patch-15491 @@ -0,0 +1,60 @@ +From 7564dccdeb0959863097dc1b9f9766350b7d899b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 25 Aug 2024 19:17:04 +0300 +Subject: wifi: iwlwifi: mvm: don't wait for tx queues if firmware is dead + +From: Emmanuel Grumbach + +[ Upstream commit 3a84454f5204718ca5b4ad2c1f0bf2031e2403d1 ] + +There is a WARNING in iwl_trans_wait_tx_queues_empty() (that was +recently converted from just a message), that can be hit if we +wait for TX queues to become empty after firmware died. Clearly, +we can't expect anything from the firmware after it's declared dead. + +Don't call iwl_trans_wait_tx_queues_empty() in this case. While it could +be a good idea to stop the flow earlier, the flush functions do some +maintenance work that is not related to the firmware, so keep that part +of the code running even when the firmware is not running. + +Signed-off-by: Emmanuel Grumbach +Signed-off-by: Miri Korenblit +Link: https://patch.msgid.link/20240825191257.a7cbd794cee9.I44a739fbd4ffcc46b83844dd1c7b2eb0c7b270f6@changeid +[edit commit message] +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +index fa7de3e47b8cc..0e2841fc84dcd 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +@@ -4776,6 +4776,10 @@ static void iwl_mvm_flush_no_vif(struct iwl_mvm *mvm, u32 queues, bool drop) + int i; + + if (!iwl_mvm_has_new_tx_api(mvm)) { ++ /* we can't ask the firmware anything if it is dead */ ++ if (test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, ++ &mvm->status)) ++ return; + if (drop) { + mutex_lock(&mvm->mutex); + iwl_mvm_flush_tx_path(mvm, +@@ -4857,8 +4861,11 @@ static void iwl_mvm_mac_flush(struct ieee80211_hw *hw, + + /* this can take a while, and we may need/want other operations + * to succeed while doing this, so do it without the mutex held ++ * If the firmware is dead, this can't work... + */ +- if (!drop && !iwl_mvm_has_new_tx_api(mvm)) ++ if (!drop && !iwl_mvm_has_new_tx_api(mvm) && ++ !test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, ++ &mvm->status)) + iwl_trans_wait_tx_queues_empty(mvm->trans, msk); + } + +-- +2.43.0 + diff --git a/queue-5.15/wifi-iwlwifi-mvm-fix-iwl_mvm_scan_fits-calculation.patch b/queue-5.15/wifi-iwlwifi-mvm-fix-iwl_mvm_scan_fits-calculation.patch new file mode 100644 index 00000000000..3bf6eb876a8 --- /dev/null +++ b/queue-5.15/wifi-iwlwifi-mvm-fix-iwl_mvm_scan_fits-calculation.patch @@ -0,0 +1,78 @@ +From 8184eb7a19010381c51a7294abc6e82777349172 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 25 Aug 2024 19:17:05 +0300 +Subject: wifi: iwlwifi: mvm: fix iwl_mvm_scan_fits() calculation + +From: Daniel Gabay + +[ Upstream commit d44162280899c3fc2c6700e21e491e71c3c96e3d ] + +The calculation should consider also the 6GHz IE's len, fix that. +In addition, in iwl_mvm_sched_scan_start() the scan_fits helper is +called only in case non_psc_incldued is true, but it should be called +regardless, fix that as well. + +Signed-off-by: Daniel Gabay +Reviewed-by: Ilan Peer +Signed-off-by: Miri Korenblit +Link: https://patch.msgid.link/20240825191257.7db825442fd2.I99f4d6587709de02072fd57957ec7472331c6b1d@changeid +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 23 ++++++++++--------- + 1 file changed, 12 insertions(+), 11 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c +index 4bab14ceef5f5..aa6ef64912056 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c +@@ -834,8 +834,8 @@ static inline bool iwl_mvm_scan_fits(struct iwl_mvm *mvm, int n_ssids, + return ((n_ssids <= PROBE_OPTION_MAX) && + (n_channels <= mvm->fw->ucode_capa.n_scan_channels) & + (ies->common_ie_len + +- ies->len[NL80211_BAND_2GHZ] + +- ies->len[NL80211_BAND_5GHZ] <= ++ ies->len[NL80211_BAND_2GHZ] + ies->len[NL80211_BAND_5GHZ] + ++ ies->len[NL80211_BAND_6GHZ] <= + iwl_mvm_max_scan_ie_fw_cmd_room(mvm))); + } + +@@ -2775,18 +2775,16 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm, + params.n_channels = j; + } + +- if (non_psc_included && +- !iwl_mvm_scan_fits(mvm, req->n_ssids, ies, params.n_channels)) { +- kfree(params.channels); +- return -ENOBUFS; ++ if (!iwl_mvm_scan_fits(mvm, req->n_ssids, ies, params.n_channels)) { ++ ret = -ENOBUFS; ++ goto out; + } + + uid = iwl_mvm_build_scan_cmd(mvm, vif, &hcmd, ¶ms, type); +- +- if (non_psc_included) +- kfree(params.channels); +- if (uid < 0) +- return uid; ++ if (uid < 0) { ++ ret = uid; ++ goto out; ++ } + + ret = iwl_mvm_send_cmd(mvm, &hcmd); + if (!ret) { +@@ -2803,6 +2801,9 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm, + mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_DISABLED; + } + ++out: ++ if (non_psc_included) ++ kfree(params.channels); + return ret; + } + +-- +2.43.0 + diff --git a/queue-5.15/wifi-iwlwifi-mvm-fix-iwl_mvm_scan_fits-calculation.patch-20772 b/queue-5.15/wifi-iwlwifi-mvm-fix-iwl_mvm_scan_fits-calculation.patch-20772 new file mode 100644 index 00000000000..3bf6eb876a8 --- /dev/null +++ b/queue-5.15/wifi-iwlwifi-mvm-fix-iwl_mvm_scan_fits-calculation.patch-20772 @@ -0,0 +1,78 @@ +From 8184eb7a19010381c51a7294abc6e82777349172 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 25 Aug 2024 19:17:05 +0300 +Subject: wifi: iwlwifi: mvm: fix iwl_mvm_scan_fits() calculation + +From: Daniel Gabay + +[ Upstream commit d44162280899c3fc2c6700e21e491e71c3c96e3d ] + +The calculation should consider also the 6GHz IE's len, fix that. +In addition, in iwl_mvm_sched_scan_start() the scan_fits helper is +called only in case non_psc_incldued is true, but it should be called +regardless, fix that as well. + +Signed-off-by: Daniel Gabay +Reviewed-by: Ilan Peer +Signed-off-by: Miri Korenblit +Link: https://patch.msgid.link/20240825191257.7db825442fd2.I99f4d6587709de02072fd57957ec7472331c6b1d@changeid +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 23 ++++++++++--------- + 1 file changed, 12 insertions(+), 11 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c +index 4bab14ceef5f5..aa6ef64912056 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c +@@ -834,8 +834,8 @@ static inline bool iwl_mvm_scan_fits(struct iwl_mvm *mvm, int n_ssids, + return ((n_ssids <= PROBE_OPTION_MAX) && + (n_channels <= mvm->fw->ucode_capa.n_scan_channels) & + (ies->common_ie_len + +- ies->len[NL80211_BAND_2GHZ] + +- ies->len[NL80211_BAND_5GHZ] <= ++ ies->len[NL80211_BAND_2GHZ] + ies->len[NL80211_BAND_5GHZ] + ++ ies->len[NL80211_BAND_6GHZ] <= + iwl_mvm_max_scan_ie_fw_cmd_room(mvm))); + } + +@@ -2775,18 +2775,16 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm, + params.n_channels = j; + } + +- if (non_psc_included && +- !iwl_mvm_scan_fits(mvm, req->n_ssids, ies, params.n_channels)) { +- kfree(params.channels); +- return -ENOBUFS; ++ if (!iwl_mvm_scan_fits(mvm, req->n_ssids, ies, params.n_channels)) { ++ ret = -ENOBUFS; ++ goto out; + } + + uid = iwl_mvm_build_scan_cmd(mvm, vif, &hcmd, ¶ms, type); +- +- if (non_psc_included) +- kfree(params.channels); +- if (uid < 0) +- return uid; ++ if (uid < 0) { ++ ret = uid; ++ goto out; ++ } + + ret = iwl_mvm_send_cmd(mvm, &hcmd); + if (!ret) { +@@ -2803,6 +2801,9 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm, + mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_DISABLED; + } + ++out: ++ if (non_psc_included) ++ kfree(params.channels); + return ret; + } + +-- +2.43.0 + diff --git a/queue-5.15/wifi-iwlwifi-mvm-pause-tcm-when-the-firmware-is-stop.patch b/queue-5.15/wifi-iwlwifi-mvm-pause-tcm-when-the-firmware-is-stop.patch new file mode 100644 index 00000000000..cb82d3f88ba --- /dev/null +++ b/queue-5.15/wifi-iwlwifi-mvm-pause-tcm-when-the-firmware-is-stop.patch @@ -0,0 +1,53 @@ +From f0b98a80530a1ac99e549869bdfb60de4f1c831c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 25 Aug 2024 19:17:10 +0300 +Subject: wifi: iwlwifi: mvm: pause TCM when the firmware is stopped + +From: Emmanuel Grumbach + +[ Upstream commit 0668ebc8c2282ca1e7eb96092a347baefffb5fe7 ] + +Not doing so will make us send a host command to the transport while the +firmware is not alive, which will trigger a WARNING. + +bad state = 0 +WARNING: CPU: 2 PID: 17434 at drivers/net/wireless/intel/iwlwifi/iwl-trans.c:115 iwl_trans_send_cmd+0x1cb/0x1e0 [iwlwifi] +RIP: 0010:iwl_trans_send_cmd+0x1cb/0x1e0 [iwlwifi] +Call Trace: + + iwl_mvm_send_cmd+0x40/0xc0 [iwlmvm] + iwl_mvm_config_scan+0x198/0x260 [iwlmvm] + iwl_mvm_recalc_tcm+0x730/0x11d0 [iwlmvm] + iwl_mvm_tcm_work+0x1d/0x30 [iwlmvm] + process_one_work+0x29e/0x640 + worker_thread+0x2df/0x690 + ? rescuer_thread+0x540/0x540 + kthread+0x192/0x1e0 + ? set_kthread_struct+0x90/0x90 + ret_from_fork+0x22/0x30 + +Signed-off-by: Emmanuel Grumbach +Signed-off-by: Miri Korenblit +Link: https://patch.msgid.link/20240825191257.5abe71ca1b6b.I97a968cb8be1f24f94652d9b110ecbf6af73f89e@changeid +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +index 0b0022dabc7bc..e2c244ceaf706 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +@@ -1018,6 +1018,8 @@ void iwl_mvm_stop_device(struct iwl_mvm *mvm) + + clear_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status); + ++ iwl_mvm_pause_tcm(mvm, false); ++ + iwl_fw_dbg_stop_sync(&mvm->fwrt); + iwl_trans_stop_device(mvm->trans); + iwl_free_fw_paging(&mvm->fwrt); +-- +2.43.0 + diff --git a/queue-5.15/wifi-iwlwifi-mvm-pause-tcm-when-the-firmware-is-stop.patch-18801 b/queue-5.15/wifi-iwlwifi-mvm-pause-tcm-when-the-firmware-is-stop.patch-18801 new file mode 100644 index 00000000000..cb82d3f88ba --- /dev/null +++ b/queue-5.15/wifi-iwlwifi-mvm-pause-tcm-when-the-firmware-is-stop.patch-18801 @@ -0,0 +1,53 @@ +From f0b98a80530a1ac99e549869bdfb60de4f1c831c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 25 Aug 2024 19:17:10 +0300 +Subject: wifi: iwlwifi: mvm: pause TCM when the firmware is stopped + +From: Emmanuel Grumbach + +[ Upstream commit 0668ebc8c2282ca1e7eb96092a347baefffb5fe7 ] + +Not doing so will make us send a host command to the transport while the +firmware is not alive, which will trigger a WARNING. + +bad state = 0 +WARNING: CPU: 2 PID: 17434 at drivers/net/wireless/intel/iwlwifi/iwl-trans.c:115 iwl_trans_send_cmd+0x1cb/0x1e0 [iwlwifi] +RIP: 0010:iwl_trans_send_cmd+0x1cb/0x1e0 [iwlwifi] +Call Trace: + + iwl_mvm_send_cmd+0x40/0xc0 [iwlmvm] + iwl_mvm_config_scan+0x198/0x260 [iwlmvm] + iwl_mvm_recalc_tcm+0x730/0x11d0 [iwlmvm] + iwl_mvm_tcm_work+0x1d/0x30 [iwlmvm] + process_one_work+0x29e/0x640 + worker_thread+0x2df/0x690 + ? rescuer_thread+0x540/0x540 + kthread+0x192/0x1e0 + ? set_kthread_struct+0x90/0x90 + ret_from_fork+0x22/0x30 + +Signed-off-by: Emmanuel Grumbach +Signed-off-by: Miri Korenblit +Link: https://patch.msgid.link/20240825191257.5abe71ca1b6b.I97a968cb8be1f24f94652d9b110ecbf6af73f89e@changeid +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +index 0b0022dabc7bc..e2c244ceaf706 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +@@ -1018,6 +1018,8 @@ void iwl_mvm_stop_device(struct iwl_mvm *mvm) + + clear_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status); + ++ iwl_mvm_pause_tcm(mvm, false); ++ + iwl_fw_dbg_stop_sync(&mvm->fwrt); + iwl_trans_stop_device(mvm->trans); + iwl_free_fw_paging(&mvm->fwrt); +-- +2.43.0 + diff --git a/queue-5.15/x86-hyperv-set-x86_feature_tsc_known_freq-when-hyper.patch b/queue-5.15/x86-hyperv-set-x86_feature_tsc_known_freq-when-hyper.patch new file mode 100644 index 00000000000..9c71e05d57b --- /dev/null +++ b/queue-5.15/x86-hyperv-set-x86_feature_tsc_known_freq-when-hyper.patch @@ -0,0 +1,49 @@ +From b596e48be8fbbdcfbe81f9bfc3bfdac5ec54fec2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 5 Jun 2024 19:55:59 -0700 +Subject: x86/hyperv: Set X86_FEATURE_TSC_KNOWN_FREQ when Hyper-V provides + frequency + +From: Michael Kelley + +[ Upstream commit 8fcc514809de41153b43ccbe1a0cdf7f72b78e7e ] + +A Linux guest on Hyper-V gets the TSC frequency from a synthetic MSR, if +available. In this case, set X86_FEATURE_TSC_KNOWN_FREQ so that Linux +doesn't unnecessarily do refined TSC calibration when setting up the TSC +clocksource. + +With this change, a message such as this is no longer output during boot +when the TSC is used as the clocksource: + +[ 1.115141] tsc: Refined TSC clocksource calibration: 2918.408 MHz + +Furthermore, the guest and host will have exactly the same view of the +TSC frequency, which is important for features such as the TSC deadline +timer that are emulated by the Hyper-V host. + +Signed-off-by: Michael Kelley +Reviewed-by: Roman Kisel +Link: https://lore.kernel.org/r/20240606025559.1631-1-mhklinux@outlook.com +Signed-off-by: Wei Liu +Message-ID: <20240606025559.1631-1-mhklinux@outlook.com> +Signed-off-by: Sasha Levin +--- + arch/x86/kernel/cpu/mshyperv.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c +index 8d3c649a1769b..3794b223fd69c 100644 +--- a/arch/x86/kernel/cpu/mshyperv.c ++++ b/arch/x86/kernel/cpu/mshyperv.c +@@ -322,6 +322,7 @@ static void __init ms_hyperv_init_platform(void) + ms_hyperv.misc_features & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE) { + x86_platform.calibrate_tsc = hv_get_tsc_khz; + x86_platform.calibrate_cpu = hv_get_tsc_khz; ++ setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ); + } + + if (ms_hyperv.priv_high & HV_ISOLATION) { +-- +2.43.0 + diff --git a/queue-5.15/x86-hyperv-set-x86_feature_tsc_known_freq-when-hyper.patch-27755 b/queue-5.15/x86-hyperv-set-x86_feature_tsc_known_freq-when-hyper.patch-27755 new file mode 100644 index 00000000000..9c71e05d57b --- /dev/null +++ b/queue-5.15/x86-hyperv-set-x86_feature_tsc_known_freq-when-hyper.patch-27755 @@ -0,0 +1,49 @@ +From b596e48be8fbbdcfbe81f9bfc3bfdac5ec54fec2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 5 Jun 2024 19:55:59 -0700 +Subject: x86/hyperv: Set X86_FEATURE_TSC_KNOWN_FREQ when Hyper-V provides + frequency + +From: Michael Kelley + +[ Upstream commit 8fcc514809de41153b43ccbe1a0cdf7f72b78e7e ] + +A Linux guest on Hyper-V gets the TSC frequency from a synthetic MSR, if +available. In this case, set X86_FEATURE_TSC_KNOWN_FREQ so that Linux +doesn't unnecessarily do refined TSC calibration when setting up the TSC +clocksource. + +With this change, a message such as this is no longer output during boot +when the TSC is used as the clocksource: + +[ 1.115141] tsc: Refined TSC clocksource calibration: 2918.408 MHz + +Furthermore, the guest and host will have exactly the same view of the +TSC frequency, which is important for features such as the TSC deadline +timer that are emulated by the Hyper-V host. + +Signed-off-by: Michael Kelley +Reviewed-by: Roman Kisel +Link: https://lore.kernel.org/r/20240606025559.1631-1-mhklinux@outlook.com +Signed-off-by: Wei Liu +Message-ID: <20240606025559.1631-1-mhklinux@outlook.com> +Signed-off-by: Sasha Levin +--- + arch/x86/kernel/cpu/mshyperv.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c +index 8d3c649a1769b..3794b223fd69c 100644 +--- a/arch/x86/kernel/cpu/mshyperv.c ++++ b/arch/x86/kernel/cpu/mshyperv.c +@@ -322,6 +322,7 @@ static void __init ms_hyperv_init_platform(void) + ms_hyperv.misc_features & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE) { + x86_platform.calibrate_tsc = hv_get_tsc_khz; + x86_platform.calibrate_cpu = hv_get_tsc_khz; ++ setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ); + } + + if (ms_hyperv.priv_high & HV_ISOLATION) { +-- +2.43.0 +