]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 6.6
authorSasha Levin <sashal@kernel.org>
Wed, 4 Sep 2024 10:27:26 +0000 (06:27 -0400)
committerSasha Levin <sashal@kernel.org>
Wed, 4 Sep 2024 10:27:26 +0000 (06:27 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
32 files changed:
queue-6.6/alsa-hda-conexant-mute-speakers-at-suspend-shutdown.patch [new file with mode: 0644]
queue-6.6/alsa-hda-generic-add-a-helper-to-mute-speakers-at-su.patch [new file with mode: 0644]
queue-6.6/alsa-seq-ump-explicitly-reset-rpn-with-null-rpn.patch [new file with mode: 0644]
queue-6.6/alsa-seq-ump-transmit-rpn-nrpn-message-at-each-msb-l.patch [new file with mode: 0644]
queue-6.6/alsa-seq-ump-use-the-common-rpn-bank-conversion-cont.patch [new file with mode: 0644]
queue-6.6/alsa-ump-explicitly-reset-rpn-with-null-rpn.patch [new file with mode: 0644]
queue-6.6/alsa-ump-transmit-rpn-nrpn-message-at-each-msb-lsb-d.patch [new file with mode: 0644]
queue-6.6/asoc-amd-yc-support-mic-on-hp-14-em0002la.patch [new file with mode: 0644]
queue-6.6/asoc-amd-yc-support-mic-on-lenovo-thinkpad-e14-gen-6.patch [new file with mode: 0644]
queue-6.6/asoc-codecs-es8326-button-detect-issue.patch [new file with mode: 0644]
queue-6.6/btrfs-tree-checker-validate-dref-root-and-objectid.patch [new file with mode: 0644]
queue-6.6/dma-debug-avoid-deadlock-between-dma-debug-vs-printk.patch [new file with mode: 0644]
queue-6.6/drm-fb-helper-don-t-schedule_work-to-flush-frame-buf.patch [new file with mode: 0644]
queue-6.6/drm-panel-orientation-quirks-add-quirk-for-orangepi-.patch [new file with mode: 0644]
queue-6.6/i2c-fix-conditional-for-substituting-empty-acpi-func.patch [new file with mode: 0644]
queue-6.6/mptcp-make-pm_remove_addrs_and_subflows-static.patch [new file with mode: 0644]
queue-6.6/mptcp-pm-fix-rm_addr-id-for-the-initial-subflow.patch [new file with mode: 0644]
queue-6.6/net-mlx5-dr-fix-stack-guard-page-was-hit-error-in-dr.patch [new file with mode: 0644]
queue-6.6/net-usb-qmi_wwan-add-meig-smart-srm825l.patch [new file with mode: 0644]
queue-6.6/scsi-ufs-core-bypass-quick-recovery-if-force-reset-i.patch [new file with mode: 0644]
queue-6.6/scsi-ufs-core-check-lsdbs-cap-when-mcq.patch [new file with mode: 0644]
queue-6.6/selftests-mptcp-add-explicit-test-case-for-remove-re.patch [new file with mode: 0644]
queue-6.6/selftests-mptcp-declare-event-macros-in-mptcp_lib.patch [new file with mode: 0644]
queue-6.6/selftests-mptcp-dump-userspace-addrs-list.patch [new file with mode: 0644]
queue-6.6/selftests-mptcp-join-cannot-rm-sf-if-closed.patch [new file with mode: 0644]
queue-6.6/selftests-mptcp-join-check-re-adding-init-endp-with-.patch [new file with mode: 0644]
queue-6.6/selftests-mptcp-join-check-re-using-id-of-unused-add.patch [new file with mode: 0644]
queue-6.6/selftests-mptcp-userspace-pm-create-id-0-subflow.patch [new file with mode: 0644]
queue-6.6/selftests-mptcp-userspace-pm-get-addr-tests.patch [new file with mode: 0644]
queue-6.6/series [new file with mode: 0644]
queue-6.6/smb-client-fix-fsctl_get_reparse_point-against-netap.patch [new file with mode: 0644]
queue-6.6/spi-hisi-kunpeng-add-validation-for-the-minimum-valu.patch [new file with mode: 0644]

diff --git a/queue-6.6/alsa-hda-conexant-mute-speakers-at-suspend-shutdown.patch b/queue-6.6/alsa-hda-conexant-mute-speakers-at-suspend-shutdown.patch
new file mode 100644 (file)
index 0000000..28f20a9
--- /dev/null
@@ -0,0 +1,36 @@
+From da8a3b8919a970b6bb2b9f3dc529da2c84e7b561 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 26 Jul 2024 16:26:20 +0200
+Subject: ALSA: hda/conexant: Mute speakers at suspend / shutdown
+
+From: Takashi Iwai <tiwai@suse.de>
+
+[ Upstream commit 4f61c8fe35202702426cfc0003e15116a01ba885 ]
+
+Use the new helper to mute speakers at suspend / shutdown for avoiding
+click noises.
+
+Link: https://bugzilla.suse.com/show_bug.cgi?id=1228269
+Link: https://patch.msgid.link/20240726142625.2460-2-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/pci/hda/patch_conexant.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
+index af921364195e4..8396d1d93668c 100644
+--- a/sound/pci/hda/patch_conexant.c
++++ b/sound/pci/hda/patch_conexant.c
+@@ -205,6 +205,8 @@ static void cx_auto_shutdown(struct hda_codec *codec)
+ {
+       struct conexant_spec *spec = codec->spec;
++      snd_hda_gen_shutup_speakers(codec);
++
+       /* Turn the problematic codec into D3 to avoid spurious noises
+          from the internal speaker during (and after) reboot */
+       cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, false);
+-- 
+2.43.0
+
diff --git a/queue-6.6/alsa-hda-generic-add-a-helper-to-mute-speakers-at-su.patch b/queue-6.6/alsa-hda-generic-add-a-helper-to-mute-speakers-at-su.patch
new file mode 100644 (file)
index 0000000..eb24552
--- /dev/null
@@ -0,0 +1,114 @@
+From a7d9677c3ed89c6e1c2872edc3504272d115628d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 26 Jul 2024 16:26:19 +0200
+Subject: ALSA: hda/generic: Add a helper to mute speakers at suspend/shutdown
+
+From: Takashi Iwai <tiwai@suse.de>
+
+[ Upstream commit 6cd23b26b348fa52c88e1adf9c0e48d68e13f95e ]
+
+Some devices indicate click noises at suspend or shutdown when the
+speakers are unmuted.  This patch adds a helper,
+snd_hda_gen_shutup_speakers(), to work around it.  The new function is
+supposed to be called at suspend or shutdown by the codec driver, and
+it mutes the speakers.
+
+The mute status isn't cached, hence the original mute state will be
+restored at resume again.
+
+Link: https://patch.msgid.link/20240726142625.2460-1-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/pci/hda/hda_generic.c | 63 +++++++++++++++++++++++++++++++++++++
+ sound/pci/hda/hda_generic.h |  1 +
+ 2 files changed, 64 insertions(+)
+
+diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
+index bf685d01259d3..d3ed3e21b1979 100644
+--- a/sound/pci/hda/hda_generic.c
++++ b/sound/pci/hda/hda_generic.c
+@@ -4956,6 +4956,69 @@ void snd_hda_gen_stream_pm(struct hda_codec *codec, hda_nid_t nid, bool on)
+ }
+ EXPORT_SYMBOL_GPL(snd_hda_gen_stream_pm);
++/* forcibly mute the speaker output without caching; return true if updated */
++static bool force_mute_output_path(struct hda_codec *codec, hda_nid_t nid)
++{
++      if (!nid)
++              return false;
++      if (!nid_has_mute(codec, nid, HDA_OUTPUT))
++              return false; /* no mute, skip */
++      if (snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) &
++          snd_hda_codec_amp_read(codec, nid, 1, HDA_OUTPUT, 0) &
++          HDA_AMP_MUTE)
++              return false; /* both channels already muted, skip */
++
++      /* direct amp update without caching */
++      snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE,
++                          AC_AMP_SET_OUTPUT | AC_AMP_SET_LEFT |
++                          AC_AMP_SET_RIGHT | HDA_AMP_MUTE);
++      return true;
++}
++
++/**
++ * snd_hda_gen_shutup_speakers - Forcibly mute the speaker outputs
++ * @codec: the HDA codec
++ *
++ * Forcibly mute the speaker outputs, to be called at suspend or shutdown.
++ *
++ * The mute state done by this function isn't cached, hence the original state
++ * will be restored at resume.
++ *
++ * Return true if the mute state has been changed.
++ */
++bool snd_hda_gen_shutup_speakers(struct hda_codec *codec)
++{
++      struct hda_gen_spec *spec = codec->spec;
++      const int *paths;
++      const struct nid_path *path;
++      int i, p, num_paths;
++      bool updated = false;
++
++      /* if already powered off, do nothing */
++      if (!snd_hdac_is_power_on(&codec->core))
++              return false;
++
++      if (spec->autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) {
++              paths = spec->out_paths;
++              num_paths = spec->autocfg.line_outs;
++      } else {
++              paths = spec->speaker_paths;
++              num_paths = spec->autocfg.speaker_outs;
++      }
++
++      for (i = 0; i < num_paths; i++) {
++              path = snd_hda_get_path_from_idx(codec, paths[i]);
++              if (!path)
++                      continue;
++              for (p = 0; p < path->depth; p++)
++                      if (force_mute_output_path(codec, path->path[p]))
++                              updated = true;
++      }
++
++      return updated;
++}
++EXPORT_SYMBOL_GPL(snd_hda_gen_shutup_speakers);
++
+ /**
+  * snd_hda_gen_parse_auto_config - Parse the given BIOS configuration and
+  * set up the hda_gen_spec
+diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h
+index a8eea83676299..aed4381f7a619 100644
+--- a/sound/pci/hda/hda_generic.h
++++ b/sound/pci/hda/hda_generic.h
+@@ -355,5 +355,6 @@ int snd_hda_gen_add_mute_led_cdev(struct hda_codec *codec,
+ int snd_hda_gen_add_micmute_led_cdev(struct hda_codec *codec,
+                                    int (*callback)(struct led_classdev *,
+                                                    enum led_brightness));
++bool snd_hda_gen_shutup_speakers(struct hda_codec *codec);
+ #endif /* __SOUND_HDA_GENERIC_H */
+-- 
+2.43.0
+
diff --git a/queue-6.6/alsa-seq-ump-explicitly-reset-rpn-with-null-rpn.patch b/queue-6.6/alsa-seq-ump-explicitly-reset-rpn-with-null-rpn.patch
new file mode 100644 (file)
index 0000000..652bcc3
--- /dev/null
@@ -0,0 +1,82 @@
+From 80fe0d94469aa71a96014a9cb0b40f07ab7af207 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 31 Jul 2024 15:05:26 +0200
+Subject: ALSA: seq: ump: Explicitly reset RPN with Null RPN
+
+From: Takashi Iwai <tiwai@suse.de>
+
+[ Upstream commit 98ea612dd1150adb61cd2a0e93875e1cc77e6b87 ]
+
+RPN with 127:127 is treated as a Null RPN, just to reset the
+parameters, and it's not translated to MIDI2.  Although the current
+code can work as is in most cases, better to implement the RPN reset
+explicitly for Null message.
+
+Link: https://patch.msgid.link/20240731130528.12600-6-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/core/seq/seq_ump_convert.c | 21 ++++++++++++++++-----
+ 1 file changed, 16 insertions(+), 5 deletions(-)
+
+diff --git a/sound/core/seq/seq_ump_convert.c b/sound/core/seq/seq_ump_convert.c
+index 7ca62667f28d3..4dd540cbb1cbb 100644
+--- a/sound/core/seq/seq_ump_convert.c
++++ b/sound/core/seq/seq_ump_convert.c
+@@ -789,6 +789,15 @@ static int paf_ev_to_ump_midi2(const struct snd_seq_event *event,
+       return 1;
+ }
++static void reset_rpn(struct ump_cvt_to_ump_bank *cc)
++{
++      cc->rpn_set = 0;
++      cc->nrpn_set = 0;
++      cc->cc_rpn_msb = cc->cc_rpn_lsb = 0;
++      cc->cc_data_msb = cc->cc_data_lsb = 0;
++      cc->cc_data_msb_set = cc->cc_data_lsb_set = 0;
++}
++
+ /* set up the MIDI2 RPN/NRPN packet data from the parsed info */
+ static int fill_rpn(struct ump_cvt_to_ump_bank *cc,
+                   union snd_ump_midi2_msg *data,
+@@ -817,11 +826,7 @@ static int fill_rpn(struct ump_cvt_to_ump_bank *cc,
+                                            cc->cc_data_lsb);
+       data->rpn.channel = channel;
+-      cc->rpn_set = 0;
+-      cc->nrpn_set = 0;
+-      cc->cc_rpn_msb = cc->cc_rpn_lsb = 0;
+-      cc->cc_data_msb = cc->cc_data_lsb = 0;
+-      cc->cc_data_msb_set = cc->cc_data_lsb_set = 0;
++      reset_rpn(cc);
+       return 1;
+ }
+@@ -843,11 +848,15 @@ static int cc_ev_to_ump_midi2(const struct snd_seq_event *event,
+               ret = fill_rpn(cc, data, channel, true);
+               cc->rpn_set = 1;
+               cc->cc_rpn_msb = val;
++              if (cc->cc_rpn_msb == 0x7f && cc->cc_rpn_lsb == 0x7f)
++                      reset_rpn(cc);
+               return ret;
+       case UMP_CC_RPN_LSB:
+               ret = fill_rpn(cc, data, channel, true);
+               cc->rpn_set = 1;
+               cc->cc_rpn_lsb = val;
++              if (cc->cc_rpn_msb == 0x7f && cc->cc_rpn_lsb == 0x7f)
++                      reset_rpn(cc);
+               return ret;
+       case UMP_CC_NRPN_MSB:
+               ret = fill_rpn(cc, data, channel, true);
+@@ -961,6 +970,8 @@ static int ctrl14_ev_to_ump_midi2(const struct snd_seq_event *event,
+               cc->cc_rpn_msb = msb;
+               cc->cc_rpn_lsb = lsb;
+               cc->rpn_set = 1;
++              if (cc->cc_rpn_msb == 0x7f && cc->cc_rpn_lsb == 0x7f)
++                      reset_rpn(cc);
+               return ret;
+       case UMP_CC_NRPN_MSB:
+       case UMP_CC_NRPN_LSB:
+-- 
+2.43.0
+
diff --git a/queue-6.6/alsa-seq-ump-transmit-rpn-nrpn-message-at-each-msb-l.patch b/queue-6.6/alsa-seq-ump-transmit-rpn-nrpn-message-at-each-msb-l.patch
new file mode 100644 (file)
index 0000000..17d5abb
--- /dev/null
@@ -0,0 +1,177 @@
+From f5ba7b2f762fb27b0979e3fb98f15532ccef8edc Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 31 Jul 2024 15:05:25 +0200
+Subject: ALSA: seq: ump: Transmit RPN/NRPN message at each MSB/LSB data
+ reception
+
+From: Takashi Iwai <tiwai@suse.de>
+
+[ Upstream commit a4ff92ff0bdd731eca9f0b50b1cbb5aba89be4b2 ]
+
+Just like the core UMP conversion helper, we need to deal with the
+partially-filled RPN/NRPN data in the sequencer UMP converter as
+well.
+
+Link: https://patch.msgid.link/20240731130528.12600-5-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/core/seq/seq_ump_convert.c | 74 +++++++++++++++++++-------------
+ 1 file changed, 44 insertions(+), 30 deletions(-)
+
+diff --git a/sound/core/seq/seq_ump_convert.c b/sound/core/seq/seq_ump_convert.c
+index b1bc6d122d92d..7ca62667f28d3 100644
+--- a/sound/core/seq/seq_ump_convert.c
++++ b/sound/core/seq/seq_ump_convert.c
+@@ -790,27 +790,39 @@ static int paf_ev_to_ump_midi2(const struct snd_seq_event *event,
+ }
+ /* set up the MIDI2 RPN/NRPN packet data from the parsed info */
+-static void fill_rpn(struct ump_cvt_to_ump_bank *cc,
+-                   union snd_ump_midi2_msg *data,
+-                   unsigned char channel)
++static int fill_rpn(struct ump_cvt_to_ump_bank *cc,
++                  union snd_ump_midi2_msg *data,
++                  unsigned char channel,
++                  bool flush)
+ {
++      if (!(cc->cc_data_lsb_set || cc->cc_data_msb_set))
++              return 0; // skip
++      /* when not flushing, wait for complete data set */
++      if (!flush && (!cc->cc_data_lsb_set || !cc->cc_data_msb_set))
++              return 0; // skip
++
+       if (cc->rpn_set) {
+               data->rpn.status = UMP_MSG_STATUS_RPN;
+               data->rpn.bank = cc->cc_rpn_msb;
+               data->rpn.index = cc->cc_rpn_lsb;
+-              cc->rpn_set = 0;
+-              cc->cc_rpn_msb = cc->cc_rpn_lsb = 0;
+-      } else {
++      } else if (cc->nrpn_set) {
+               data->rpn.status = UMP_MSG_STATUS_NRPN;
+               data->rpn.bank = cc->cc_nrpn_msb;
+               data->rpn.index = cc->cc_nrpn_lsb;
+-              cc->nrpn_set = 0;
+-              cc->cc_nrpn_msb = cc->cc_nrpn_lsb = 0;
++      } else {
++              return 0; // skip
+       }
++
+       data->rpn.data = upscale_14_to_32bit((cc->cc_data_msb << 7) |
+                                            cc->cc_data_lsb);
+       data->rpn.channel = channel;
++
++      cc->rpn_set = 0;
++      cc->nrpn_set = 0;
++      cc->cc_rpn_msb = cc->cc_rpn_lsb = 0;
+       cc->cc_data_msb = cc->cc_data_lsb = 0;
++      cc->cc_data_msb_set = cc->cc_data_lsb_set = 0;
++      return 1;
+ }
+ /* convert CC event to MIDI 2.0 UMP */
+@@ -823,28 +835,34 @@ static int cc_ev_to_ump_midi2(const struct snd_seq_event *event,
+       unsigned char index = event->data.control.param & 0x7f;
+       unsigned char val = event->data.control.value & 0x7f;
+       struct ump_cvt_to_ump_bank *cc = &dest_port->midi2_bank[channel];
++      int ret;
+       /* process special CC's (bank/rpn/nrpn) */
+       switch (index) {
+       case UMP_CC_RPN_MSB:
++              ret = fill_rpn(cc, data, channel, true);
+               cc->rpn_set = 1;
+               cc->cc_rpn_msb = val;
+-              return 0; // skip
++              return ret;
+       case UMP_CC_RPN_LSB:
++              ret = fill_rpn(cc, data, channel, true);
+               cc->rpn_set = 1;
+               cc->cc_rpn_lsb = val;
+-              return 0; // skip
++              return ret;
+       case UMP_CC_NRPN_MSB:
++              ret = fill_rpn(cc, data, channel, true);
+               cc->nrpn_set = 1;
+               cc->cc_nrpn_msb = val;
+-              return 0; // skip
++              return ret;
+       case UMP_CC_NRPN_LSB:
++              ret = fill_rpn(cc, data, channel, true);
+               cc->nrpn_set = 1;
+               cc->cc_nrpn_lsb = val;
+-              return 0; // skip
++              return ret;
+       case UMP_CC_DATA:
++              cc->cc_data_msb_set = 1;
+               cc->cc_data_msb = val;
+-              return 0; // skip
++              return fill_rpn(cc, data, channel, false);
+       case UMP_CC_BANK_SELECT:
+               cc->bank_set = 1;
+               cc->cc_bank_msb = val;
+@@ -854,11 +872,9 @@ static int cc_ev_to_ump_midi2(const struct snd_seq_event *event,
+               cc->cc_bank_lsb = val;
+               return 0; // skip
+       case UMP_CC_DATA_LSB:
++              cc->cc_data_lsb_set = 1;
+               cc->cc_data_lsb = val;
+-              if (!(cc->rpn_set || cc->nrpn_set))
+-                      return 0; // skip
+-              fill_rpn(cc, data, channel);
+-              return 1;
++              return fill_rpn(cc, data, channel, false);
+       }
+       data->cc.status = status;
+@@ -926,6 +942,7 @@ static int ctrl14_ev_to_ump_midi2(const struct snd_seq_event *event,
+       unsigned char index = event->data.control.param & 0x7f;
+       struct ump_cvt_to_ump_bank *cc = &dest_port->midi2_bank[channel];
+       unsigned char msb, lsb;
++      int ret;
+       msb = (event->data.control.value >> 7) & 0x7f;
+       lsb = event->data.control.value & 0x7f;
+@@ -939,28 +956,25 @@ static int ctrl14_ev_to_ump_midi2(const struct snd_seq_event *event,
+               cc->cc_bank_lsb = lsb;
+               return 0; // skip
+       case UMP_CC_RPN_MSB:
+-              cc->cc_rpn_msb = msb;
+-              fallthrough;
+       case UMP_CC_RPN_LSB:
+-              cc->rpn_set = 1;
++              ret = fill_rpn(cc, data, channel, true);
++              cc->cc_rpn_msb = msb;
+               cc->cc_rpn_lsb = lsb;
+-              return 0; // skip
++              cc->rpn_set = 1;
++              return ret;
+       case UMP_CC_NRPN_MSB:
+-              cc->cc_nrpn_msb = msb;
+-              fallthrough;
+       case UMP_CC_NRPN_LSB:
++              ret = fill_rpn(cc, data, channel, true);
++              cc->cc_nrpn_msb = msb;
+               cc->nrpn_set = 1;
+               cc->cc_nrpn_lsb = lsb;
+-              return 0; // skip
++              return ret;
+       case UMP_CC_DATA:
+-              cc->cc_data_msb = msb;
+-              fallthrough;
+       case UMP_CC_DATA_LSB:
++              cc->cc_data_msb_set = cc->cc_data_lsb_set = 1;
++              cc->cc_data_msb = msb;
+               cc->cc_data_lsb = lsb;
+-              if (!(cc->rpn_set || cc->nrpn_set))
+-                      return 0; // skip
+-              fill_rpn(cc, data, channel);
+-              return 1;
++              return fill_rpn(cc, data, channel, false);
+       }
+       data->cc.status = UMP_MSG_STATUS_CC;
+-- 
+2.43.0
+
diff --git a/queue-6.6/alsa-seq-ump-use-the-common-rpn-bank-conversion-cont.patch b/queue-6.6/alsa-seq-ump-use-the-common-rpn-bank-conversion-cont.patch
new file mode 100644 (file)
index 0000000..f819f6e
--- /dev/null
@@ -0,0 +1,113 @@
+From bcefa23d66b94805517369a93ba2794f7a6759fe Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 31 Jul 2024 15:05:24 +0200
+Subject: ALSA: seq: ump: Use the common RPN/bank conversion context
+
+From: Takashi Iwai <tiwai@suse.de>
+
+[ Upstream commit a683030606fa5ff8b722a5e28839d19288011ede ]
+
+The UMP core conversion helper API already defines the context needed
+to record the bank and RPN/NRPN values, and we can simply re-use the
+same struct instead of re-defining the same content as a different
+name.
+
+Link: https://patch.msgid.link/20240731130528.12600-4-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/core/seq/seq_ports.h       | 14 ++------------
+ sound/core/seq/seq_ump_convert.c | 10 +++++-----
+ 2 files changed, 7 insertions(+), 17 deletions(-)
+
+diff --git a/sound/core/seq/seq_ports.h b/sound/core/seq/seq_ports.h
+index b111382f697aa..9e36738c0dd04 100644
+--- a/sound/core/seq/seq_ports.h
++++ b/sound/core/seq/seq_ports.h
+@@ -7,6 +7,7 @@
+ #define __SND_SEQ_PORTS_H
+ #include <sound/seq_kernel.h>
++#include <sound/ump_convert.h>
+ #include "seq_lock.h"
+ /* list of 'exported' ports */
+@@ -42,17 +43,6 @@ struct snd_seq_port_subs_info {
+       int (*close)(void *private_data, struct snd_seq_port_subscribe *info);
+ };
+-/* context for converting from legacy control event to UMP packet */
+-struct snd_seq_ump_midi2_bank {
+-      bool rpn_set;
+-      bool nrpn_set;
+-      bool bank_set;
+-      unsigned char cc_rpn_msb, cc_rpn_lsb;
+-      unsigned char cc_nrpn_msb, cc_nrpn_lsb;
+-      unsigned char cc_data_msb, cc_data_lsb;
+-      unsigned char cc_bank_msb, cc_bank_lsb;
+-};
+-
+ struct snd_seq_client_port {
+       struct snd_seq_addr addr;       /* client/port number */
+@@ -88,7 +78,7 @@ struct snd_seq_client_port {
+       unsigned char ump_group;
+ #if IS_ENABLED(CONFIG_SND_SEQ_UMP)
+-      struct snd_seq_ump_midi2_bank midi2_bank[16]; /* per channel */
++      struct ump_cvt_to_ump_bank midi2_bank[16]; /* per channel */
+ #endif
+ };
+diff --git a/sound/core/seq/seq_ump_convert.c b/sound/core/seq/seq_ump_convert.c
+index d9dacfbe4a9ae..b1bc6d122d92d 100644
+--- a/sound/core/seq/seq_ump_convert.c
++++ b/sound/core/seq/seq_ump_convert.c
+@@ -368,7 +368,7 @@ static int cvt_ump_midi1_to_midi2(struct snd_seq_client *dest,
+       struct snd_seq_ump_event ev_cvt;
+       const union snd_ump_midi1_msg *midi1 = (const union snd_ump_midi1_msg *)event->ump;
+       union snd_ump_midi2_msg *midi2 = (union snd_ump_midi2_msg *)ev_cvt.ump;
+-      struct snd_seq_ump_midi2_bank *cc;
++      struct ump_cvt_to_ump_bank *cc;
+       ev_cvt = *event;
+       memset(&ev_cvt.ump, 0, sizeof(ev_cvt.ump));
+@@ -790,7 +790,7 @@ static int paf_ev_to_ump_midi2(const struct snd_seq_event *event,
+ }
+ /* set up the MIDI2 RPN/NRPN packet data from the parsed info */
+-static void fill_rpn(struct snd_seq_ump_midi2_bank *cc,
++static void fill_rpn(struct ump_cvt_to_ump_bank *cc,
+                    union snd_ump_midi2_msg *data,
+                    unsigned char channel)
+ {
+@@ -822,7 +822,7 @@ static int cc_ev_to_ump_midi2(const struct snd_seq_event *event,
+       unsigned char channel = event->data.control.channel & 0x0f;
+       unsigned char index = event->data.control.param & 0x7f;
+       unsigned char val = event->data.control.value & 0x7f;
+-      struct snd_seq_ump_midi2_bank *cc = &dest_port->midi2_bank[channel];
++      struct ump_cvt_to_ump_bank *cc = &dest_port->midi2_bank[channel];
+       /* process special CC's (bank/rpn/nrpn) */
+       switch (index) {
+@@ -887,7 +887,7 @@ static int pgm_ev_to_ump_midi2(const struct snd_seq_event *event,
+                              unsigned char status)
+ {
+       unsigned char channel = event->data.control.channel & 0x0f;
+-      struct snd_seq_ump_midi2_bank *cc = &dest_port->midi2_bank[channel];
++      struct ump_cvt_to_ump_bank *cc = &dest_port->midi2_bank[channel];
+       data->pg.status = status;
+       data->pg.channel = channel;
+@@ -924,7 +924,7 @@ static int ctrl14_ev_to_ump_midi2(const struct snd_seq_event *event,
+ {
+       unsigned char channel = event->data.control.channel & 0x0f;
+       unsigned char index = event->data.control.param & 0x7f;
+-      struct snd_seq_ump_midi2_bank *cc = &dest_port->midi2_bank[channel];
++      struct ump_cvt_to_ump_bank *cc = &dest_port->midi2_bank[channel];
+       unsigned char msb, lsb;
+       msb = (event->data.control.value >> 7) & 0x7f;
+-- 
+2.43.0
+
diff --git a/queue-6.6/alsa-ump-explicitly-reset-rpn-with-null-rpn.patch b/queue-6.6/alsa-ump-explicitly-reset-rpn-with-null-rpn.patch
new file mode 100644 (file)
index 0000000..0a50b89
--- /dev/null
@@ -0,0 +1,73 @@
+From 5db5dd74bbe2a385e417bb74f531b94994d1aa46 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 31 Jul 2024 15:05:23 +0200
+Subject: ALSA: ump: Explicitly reset RPN with Null RPN
+
+From: Takashi Iwai <tiwai@suse.de>
+
+[ Upstream commit 50a6dd19dca9446475f023eaa652016bfe5b1cbe ]
+
+RPN with 127:127 is treated as a Null RPN, just to reset the
+parameters, and it's not translated to MIDI2.  Although the current
+code can work as is in most cases, better to implement the RPN reset
+explicitly for Null message.
+
+Link: https://patch.msgid.link/20240731130528.12600-3-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/core/ump_convert.c | 19 ++++++++++++++-----
+ 1 file changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/sound/core/ump_convert.c b/sound/core/ump_convert.c
+index 5d1b85e7ac165..0fe13d0316568 100644
+--- a/sound/core/ump_convert.c
++++ b/sound/core/ump_convert.c
+@@ -287,6 +287,15 @@ static int cvt_legacy_system_to_ump(struct ump_cvt_to_ump *cvt,
+       return 4;
+ }
++static void reset_rpn(struct ump_cvt_to_ump_bank *cc)
++{
++      cc->rpn_set = 0;
++      cc->nrpn_set = 0;
++      cc->cc_rpn_msb = cc->cc_rpn_lsb = 0;
++      cc->cc_data_msb = cc->cc_data_lsb = 0;
++      cc->cc_data_msb_set = cc->cc_data_lsb_set = 0;
++}
++
+ static int fill_rpn(struct ump_cvt_to_ump_bank *cc,
+                   union snd_ump_midi2_msg *midi2,
+                   bool flush)
+@@ -312,11 +321,7 @@ static int fill_rpn(struct ump_cvt_to_ump_bank *cc,
+       midi2->rpn.data = upscale_14_to_32bit((cc->cc_data_msb << 7) |
+                                             cc->cc_data_lsb);
+-      cc->rpn_set = 0;
+-      cc->nrpn_set = 0;
+-      cc->cc_rpn_msb = cc->cc_rpn_lsb = 0;
+-      cc->cc_data_msb = cc->cc_data_lsb = 0;
+-      cc->cc_data_msb_set = cc->cc_data_lsb_set = 0;
++      reset_rpn(cc);
+       return 1;
+ }
+@@ -374,11 +379,15 @@ static int cvt_legacy_cmd_to_ump(struct ump_cvt_to_ump *cvt,
+                       ret = fill_rpn(cc, midi2, true);
+                       cc->rpn_set = 1;
+                       cc->cc_rpn_msb = buf[2];
++                      if (cc->cc_rpn_msb == 0x7f && cc->cc_rpn_lsb == 0x7f)
++                              reset_rpn(cc);
+                       return ret;
+               case UMP_CC_RPN_LSB:
+                       ret = fill_rpn(cc, midi2, true);
+                       cc->rpn_set = 1;
+                       cc->cc_rpn_lsb = buf[2];
++                      if (cc->cc_rpn_msb == 0x7f && cc->cc_rpn_lsb == 0x7f)
++                              reset_rpn(cc);
+                       return ret;
+               case UMP_CC_NRPN_MSB:
+                       ret = fill_rpn(cc, midi2, true);
+-- 
+2.43.0
+
diff --git a/queue-6.6/alsa-ump-transmit-rpn-nrpn-message-at-each-msb-lsb-d.patch b/queue-6.6/alsa-ump-transmit-rpn-nrpn-message-at-each-msb-lsb-d.patch
new file mode 100644 (file)
index 0000000..ed87fc6
--- /dev/null
@@ -0,0 +1,150 @@
+From 19cbb4c9091fa84667e0b9da605e82dd583f895d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 31 Jul 2024 15:05:22 +0200
+Subject: ALSA: ump: Transmit RPN/NRPN message at each MSB/LSB data reception
+
+From: Takashi Iwai <tiwai@suse.de>
+
+[ Upstream commit e6ce8a28c768dbbad3f818db286cd0f4c7a921a8 ]
+
+The UMP 1.1 spec says that an RPN/NRPN should be sent when one of the
+following occurs:
+* a CC 38 is received
+* a subsequent CC 6 is received
+* a CC 98, 99, 100, and 101 is received, indicating the last RPN/NRPN
+  message has ended and a new one has started
+
+That said, we should send a partial data even if it's not fully
+filled.  Let's change the UMP conversion helper code to follow that
+rule.
+
+Link: https://patch.msgid.link/20240731130528.12600-2-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/sound/ump_convert.h |  1 +
+ sound/core/ump_convert.c    | 49 ++++++++++++++++++++++++-------------
+ 2 files changed, 33 insertions(+), 17 deletions(-)
+
+diff --git a/include/sound/ump_convert.h b/include/sound/ump_convert.h
+index 28c364c63245d..d099ae27f8491 100644
+--- a/include/sound/ump_convert.h
++++ b/include/sound/ump_convert.h
+@@ -13,6 +13,7 @@ struct ump_cvt_to_ump_bank {
+       unsigned char cc_nrpn_msb, cc_nrpn_lsb;
+       unsigned char cc_data_msb, cc_data_lsb;
+       unsigned char cc_bank_msb, cc_bank_lsb;
++      bool cc_data_msb_set, cc_data_lsb_set;
+ };
+ /* context for converting from MIDI1 byte stream to UMP packet */
+diff --git a/sound/core/ump_convert.c b/sound/core/ump_convert.c
+index f67c44c83fde4..5d1b85e7ac165 100644
+--- a/sound/core/ump_convert.c
++++ b/sound/core/ump_convert.c
+@@ -287,25 +287,37 @@ static int cvt_legacy_system_to_ump(struct ump_cvt_to_ump *cvt,
+       return 4;
+ }
+-static void fill_rpn(struct ump_cvt_to_ump_bank *cc,
+-                   union snd_ump_midi2_msg *midi2)
++static int fill_rpn(struct ump_cvt_to_ump_bank *cc,
++                  union snd_ump_midi2_msg *midi2,
++                  bool flush)
+ {
++      if (!(cc->cc_data_lsb_set || cc->cc_data_msb_set))
++              return 0; // skip
++      /* when not flushing, wait for complete data set */
++      if (!flush && (!cc->cc_data_lsb_set || !cc->cc_data_msb_set))
++              return 0; // skip
++
+       if (cc->rpn_set) {
+               midi2->rpn.status = UMP_MSG_STATUS_RPN;
+               midi2->rpn.bank = cc->cc_rpn_msb;
+               midi2->rpn.index = cc->cc_rpn_lsb;
+-              cc->rpn_set = 0;
+-              cc->cc_rpn_msb = cc->cc_rpn_lsb = 0;
+-      } else {
++      } else if (cc->nrpn_set) {
+               midi2->rpn.status = UMP_MSG_STATUS_NRPN;
+               midi2->rpn.bank = cc->cc_nrpn_msb;
+               midi2->rpn.index = cc->cc_nrpn_lsb;
+-              cc->nrpn_set = 0;
+-              cc->cc_nrpn_msb = cc->cc_nrpn_lsb = 0;
++      } else {
++              return 0; // skip
+       }
++
+       midi2->rpn.data = upscale_14_to_32bit((cc->cc_data_msb << 7) |
+                                             cc->cc_data_lsb);
++
++      cc->rpn_set = 0;
++      cc->nrpn_set = 0;
++      cc->cc_rpn_msb = cc->cc_rpn_lsb = 0;
+       cc->cc_data_msb = cc->cc_data_lsb = 0;
++      cc->cc_data_msb_set = cc->cc_data_lsb_set = 0;
++      return 1;
+ }
+ /* convert to a MIDI 1.0 Channel Voice message */
+@@ -318,6 +330,7 @@ static int cvt_legacy_cmd_to_ump(struct ump_cvt_to_ump *cvt,
+       struct ump_cvt_to_ump_bank *cc;
+       union snd_ump_midi2_msg *midi2 = (union snd_ump_midi2_msg *)data;
+       unsigned char status, channel;
++      int ret;
+       BUILD_BUG_ON(sizeof(union snd_ump_midi1_msg) != 4);
+       BUILD_BUG_ON(sizeof(union snd_ump_midi2_msg) != 8);
+@@ -358,24 +371,29 @@ static int cvt_legacy_cmd_to_ump(struct ump_cvt_to_ump *cvt,
+       case UMP_MSG_STATUS_CC:
+               switch (buf[1]) {
+               case UMP_CC_RPN_MSB:
++                      ret = fill_rpn(cc, midi2, true);
+                       cc->rpn_set = 1;
+                       cc->cc_rpn_msb = buf[2];
+-                      return 0; // skip
++                      return ret;
+               case UMP_CC_RPN_LSB:
++                      ret = fill_rpn(cc, midi2, true);
+                       cc->rpn_set = 1;
+                       cc->cc_rpn_lsb = buf[2];
+-                      return 0; // skip
++                      return ret;
+               case UMP_CC_NRPN_MSB:
++                      ret = fill_rpn(cc, midi2, true);
+                       cc->nrpn_set = 1;
+                       cc->cc_nrpn_msb = buf[2];
+-                      return 0; // skip
++                      return ret;
+               case UMP_CC_NRPN_LSB:
++                      ret = fill_rpn(cc, midi2, true);
+                       cc->nrpn_set = 1;
+                       cc->cc_nrpn_lsb = buf[2];
+-                      return 0; // skip
++                      return ret;
+               case UMP_CC_DATA:
++                      cc->cc_data_msb_set = 1;
+                       cc->cc_data_msb = buf[2];
+-                      return 0; // skip
++                      return fill_rpn(cc, midi2, false);
+               case UMP_CC_BANK_SELECT:
+                       cc->bank_set = 1;
+                       cc->cc_bank_msb = buf[2];
+@@ -385,12 +403,9 @@ static int cvt_legacy_cmd_to_ump(struct ump_cvt_to_ump *cvt,
+                       cc->cc_bank_lsb = buf[2];
+                       return 0; // skip
+               case UMP_CC_DATA_LSB:
++                      cc->cc_data_lsb_set = 1;
+                       cc->cc_data_lsb = buf[2];
+-                      if (cc->rpn_set || cc->nrpn_set)
+-                              fill_rpn(cc, midi2);
+-                      else
+-                              return 0; // skip
+-                      break;
++                      return fill_rpn(cc, midi2, false);
+               default:
+                       midi2->cc.index = buf[1];
+                       midi2->cc.data = upscale_7_to_32bit(buf[2]);
+-- 
+2.43.0
+
diff --git a/queue-6.6/asoc-amd-yc-support-mic-on-hp-14-em0002la.patch b/queue-6.6/asoc-amd-yc-support-mic-on-hp-14-em0002la.patch
new file mode 100644 (file)
index 0000000..97a098b
--- /dev/null
@@ -0,0 +1,41 @@
+From 0cbd216c1eec1416e26d02d046602e67d138aa6f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 28 Jul 2024 22:50:32 -0600
+Subject: ASoC: amd: yc: Support mic on HP 14-em0002la
+
+From: Bruno Ancona <brunoanconasala@gmail.com>
+
+[ Upstream commit c118478665f467e57d06b2354de65974b246b82b ]
+
+Add support for the internal microphone for HP 14-em0002la laptop using
+a quirk entry.
+
+Signed-off-by: Bruno Ancona <brunoanconasala@gmail.com>
+Link: https://patch.msgid.link/20240729045032.223230-1-brunoanconasala@gmail.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/amd/yc/acp6x-mach.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c
+index d597e59863ee3..e933d07614527 100644
+--- a/sound/soc/amd/yc/acp6x-mach.c
++++ b/sound/soc/amd/yc/acp6x-mach.c
+@@ -430,6 +430,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
+                       DMI_MATCH(DMI_BOARD_NAME, "8A3E"),
+               }
+       },
++      {
++              .driver_data = &acp6x_card,
++              .matches = {
++                      DMI_MATCH(DMI_BOARD_VENDOR, "HP"),
++                      DMI_MATCH(DMI_BOARD_NAME, "8B27"),
++              }
++      },
+       {
+               .driver_data = &acp6x_card,
+               .matches = {
+-- 
+2.43.0
+
diff --git a/queue-6.6/asoc-amd-yc-support-mic-on-lenovo-thinkpad-e14-gen-6.patch b/queue-6.6/asoc-amd-yc-support-mic-on-lenovo-thinkpad-e14-gen-6.patch
new file mode 100644 (file)
index 0000000..7634214
--- /dev/null
@@ -0,0 +1,44 @@
+From 20a2d337022fd1587c70ca4d213ef01221c2bcd1 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 7 Aug 2024 02:12:19 +0200
+Subject: ASoC: amd: yc: Support mic on Lenovo Thinkpad E14 Gen 6
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Krzysztof StÄ™pniak <kfs.szk@gmail.com>
+
+[ Upstream commit 23a58b782f864951485d7a0018549729e007cb43 ]
+
+Lenovo Thinkpad E14 Gen 6 (model type 21M3)
+needs a quirk entry for internal mic to work.
+
+Signed-off-by: Krzysztof StÄ™pniak <kfs.szk@gmail.com>
+Link: https://patch.msgid.link/20240807001219.1147-1-kfs.szk@gmail.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/amd/yc/acp6x-mach.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c
+index e933d07614527..f6c1dbd0ebcf5 100644
+--- a/sound/soc/amd/yc/acp6x-mach.c
++++ b/sound/soc/amd/yc/acp6x-mach.c
+@@ -220,6 +220,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
+                       DMI_MATCH(DMI_PRODUCT_NAME, "21J6"),
+               }
+       },
++      {
++              .driver_data = &acp6x_card,
++              .matches = {
++                      DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
++                      DMI_MATCH(DMI_PRODUCT_NAME, "21M3"),
++              }
++      },
+       {
+               .driver_data = &acp6x_card,
+               .matches = {
+-- 
+2.43.0
+
diff --git a/queue-6.6/asoc-codecs-es8326-button-detect-issue.patch b/queue-6.6/asoc-codecs-es8326-button-detect-issue.patch
new file mode 100644 (file)
index 0000000..84c3155
--- /dev/null
@@ -0,0 +1,36 @@
+From 3152ebfe9337f29904ae1bf48b4d690261ef6449 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 7 Aug 2024 10:53:55 +0800
+Subject: ASoC: codecs: ES8326: button detect issue
+
+From: Zhang Yi <zhangyi@everest-semi.com>
+
+[ Upstream commit 4684a2df9c5b3fc914377127faf2515aa9049093 ]
+
+We find that we need to set snd_jack_types to 0. If not,
+there will be a probability of button detection errors
+
+Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
+Link: https://patch.msgid.link/20240807025356.24904-2-zhangyi@everest-semi.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/codecs/es8326.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/sound/soc/codecs/es8326.c b/sound/soc/codecs/es8326.c
+index 6c263086c44d2..32a9b26ee2c89 100644
+--- a/sound/soc/codecs/es8326.c
++++ b/sound/soc/codecs/es8326.c
+@@ -617,6 +617,8 @@ static void es8326_jack_detect_handler(struct work_struct *work)
+               es8326_disable_micbias(es8326->component);
+               if (es8326->jack->status & SND_JACK_HEADPHONE) {
+                       dev_dbg(comp->dev, "Report hp remove event\n");
++                      snd_soc_jack_report(es8326->jack, 0,
++                                  SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2);
+                       snd_soc_jack_report(es8326->jack, 0, SND_JACK_HEADSET);
+                       /* mute adc when mic path switch */
+                       regmap_write(es8326->regmap, ES8326_ADC_SCALE, 0x33);
+-- 
+2.43.0
+
diff --git a/queue-6.6/btrfs-tree-checker-validate-dref-root-and-objectid.patch b/queue-6.6/btrfs-tree-checker-validate-dref-root-and-objectid.patch
new file mode 100644 (file)
index 0000000..2f08e20
--- /dev/null
@@ -0,0 +1,151 @@
+From 33a1450c0335a4cc4ad8ed4d72a5bb2250885acf Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 15 Jul 2024 16:07:07 +0930
+Subject: btrfs: tree-checker: validate dref root and objectid
+
+From: Qu Wenruo <wqu@suse.com>
+
+[ Upstream commit f333a3c7e8323499aa65038e77fe8f3199d4e283 ]
+
+[CORRUPTION]
+There is a bug report that btrfs flips RO due to a corruption in the
+extent tree, the involved dumps looks like this:
+
+       item 188 key (402811572224 168 4096) itemoff 14598 itemsize 79
+               extent refs 3 gen 3678544 flags 1
+               ref#0: extent data backref root 13835058055282163977 objectid 281473384125923 offset 81432576 count 1
+               ref#1: shared data backref parent 1947073626112 count 1
+               ref#2: shared data backref parent 1156030103552 count 1
+ BTRFS critical (device vdc1: state EA): unable to find ref byte nr 402811572224 parent 0 root 265 owner 28703026 offset 81432576 slot 189
+ BTRFS error (device vdc1: state EA): failed to run delayed ref for logical 402811572224 num_bytes 4096 type 178 action 2 ref_mod 1: -2
+
+[CAUSE]
+The corrupted entry is ref#0 of item 188.
+The root number 13835058055282163977 is beyond the upper limit for root
+items (the current limit is 1 << 48), and the objectid also looks
+suspicious.
+
+Only the offset and count is correct.
+
+[ENHANCEMENT]
+Although it's still unknown why we have such many bytes corrupted
+randomly, we can still enhance the tree-checker for data backrefs by:
+
+- Validate the root value
+  For now there should only be 3 types of roots can have data backref:
+  * subvolume trees
+  * data reloc trees
+  * root tree
+    Only for v1 space cache
+
+- validate the objectid value
+  The objectid should be a valid inode number.
+
+Hopefully we can catch such problem in the future with the new checkers.
+
+Reported-by: Kai Krakow <hurikhan77@gmail.com>
+Link: https://lore.kernel.org/linux-btrfs/CAMthOuPjg5RDT-G_LXeBBUUtzt3cq=JywF+D1_h+JYxe=WKp-Q@mail.gmail.com/#t
+Reviewed-by: Filipe Manana <fdmanana@suse.com>
+Signed-off-by: Qu Wenruo <wqu@suse.com>
+Reviewed-by: David Sterba <dsterba@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/btrfs/tree-checker.c | 47 +++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 47 insertions(+)
+
+diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
+index 7ff61909648d7..46c1f74983956 100644
+--- a/fs/btrfs/tree-checker.c
++++ b/fs/btrfs/tree-checker.c
+@@ -1266,6 +1266,19 @@ static void extent_err(const struct extent_buffer *eb, int slot,
+       va_end(args);
+ }
++static bool is_valid_dref_root(u64 rootid)
++{
++      /*
++       * The following tree root objectids are allowed to have a data backref:
++       * - subvolume trees
++       * - data reloc tree
++       * - tree root
++       *   For v1 space cache
++       */
++      return is_fstree(rootid) || rootid == BTRFS_DATA_RELOC_TREE_OBJECTID ||
++             rootid == BTRFS_ROOT_TREE_OBJECTID;
++}
++
+ static int check_extent_item(struct extent_buffer *leaf,
+                            struct btrfs_key *key, int slot,
+                            struct btrfs_key *prev_key)
+@@ -1418,6 +1431,8 @@ static int check_extent_item(struct extent_buffer *leaf,
+               struct btrfs_extent_data_ref *dref;
+               struct btrfs_shared_data_ref *sref;
+               u64 seq;
++              u64 dref_root;
++              u64 dref_objectid;
+               u64 dref_offset;
+               u64 inline_offset;
+               u8 inline_type;
+@@ -1461,11 +1476,26 @@ static int check_extent_item(struct extent_buffer *leaf,
+                */
+               case BTRFS_EXTENT_DATA_REF_KEY:
+                       dref = (struct btrfs_extent_data_ref *)(&iref->offset);
++                      dref_root = btrfs_extent_data_ref_root(leaf, dref);
++                      dref_objectid = btrfs_extent_data_ref_objectid(leaf, dref);
+                       dref_offset = btrfs_extent_data_ref_offset(leaf, dref);
+                       seq = hash_extent_data_ref(
+                                       btrfs_extent_data_ref_root(leaf, dref),
+                                       btrfs_extent_data_ref_objectid(leaf, dref),
+                                       btrfs_extent_data_ref_offset(leaf, dref));
++                      if (unlikely(!is_valid_dref_root(dref_root))) {
++                              extent_err(leaf, slot,
++                                         "invalid data ref root value %llu",
++                                         dref_root);
++                              return -EUCLEAN;
++                      }
++                      if (unlikely(dref_objectid < BTRFS_FIRST_FREE_OBJECTID ||
++                                   dref_objectid > BTRFS_LAST_FREE_OBJECTID)) {
++                              extent_err(leaf, slot,
++                                         "invalid data ref objectid value %llu",
++                                         dref_root);
++                              return -EUCLEAN;
++                      }
+                       if (unlikely(!IS_ALIGNED(dref_offset,
+                                                fs_info->sectorsize))) {
+                               extent_err(leaf, slot,
+@@ -1601,6 +1631,8 @@ static int check_extent_data_ref(struct extent_buffer *leaf,
+               return -EUCLEAN;
+       }
+       for (; ptr < end; ptr += sizeof(*dref)) {
++              u64 root;
++              u64 objectid;
+               u64 offset;
+               /*
+@@ -1608,7 +1640,22 @@ static int check_extent_data_ref(struct extent_buffer *leaf,
+                * overflow from the leaf due to hash collisions.
+                */
+               dref = (struct btrfs_extent_data_ref *)ptr;
++              root = btrfs_extent_data_ref_root(leaf, dref);
++              objectid = btrfs_extent_data_ref_objectid(leaf, dref);
+               offset = btrfs_extent_data_ref_offset(leaf, dref);
++              if (unlikely(!is_valid_dref_root(root))) {
++                      extent_err(leaf, slot,
++                                 "invalid extent data backref root value %llu",
++                                 root);
++                      return -EUCLEAN;
++              }
++              if (unlikely(objectid < BTRFS_FIRST_FREE_OBJECTID ||
++                           objectid > BTRFS_LAST_FREE_OBJECTID)) {
++                      extent_err(leaf, slot,
++                                 "invalid extent data backref objectid value %llu",
++                                 root);
++                      return -EUCLEAN;
++              }
+               if (unlikely(!IS_ALIGNED(offset, leaf->fs_info->sectorsize))) {
+                       extent_err(leaf, slot,
+       "invalid extent data backref offset, have %llu expect aligned to %u",
+-- 
+2.43.0
+
diff --git a/queue-6.6/dma-debug-avoid-deadlock-between-dma-debug-vs-printk.patch b/queue-6.6/dma-debug-avoid-deadlock-between-dma-debug-vs-printk.patch
new file mode 100644 (file)
index 0000000..d82741c
--- /dev/null
@@ -0,0 +1,112 @@
+From fce16b06f49050afc32b2951cd481126771d70b5 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 6 Aug 2024 11:56:45 -0400
+Subject: dma-debug: avoid deadlock between dma debug vs printk and netconsole
+
+From: Rik van Riel <riel@surriel.com>
+
+[ Upstream commit bd44ca3de49cc1badcff7a96010fa2c64f04868c ]
+
+Currently the dma debugging code can end up indirectly calling printk
+under the radix_lock. This happens when a radix tree node allocation
+fails.
+
+This is a problem because the printk code, when used together with
+netconsole, can end up inside the dma debugging code while trying to
+transmit a message over netcons.
+
+This creates the possibility of either a circular deadlock on the same
+CPU, with that CPU trying to grab the radix_lock twice, or an ABBA
+deadlock between different CPUs, where one CPU grabs the console lock
+first and then waits for the radix_lock, while the other CPU is holding
+the radix_lock and is waiting for the console lock.
+
+The trace captured by lockdep is of the ABBA variant.
+
+-> #2 (&dma_entry_hash[i].lock){-.-.}-{2:2}:
+                  _raw_spin_lock_irqsave+0x5a/0x90
+                  debug_dma_map_page+0x79/0x180
+                  dma_map_page_attrs+0x1d2/0x2f0
+                  bnxt_start_xmit+0x8c6/0x1540
+                  netpoll_start_xmit+0x13f/0x180
+                  netpoll_send_skb+0x20d/0x320
+                  netpoll_send_udp+0x453/0x4a0
+                  write_ext_msg+0x1b9/0x460
+                  console_flush_all+0x2ff/0x5a0
+                  console_unlock+0x55/0x180
+                  vprintk_emit+0x2e3/0x3c0
+                  devkmsg_emit+0x5a/0x80
+                  devkmsg_write+0xfd/0x180
+                  do_iter_readv_writev+0x164/0x1b0
+                  vfs_writev+0xf9/0x2b0
+                  do_writev+0x6d/0x110
+                  do_syscall_64+0x80/0x150
+                  entry_SYSCALL_64_after_hwframe+0x4b/0x53
+
+-> #0 (console_owner){-.-.}-{0:0}:
+                  __lock_acquire+0x15d1/0x31a0
+                  lock_acquire+0xe8/0x290
+                  console_flush_all+0x2ea/0x5a0
+                  console_unlock+0x55/0x180
+                  vprintk_emit+0x2e3/0x3c0
+                  _printk+0x59/0x80
+                  warn_alloc+0x122/0x1b0
+                  __alloc_pages_slowpath+0x1101/0x1120
+                  __alloc_pages+0x1eb/0x2c0
+                  alloc_slab_page+0x5f/0x150
+                  new_slab+0x2dc/0x4e0
+                  ___slab_alloc+0xdcb/0x1390
+                  kmem_cache_alloc+0x23d/0x360
+                  radix_tree_node_alloc+0x3c/0xf0
+                  radix_tree_insert+0xf5/0x230
+                  add_dma_entry+0xe9/0x360
+                  dma_map_page_attrs+0x1d2/0x2f0
+                  __bnxt_alloc_rx_frag+0x147/0x180
+                  bnxt_alloc_rx_data+0x79/0x160
+                  bnxt_rx_skb+0x29/0xc0
+                  bnxt_rx_pkt+0xe22/0x1570
+                  __bnxt_poll_work+0x101/0x390
+                  bnxt_poll+0x7e/0x320
+                  __napi_poll+0x29/0x160
+                  net_rx_action+0x1e0/0x3e0
+                  handle_softirqs+0x190/0x510
+                  run_ksoftirqd+0x4e/0x90
+                  smpboot_thread_fn+0x1a8/0x270
+                  kthread+0x102/0x120
+                  ret_from_fork+0x2f/0x40
+                  ret_from_fork_asm+0x11/0x20
+
+This bug is more likely than it seems, because when one CPU has run out
+of memory, chances are the other has too.
+
+The good news is, this bug is hidden behind the CONFIG_DMA_API_DEBUG, so
+not many users are likely to trigger it.
+
+Signed-off-by: Rik van Riel <riel@surriel.com>
+Reported-by: Konstantin Ovsepian <ovs@meta.com>
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ kernel/dma/debug.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c
+index 06366acd27b08..e472cc37d7de4 100644
+--- a/kernel/dma/debug.c
++++ b/kernel/dma/debug.c
+@@ -415,8 +415,11 @@ static unsigned long long phys_addr(struct dma_debug_entry *entry)
+  * dma_active_cacheline entry to track per event.  dma_map_sg(), on the
+  * other hand, consumes a single dma_debug_entry, but inserts 'nents'
+  * entries into the tree.
++ *
++ * Use __GFP_NOWARN because the printk from an OOM, to netconsole, could end
++ * up right back in the DMA debugging code, leading to a deadlock.
+  */
+-static RADIX_TREE(dma_active_cacheline, GFP_ATOMIC);
++static RADIX_TREE(dma_active_cacheline, GFP_ATOMIC | __GFP_NOWARN);
+ static DEFINE_SPINLOCK(radix_lock);
+ #define ACTIVE_CACHELINE_MAX_OVERLAP ((1 << RADIX_TREE_MAX_TAGS) - 1)
+ #define CACHELINE_PER_PAGE_SHIFT (PAGE_SHIFT - L1_CACHE_SHIFT)
+-- 
+2.43.0
+
diff --git a/queue-6.6/drm-fb-helper-don-t-schedule_work-to-flush-frame-buf.patch b/queue-6.6/drm-fb-helper-don-t-schedule_work-to-flush-frame-buf.patch
new file mode 100644 (file)
index 0000000..df56c97
--- /dev/null
@@ -0,0 +1,91 @@
+From d8ce7b1a5a664f161b993b14a6450c8451183a71 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 3 Jul 2024 22:17:37 +0800
+Subject: drm/fb-helper: Don't schedule_work() to flush frame buffer during
+ panic()
+
+From: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
+
+[ Upstream commit 833cd3e9ad8360785b6c23c82dd3856df00732d9 ]
+
+Sometimes the system [1] hangs on x86 I/O machine checks. However, the
+expected behavior is to reboot the system, as the machine check handler
+ultimately triggers a panic(), initiating a reboot in the last step.
+
+The root cause is that sometimes the panic() is blocked when
+drm_fb_helper_damage() invoking schedule_work() to flush the frame buffer.
+This occurs during the process of flushing all messages to the frame
+buffer driver as shown in the following call trace:
+
+  Machine check occurs [2]:
+    panic()
+      console_flush_on_panic()
+        console_flush_all()
+          console_emit_next_record()
+            con->write()
+              vt_console_print()
+                hide_cursor()
+                  vc->vc_sw->con_cursor()
+                    fbcon_cursor()
+                      ops->cursor()
+                        bit_cursor()
+                          soft_cursor()
+                            info->fbops->fb_imageblit()
+                              drm_fbdev_generic_defio_imageblit()
+                                drm_fb_helper_damage_area()
+                                  drm_fb_helper_damage()
+                                    schedule_work() // <--- blocked here
+    ...
+    emergency_restart()  // wasn't invoked, so no reboot.
+
+During panic(), except the panic CPU, all the other CPUs are stopped.
+In schedule_work(), the panic CPU requires the lock of worker_pool to
+queue the work on that pool, while the lock may have been token by some
+other stopped CPU. So schedule_work() is blocked.
+
+Additionally, during a panic(), since there is no opportunity to execute
+any scheduled work, it's safe to fix this issue by skipping schedule_work()
+on 'oops_in_progress' in drm_fb_helper_damage().
+
+[1] Enable the kernel option CONFIG_FRAMEBUFFER_CONSOLE,
+    CONFIG_DRM_FBDEV_EMULATION, and boot with the 'console=tty0'
+    kernel command line parameter.
+
+[2] Set 'panic_timeout' to a non-zero value before calling panic().
+
+Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
+Reported-by: Yudong Wang <yudong.wang@intel.com>
+Tested-by: Yudong Wang <yudong.wang@intel.com>
+Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20240703141737.75378-1-qiuxu.zhuo@intel.com
+Signed-off-by: Maarten Lankhorst,,, <maarten.lankhorst@linux.intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/drm_fb_helper.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
+index 117237d3528bd..618b045230336 100644
+--- a/drivers/gpu/drm/drm_fb_helper.c
++++ b/drivers/gpu/drm/drm_fb_helper.c
+@@ -631,6 +631,17 @@ static void drm_fb_helper_add_damage_clip(struct drm_fb_helper *helper, u32 x, u
+ static void drm_fb_helper_damage(struct drm_fb_helper *helper, u32 x, u32 y,
+                                u32 width, u32 height)
+ {
++      /*
++       * This function may be invoked by panic() to flush the frame
++       * buffer, where all CPUs except the panic CPU are stopped.
++       * During the following schedule_work(), the panic CPU needs
++       * the worker_pool lock, which might be held by a stopped CPU,
++       * causing schedule_work() and panic() to block. Return early on
++       * oops_in_progress to prevent this blocking.
++       */
++      if (oops_in_progress)
++              return;
++
+       drm_fb_helper_add_damage_clip(helper, x, y, width, height);
+       schedule_work(&helper->damage_work);
+-- 
+2.43.0
+
diff --git a/queue-6.6/drm-panel-orientation-quirks-add-quirk-for-orangepi-.patch b/queue-6.6/drm-panel-orientation-quirks-add-quirk-for-orangepi-.patch
new file mode 100644 (file)
index 0000000..a214382
--- /dev/null
@@ -0,0 +1,41 @@
+From acf097a39460e671a82e3f655012eade77adaf78 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 15 Jul 2024 11:57:49 +0700
+Subject: drm: panel-orientation-quirks: Add quirk for OrangePi Neo
+
+From: Philip Mueller <philm@manjaro.org>
+
+[ Upstream commit d60c429610a14560085d98fa6f4cdb43040ca8f0 ]
+
+This adds a DMI orientation quirk for the OrangePi Neo Linux Gaming
+Handheld.
+
+Signed-off-by: Philip Mueller <philm@manjaro.org>
+Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20240715045818.1019979-1-philm@manjaro.org
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/drm_panel_orientation_quirks.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/drivers/gpu/drm/drm_panel_orientation_quirks.c b/drivers/gpu/drm/drm_panel_orientation_quirks.c
+index 5db52d6c5c35c..039da0d1a613b 100644
+--- a/drivers/gpu/drm/drm_panel_orientation_quirks.c
++++ b/drivers/gpu/drm/drm_panel_orientation_quirks.c
+@@ -414,6 +414,12 @@ static const struct dmi_system_id orientation_data[] = {
+                 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "ONE XPLAYER"),
+               },
+               .driver_data = (void *)&lcd1600x2560_leftside_up,
++      }, {    /* OrangePi Neo */
++              .matches = {
++                DMI_EXACT_MATCH(DMI_SYS_VENDOR, "OrangePi"),
++                DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "NEO-01"),
++              },
++              .driver_data = (void *)&lcd1200x1920_rightside_up,
+       }, {    /* Samsung GalaxyBook 10.6 */
+               .matches = {
+                 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
+-- 
+2.43.0
+
diff --git a/queue-6.6/i2c-fix-conditional-for-substituting-empty-acpi-func.patch b/queue-6.6/i2c-fix-conditional-for-substituting-empty-acpi-func.patch
new file mode 100644 (file)
index 0000000..0a46039
--- /dev/null
@@ -0,0 +1,39 @@
+From d97bacbe3689b9001e1520ef372173f2d2c8a96f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 2 Aug 2024 16:22:14 +0100
+Subject: i2c: Fix conditional for substituting empty ACPI functions
+
+From: Richard Fitzgerald <rf@opensource.cirrus.com>
+
+[ Upstream commit f17c06c6608ad4ecd2ccf321753fb511812d821b ]
+
+Add IS_ENABLED(CONFIG_I2C) to the conditional around a bunch of ACPI
+functions.
+
+The conditional around these functions depended only on CONFIG_ACPI.
+But the functions are implemented in I2C core, so are only present if
+CONFIG_I2C is enabled.
+
+Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
+Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/linux/i2c.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/linux/i2c.h b/include/linux/i2c.h
+index 0dae9db275380..296e7e73a75ef 100644
+--- a/include/linux/i2c.h
++++ b/include/linux/i2c.h
+@@ -1033,7 +1033,7 @@ static inline int of_i2c_get_board_info(struct device *dev,
+ struct acpi_resource;
+ struct acpi_resource_i2c_serialbus;
+-#if IS_ENABLED(CONFIG_ACPI)
++#if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_I2C)
+ bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares,
+                              struct acpi_resource_i2c_serialbus **i2c);
+ int i2c_acpi_client_count(struct acpi_device *adev);
+-- 
+2.43.0
+
diff --git a/queue-6.6/mptcp-make-pm_remove_addrs_and_subflows-static.patch b/queue-6.6/mptcp-make-pm_remove_addrs_and_subflows-static.patch
new file mode 100644 (file)
index 0000000..92f0204
--- /dev/null
@@ -0,0 +1,56 @@
+From 2a2cb9c7416c51f3552ae8dc19b148eebd784348 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 1 Mar 2024 19:18:25 +0100
+Subject: mptcp: make pm_remove_addrs_and_subflows static
+
+From: Geliang Tang <tanggeliang@kylinos.cn>
+
+[ Upstream commit e38b117d7f3b4a5d810f6d0069ad0f643e503796 ]
+
+mptcp_pm_remove_addrs_and_subflows() is only used in pm_netlink.c, it's
+no longer used in pm_userspace.c any more since the commit 8b1c94da1e48
+("mptcp: only send RM_ADDR in nl_cmd_remove"). So this patch changes it
+to a static function.
+
+Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
+Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Stable-dep-of: 87b5896f3f78 ("mptcp: pm: fix RM_ADDR ID for the initial subflow")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/mptcp/pm_netlink.c | 4 ++--
+ net/mptcp/protocol.h   | 2 --
+ 2 files changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
+index 7dd10bacc8d28..e40c06a51b167 100644
+--- a/net/mptcp/pm_netlink.c
++++ b/net/mptcp/pm_netlink.c
+@@ -1701,8 +1701,8 @@ void mptcp_pm_remove_addrs(struct mptcp_sock *msk, struct list_head *rm_list)
+       }
+ }
+-void mptcp_pm_remove_addrs_and_subflows(struct mptcp_sock *msk,
+-                                      struct list_head *rm_list)
++static void mptcp_pm_remove_addrs_and_subflows(struct mptcp_sock *msk,
++                                             struct list_head *rm_list)
+ {
+       struct mptcp_rm_list alist = { .nr = 0 }, slist = { .nr = 0 };
+       struct mptcp_pm_addr_entry *entry;
+diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
+index 20736f31dc534..940fd94006489 100644
+--- a/net/mptcp/protocol.h
++++ b/net/mptcp/protocol.h
+@@ -948,8 +948,6 @@ int mptcp_pm_announce_addr(struct mptcp_sock *msk,
+                          bool echo);
+ int mptcp_pm_remove_addr(struct mptcp_sock *msk, const struct mptcp_rm_list *rm_list);
+ void mptcp_pm_remove_addrs(struct mptcp_sock *msk, struct list_head *rm_list);
+-void mptcp_pm_remove_addrs_and_subflows(struct mptcp_sock *msk,
+-                                      struct list_head *rm_list);
+ void mptcp_free_local_addr_list(struct mptcp_sock *msk);
+ int mptcp_nl_cmd_announce(struct sk_buff *skb, struct genl_info *info);
+-- 
+2.43.0
+
diff --git a/queue-6.6/mptcp-pm-fix-rm_addr-id-for-the-initial-subflow.patch b/queue-6.6/mptcp-pm-fix-rm_addr-id-for-the-initial-subflow.patch
new file mode 100644 (file)
index 0000000..7205094
--- /dev/null
@@ -0,0 +1,143 @@
+From 144fe9b6ce7b6f11cea96c87301477354e937bcb Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 28 Aug 2024 08:14:25 +0200
+Subject: mptcp: pm: fix RM_ADDR ID for the initial subflow
+
+From: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+
+[ Upstream commit 87b5896f3f7848130095656739b05881904e2697 ]
+
+The initial subflow has a special local ID: 0. When an endpoint is being
+deleted, it is then important to check if its address is not linked to
+the initial subflow to send the right ID.
+
+If there was an endpoint linked to the initial subflow, msk's
+mpc_endpoint_id field will be set. We can then use this info when an
+endpoint is being removed to see if it is linked to the initial subflow.
+
+So now, the correct IDs are passed to mptcp_pm_nl_rm_addr_or_subflow(),
+it is no longer needed to use mptcp_local_id_match().
+
+Fixes: 3ad14f54bd74 ("mptcp: more accurate MPC endpoint tracking")
+Cc: stable@vger.kernel.org
+Reviewed-by: Mat Martineau <martineau@kernel.org>
+Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/mptcp/pm_netlink.c | 28 +++++++++++++++-------------
+ 1 file changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
+index e40c06a51b167..b780212760a3b 100644
+--- a/net/mptcp/pm_netlink.c
++++ b/net/mptcp/pm_netlink.c
+@@ -826,11 +826,6 @@ int mptcp_pm_nl_mp_prio_send_ack(struct mptcp_sock *msk,
+       return -EINVAL;
+ }
+-static bool mptcp_local_id_match(const struct mptcp_sock *msk, u8 local_id, u8 id)
+-{
+-      return local_id == id || (!local_id && msk->mpc_endpoint_id == id);
+-}
+-
+ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk,
+                                          const struct mptcp_rm_list *rm_list,
+                                          enum linux_mptcp_mib_field rm_type)
+@@ -867,7 +862,7 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk,
+                               continue;
+                       if (rm_type == MPTCP_MIB_RMADDR && remote_id != rm_id)
+                               continue;
+-                      if (rm_type == MPTCP_MIB_RMSUBFLOW && !mptcp_local_id_match(msk, id, rm_id))
++                      if (rm_type == MPTCP_MIB_RMSUBFLOW && id != rm_id)
+                               continue;
+                       pr_debug(" -> %s rm_list_ids[%d]=%u local_id=%u remote_id=%u mpc_id=%u",
+@@ -1506,6 +1501,12 @@ static bool remove_anno_list_by_saddr(struct mptcp_sock *msk,
+       return false;
+ }
++static u8 mptcp_endp_get_local_id(struct mptcp_sock *msk,
++                                const struct mptcp_addr_info *addr)
++{
++      return msk->mpc_endpoint_id == addr->id ? 0 : addr->id;
++}
++
+ static bool mptcp_pm_remove_anno_addr(struct mptcp_sock *msk,
+                                     const struct mptcp_addr_info *addr,
+                                     bool force)
+@@ -1513,7 +1514,7 @@ static bool mptcp_pm_remove_anno_addr(struct mptcp_sock *msk,
+       struct mptcp_rm_list list = { .nr = 0 };
+       bool ret;
+-      list.ids[list.nr++] = addr->id;
++      list.ids[list.nr++] = mptcp_endp_get_local_id(msk, addr);
+       ret = remove_anno_list_by_saddr(msk, addr);
+       if (ret || force) {
+@@ -1540,14 +1541,12 @@ static int mptcp_nl_remove_subflow_and_signal_addr(struct net *net,
+                                                  const struct mptcp_pm_addr_entry *entry)
+ {
+       const struct mptcp_addr_info *addr = &entry->addr;
+-      struct mptcp_rm_list list = { .nr = 0 };
++      struct mptcp_rm_list list = { .nr = 1 };
+       long s_slot = 0, s_num = 0;
+       struct mptcp_sock *msk;
+       pr_debug("remove_id=%d", addr->id);
+-      list.ids[list.nr++] = addr->id;
+-
+       while ((msk = mptcp_token_iter_next(net, &s_slot, &s_num)) != NULL) {
+               struct sock *sk = (struct sock *)msk;
+               bool remove_subflow;
+@@ -1565,6 +1564,7 @@ static int mptcp_nl_remove_subflow_and_signal_addr(struct net *net,
+               mptcp_pm_remove_anno_addr(msk, addr, remove_subflow &&
+                                         !(entry->flags & MPTCP_PM_ADDR_FLAG_IMPLICIT));
++              list.ids[0] = mptcp_endp_get_local_id(msk, addr);
+               if (remove_subflow) {
+                       spin_lock_bh(&msk->pm.lock);
+                       mptcp_pm_nl_rm_subflow_received(msk, &list);
+@@ -1673,6 +1673,7 @@ static int mptcp_nl_cmd_del_addr(struct sk_buff *skb, struct genl_info *info)
+       return ret;
+ }
++/* Called from the userspace PM only */
+ void mptcp_pm_remove_addrs(struct mptcp_sock *msk, struct list_head *rm_list)
+ {
+       struct mptcp_rm_list alist = { .nr = 0 };
+@@ -1701,6 +1702,7 @@ void mptcp_pm_remove_addrs(struct mptcp_sock *msk, struct list_head *rm_list)
+       }
+ }
++/* Called from the in-kernel PM only */
+ static void mptcp_pm_remove_addrs_and_subflows(struct mptcp_sock *msk,
+                                              struct list_head *rm_list)
+ {
+@@ -1710,11 +1712,11 @@ static void mptcp_pm_remove_addrs_and_subflows(struct mptcp_sock *msk,
+       list_for_each_entry(entry, rm_list, list) {
+               if (slist.nr < MPTCP_RM_IDS_MAX &&
+                   lookup_subflow_by_saddr(&msk->conn_list, &entry->addr))
+-                      slist.ids[slist.nr++] = entry->addr.id;
++                      slist.ids[slist.nr++] = mptcp_endp_get_local_id(msk, &entry->addr);
+               if (alist.nr < MPTCP_RM_IDS_MAX &&
+                   remove_anno_list_by_saddr(msk, &entry->addr))
+-                      alist.ids[alist.nr++] = entry->addr.id;
++                      alist.ids[alist.nr++] = mptcp_endp_get_local_id(msk, &entry->addr);
+       }
+       spin_lock_bh(&msk->pm.lock);
+@@ -2002,7 +2004,7 @@ static void mptcp_pm_nl_fullmesh(struct mptcp_sock *msk,
+ {
+       struct mptcp_rm_list list = { .nr = 0 };
+-      list.ids[list.nr++] = addr->id;
++      list.ids[list.nr++] = mptcp_endp_get_local_id(msk, addr);
+       spin_lock_bh(&msk->pm.lock);
+       mptcp_pm_nl_rm_subflow_received(msk, &list);
+-- 
+2.43.0
+
diff --git a/queue-6.6/net-mlx5-dr-fix-stack-guard-page-was-hit-error-in-dr.patch b/queue-6.6/net-mlx5-dr-fix-stack-guard-page-was-hit-error-in-dr.patch
new file mode 100644 (file)
index 0000000..f085ef2
--- /dev/null
@@ -0,0 +1,42 @@
+From a523103a29d2b3ff526b133f7d4563e6e685bc7c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 30 Jul 2024 09:16:32 +0300
+Subject: net/mlx5: DR, Fix 'stack guard page was hit' error in dr_rule
+
+From: Yevgeny Kliteynik <kliteyn@nvidia.com>
+
+[ Upstream commit 94a3ad6c081381fa9ee523781789802b4ed00faf ]
+
+This patch reduces the size of hw_ste_arr_optimized array that is
+allocated on stack from 640 bytes (5 match STEs + 5 action STES)
+to 448 bytes (2 match STEs + 5 action STES).
+This fixes the 'stack guard page was hit' issue, while still fitting
+majority of the usecases (up to 2 match STEs).
+
+Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
+Reviewed-by: Alex Vesker <valex@nvidia.com>
+Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
+Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
+Link: https://patch.msgid.link/20240730061638.1831002-4-tariqt@nvidia.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c
+index 042ca03491243..d1db04baa1fa6 100644
+--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c
++++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c
+@@ -7,7 +7,7 @@
+ /* don't try to optimize STE allocation if the stack is too constaraining */
+ #define DR_RULE_MAX_STES_OPTIMIZED 0
+ #else
+-#define DR_RULE_MAX_STES_OPTIMIZED 5
++#define DR_RULE_MAX_STES_OPTIMIZED 2
+ #endif
+ #define DR_RULE_MAX_STE_CHAIN_OPTIMIZED (DR_RULE_MAX_STES_OPTIMIZED + DR_ACTION_MAX_STES)
+-- 
+2.43.0
+
diff --git a/queue-6.6/net-usb-qmi_wwan-add-meig-smart-srm825l.patch b/queue-6.6/net-usb-qmi_wwan-add-meig-smart-srm825l.patch
new file mode 100644 (file)
index 0000000..c1d1fc6
--- /dev/null
@@ -0,0 +1,64 @@
+From 96a4c17e852aba209b21803aefba780321cc792e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 3 Aug 2024 15:46:51 +0800
+Subject: net: usb: qmi_wwan: add MeiG Smart SRM825L
+
+From: ZHANG Yuntian <yt@radxa.com>
+
+[ Upstream commit 1ca645a2f74a4290527ae27130c8611391b07dbf ]
+
+Add support for MeiG Smart SRM825L which is based on Qualcomm 315 chip.
+
+T:  Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=5000 MxCh= 0
+D:  Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  1
+P:  Vendor=2dee ProdID=4d22 Rev= 4.14
+S:  Manufacturer=MEIG
+S:  Product=LTE-A Module
+S:  SerialNumber=6f345e48
+C:* #Ifs= 6 Cfg#= 1 Atr=80 MxPwr=896mA
+I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
+E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
+E:  Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
+I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
+E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
+E:  Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
+E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
+I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
+E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
+E:  Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
+E:  Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
+I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option
+E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
+E:  Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
+E:  Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
+I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
+E:  Ad=05(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
+E:  Ad=88(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
+I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=50 Driver=qmi_wwan
+E:  Ad=89(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
+E:  Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
+E:  Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
+
+Signed-off-by: ZHANG Yuntian <yt@radxa.com>
+Link: https://patch.msgid.link/D1EB81385E405DFE+20240803074656.567061-1-yt@radxa.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/usb/qmi_wwan.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
+index b1380cf1b13ab..92c1500fa7c44 100644
+--- a/drivers/net/usb/qmi_wwan.c
++++ b/drivers/net/usb/qmi_wwan.c
+@@ -1438,6 +1438,7 @@ static const struct usb_device_id products[] = {
+       {QMI_QUIRK_SET_DTR(0x1546, 0x1312, 4)}, /* u-blox LARA-R6 01B */
+       {QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 */
+       {QMI_QUIRK_SET_DTR(0x33f8, 0x0104, 4)}, /* Rolling RW101 RMNET */
++      {QMI_FIXED_INTF(0x2dee, 0x4d22, 5)},    /* MeiG Smart SRM825L */
+       /* 4. Gobi 1000 devices */
+       {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)},    /* Acer Gobi Modem Device */
+-- 
+2.43.0
+
diff --git a/queue-6.6/scsi-ufs-core-bypass-quick-recovery-if-force-reset-i.patch b/queue-6.6/scsi-ufs-core-bypass-quick-recovery-if-force-reset-i.patch
new file mode 100644 (file)
index 0000000..cbb052c
--- /dev/null
@@ -0,0 +1,39 @@
+From 86226cefef0aad609d7a7a2a403a70d74a5d7e28 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 12 Jul 2024 17:45:06 +0800
+Subject: scsi: ufs: core: Bypass quick recovery if force reset is needed
+
+From: Peter Wang <peter.wang@mediatek.com>
+
+[ Upstream commit 022587d8aec3da1d1698ddae9fb8cfe35f3ad49c ]
+
+If force_reset is true, bypass quick recovery.  This will shorten error
+recovery time.
+
+Signed-off-by: Peter Wang <peter.wang@mediatek.com>
+Link: https://lore.kernel.org/r/20240712094506.11284-1-peter.wang@mediatek.com
+Reviewed-by: Bean Huo <beanhuo@micron.com>
+Reviewed-by: Bart Van Assche <bvanassche@acm.org>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/ufs/core/ufshcd.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
+index bfa9f457f24ea..ad0ef5b6b8cf9 100644
+--- a/drivers/ufs/core/ufshcd.c
++++ b/drivers/ufs/core/ufshcd.c
+@@ -6467,7 +6467,8 @@ static void ufshcd_err_handler(struct work_struct *work)
+       if (ufshcd_err_handling_should_stop(hba))
+               goto skip_err_handling;
+-      if (hba->dev_quirks & UFS_DEVICE_QUIRK_RECOVERY_FROM_DL_NAC_ERRORS) {
++      if ((hba->dev_quirks & UFS_DEVICE_QUIRK_RECOVERY_FROM_DL_NAC_ERRORS) &&
++          !hba->force_reset) {
+               bool ret;
+               spin_unlock_irqrestore(hba->host->host_lock, flags);
+-- 
+2.43.0
+
diff --git a/queue-6.6/scsi-ufs-core-check-lsdbs-cap-when-mcq.patch b/queue-6.6/scsi-ufs-core-check-lsdbs-cap-when-mcq.patch
new file mode 100644 (file)
index 0000000..001eccc
--- /dev/null
@@ -0,0 +1,88 @@
+From 432fb759066d16caef22de7fcbfa1403c0ab7c8b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 10 Jul 2024 08:25:20 +0900
+Subject: scsi: ufs: core: Check LSDBS cap when !mcq
+
+From: Kyoungrul Kim <k831.kim@samsung.com>
+
+[ Upstream commit 0c60eb0cc320fffbb8b10329d276af14f6f5e6bf ]
+
+If the user sets use_mcq_mode to 0, the host will try to activate the LSDB
+mode unconditionally even when the LSDBS of device HCI cap is 1. This makes
+commands time out and causes device probing to fail.
+
+To prevent that problem, check the LSDBS cap when MCQ is not supported.
+
+Signed-off-by: Kyoungrul Kim <k831.kim@samsung.com>
+Link: https://lore.kernel.org/r/20240709232520epcms2p8ebdb5c4fccc30a6221390566589bf122@epcms2p8
+Reviewed-by: Bart Van Assche <bvanassche@acm.org>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/ufs/core/ufshcd.c | 16 ++++++++++++++++
+ include/ufs/ufshcd.h      |  1 +
+ include/ufs/ufshci.h      |  1 +
+ 3 files changed, 18 insertions(+)
+
+diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
+index 94edac17b95f8..bfa9f457f24ea 100644
+--- a/drivers/ufs/core/ufshcd.c
++++ b/drivers/ufs/core/ufshcd.c
+@@ -2281,7 +2281,17 @@ static inline int ufshcd_hba_capabilities(struct ufs_hba *hba)
+               return err;
+       }
++      /*
++       * The UFSHCI 3.0 specification does not define MCQ_SUPPORT and
++       * LSDB_SUPPORT, but [31:29] as reserved bits with reset value 0s, which
++       * means we can simply read values regardless of version.
++       */
+       hba->mcq_sup = FIELD_GET(MASK_MCQ_SUPPORT, hba->capabilities);
++      /*
++       * 0h: legacy single doorbell support is available
++       * 1h: indicate that legacy single doorbell support has been removed
++       */
++      hba->lsdb_sup = !FIELD_GET(MASK_LSDB_SUPPORT, hba->capabilities);
+       if (!hba->mcq_sup)
+               return 0;
+@@ -10386,6 +10396,12 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
+       }
+       if (!is_mcq_supported(hba)) {
++              if (!hba->lsdb_sup) {
++                      dev_err(hba->dev, "%s: failed to initialize (legacy doorbell mode not supported)\n",
++                              __func__);
++                      err = -EINVAL;
++                      goto out_disable;
++              }
+               err = scsi_add_host(host, hba->dev);
+               if (err) {
+                       dev_err(hba->dev, "scsi_add_host failed\n");
+diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
+index e4da397360682..2a7d6f269d9e3 100644
+--- a/include/ufs/ufshcd.h
++++ b/include/ufs/ufshcd.h
+@@ -1064,6 +1064,7 @@ struct ufs_hba {
+       bool ext_iid_sup;
+       bool scsi_host_added;
+       bool mcq_sup;
++      bool lsdb_sup;
+       bool mcq_enabled;
+       struct ufshcd_res_info res[RES_MAX];
+       void __iomem *mcq_base;
+diff --git a/include/ufs/ufshci.h b/include/ufs/ufshci.h
+index d5accacae6bca..ae93b30d25893 100644
+--- a/include/ufs/ufshci.h
++++ b/include/ufs/ufshci.h
+@@ -75,6 +75,7 @@ enum {
+       MASK_OUT_OF_ORDER_DATA_DELIVERY_SUPPORT = 0x02000000,
+       MASK_UIC_DME_TEST_MODE_SUPPORT          = 0x04000000,
+       MASK_CRYPTO_SUPPORT                     = 0x10000000,
++      MASK_LSDB_SUPPORT                       = 0x20000000,
+       MASK_MCQ_SUPPORT                        = 0x40000000,
+ };
+-- 
+2.43.0
+
diff --git a/queue-6.6/selftests-mptcp-add-explicit-test-case-for-remove-re.patch b/queue-6.6/selftests-mptcp-add-explicit-test-case-for-remove-re.patch
new file mode 100644 (file)
index 0000000..b8a0e83
--- /dev/null
@@ -0,0 +1,65 @@
+From 8e36d4e24e50f1c8e0bd6d7384eb233e800573ad Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 27 Jul 2024 11:04:01 +0200
+Subject: selftests: mptcp: add explicit test case for remove/readd
+
+From: Paolo Abeni <pabeni@redhat.com>
+
+[ Upstream commit b5e2fb832f48bc01d937a053e0550a1465a2f05d ]
+
+Delete and re-create a signal endpoint and ensure that the PM
+actually deletes and re-create the subflow.
+
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Stable-dep-of: 1c2326fcae4f ("selftests: mptcp: join: check re-adding init endp with != id")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ .../testing/selftests/net/mptcp/mptcp_join.sh | 29 +++++++++++++++++++
+ 1 file changed, 29 insertions(+)
+
+diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
+index 59fdf308c8f14..b5ed323ed9c59 100755
+--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
++++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
+@@ -3734,6 +3734,35 @@ endpoint_tests()
+               chk_join_nr 6 6 6
+               chk_rm_nr 4 4
+       fi
++
++      # remove and re-add
++      if reset "delete re-add signal" &&
++         mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
++              pm_nl_set_limits $ns1 1 1
++              pm_nl_set_limits $ns2 1 1
++              pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal
++              test_linkfail=4 speed=20 \
++                      run_tests $ns1 $ns2 10.0.1.1 &
++              local tests_pid=$!
++
++              wait_mpj $ns2
++              pm_nl_check_endpoint "creation" \
++                      $ns1 10.0.2.1 id 1 flags signal
++              chk_subflow_nr "before delete" 2
++              chk_mptcp_info subflows 1 subflows 1
++
++              pm_nl_del_endpoint $ns1 1 10.0.2.1
++              sleep 0.5
++              chk_subflow_nr "after delete" 1
++              chk_mptcp_info subflows 0 subflows 0
++
++              pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
++              wait_mpj $ns2
++              chk_subflow_nr "after re-add" 2
++              chk_mptcp_info subflows 1 subflows 1
++              mptcp_lib_kill_wait $tests_pid
++      fi
++
+ }
+ # [$1: error message]
+-- 
+2.43.0
+
diff --git a/queue-6.6/selftests-mptcp-declare-event-macros-in-mptcp_lib.patch b/queue-6.6/selftests-mptcp-declare-event-macros-in-mptcp_lib.patch
new file mode 100644 (file)
index 0000000..3d2ed38
--- /dev/null
@@ -0,0 +1,147 @@
+From b2670f19dad2bdd9d5c997bb057f797e9b39d52d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 8 Mar 2024 23:10:21 +0100
+Subject: selftests: mptcp: declare event macros in mptcp_lib
+
+From: Geliang Tang <tanggeliang@kylinos.cn>
+
+[ Upstream commit 23a0485d1c0491a3044026263cf9a0acd33d30a2 ]
+
+MPTCP event macros (SUB_ESTABLISHED, LISTENER_CREATED, LISTENER_CLOSED),
+and the protocol family macros (AF_INET, AF_INET6) are defined in both
+mptcp_join.sh and userspace_pm.sh. In order not to duplicate code, this
+patch declares them all in mptcp_lib.sh with MPTCP_LIB_ prefixs.
+
+Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
+Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Link: https://lore.kernel.org/r/20240308-upstream-net-next-20240308-selftests-mptcp-unification-v1-14-4f42c347b653@kernel.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Stable-dep-of: e93681afcb96 ("selftests: mptcp: join: cannot rm sf if closed")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ .../testing/selftests/net/mptcp/mptcp_join.sh | 23 ++++++++-----------
+ .../testing/selftests/net/mptcp/mptcp_lib.sh  | 11 +++++++++
+ .../selftests/net/mptcp/userspace_pm.sh       | 18 +++++++--------
+ 3 files changed, 29 insertions(+), 23 deletions(-)
+
+diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
+index f03df10947c15..71404a4241f4a 100755
+--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
++++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
+@@ -2894,13 +2894,6 @@ backup_tests()
+       fi
+ }
+-SUB_ESTABLISHED=10 # MPTCP_EVENT_SUB_ESTABLISHED
+-LISTENER_CREATED=15 #MPTCP_EVENT_LISTENER_CREATED
+-LISTENER_CLOSED=16  #MPTCP_EVENT_LISTENER_CLOSED
+-
+-AF_INET=2
+-AF_INET6=10
+-
+ verify_listener_events()
+ {
+       local evt=$1
+@@ -2914,9 +2907,9 @@ verify_listener_events()
+       local sport
+       local name
+-      if [ $e_type = $LISTENER_CREATED ]; then
++      if [ $e_type = $MPTCP_LIB_EVENT_LISTENER_CREATED ]; then
+               name="LISTENER_CREATED"
+-      elif [ $e_type = $LISTENER_CLOSED ]; then
++      elif [ $e_type = $MPTCP_LIB_EVENT_LISTENER_CLOSED ]; then
+               name="LISTENER_CLOSED "
+       else
+               name="$e_type"
+@@ -2983,8 +2976,10 @@ add_addr_ports_tests()
+               chk_add_nr 1 1 1
+               chk_rm_nr 1 1 invert
+-              verify_listener_events $evts_ns1 $LISTENER_CREATED $AF_INET 10.0.2.1 10100
+-              verify_listener_events $evts_ns1 $LISTENER_CLOSED $AF_INET 10.0.2.1 10100
++              verify_listener_events $evts_ns1 $MPTCP_LIB_EVENT_LISTENER_CREATED \
++                                     $MPTCP_LIB_AF_INET 10.0.2.1 10100
++              verify_listener_events $evts_ns1 $MPTCP_LIB_EVENT_LISTENER_CLOSED \
++                                     $MPTCP_LIB_AF_INET 10.0.2.1 10100
+               kill_events_pids
+       fi
+@@ -3593,11 +3588,11 @@ userspace_tests()
+               userspace_pm_chk_get_addr "${ns1}" "10" "id 10 flags signal 10.0.2.1"
+               userspace_pm_chk_get_addr "${ns1}" "20" "id 20 flags signal 10.0.3.1"
+               userspace_pm_rm_addr $ns1 10
+-              userspace_pm_rm_sf $ns1 "::ffff:10.0.2.1" $SUB_ESTABLISHED
++              userspace_pm_rm_sf $ns1 "::ffff:10.0.2.1" $MPTCP_LIB_EVENT_SUB_ESTABLISHED
+               userspace_pm_chk_dump_addr "${ns1}" \
+                       "id 20 flags signal 10.0.3.1" "after rm_addr 10"
+               userspace_pm_rm_addr $ns1 20
+-              userspace_pm_rm_sf $ns1 10.0.3.1 $SUB_ESTABLISHED
++              userspace_pm_rm_sf $ns1 10.0.3.1 $MPTCP_LIB_EVENT_SUB_ESTABLISHED
+               userspace_pm_chk_dump_addr "${ns1}" "" "after rm_addr 20"
+               chk_rm_nr 2 2 invert
+               chk_mptcp_info subflows 0 subflows 0
+@@ -3624,7 +3619,7 @@ userspace_tests()
+                       "subflow"
+               userspace_pm_chk_get_addr "${ns2}" "20" "id 20 flags subflow 10.0.3.2"
+               userspace_pm_rm_addr $ns2 20
+-              userspace_pm_rm_sf $ns2 10.0.3.2 $SUB_ESTABLISHED
++              userspace_pm_rm_sf $ns2 10.0.3.2 $MPTCP_LIB_EVENT_SUB_ESTABLISHED
+               userspace_pm_chk_dump_addr "${ns2}" \
+                       "" \
+                       "after rm_addr 20"
+diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
+index 8939d5c135a0e..d8766b270f307 100644
+--- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh
++++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
+@@ -8,6 +8,17 @@ readonly KSFT_SKIP=4
+ # shellcheck disable=SC2155 # declare and assign separately
+ readonly KSFT_TEST="${MPTCP_LIB_KSFT_TEST:-$(basename "${0}" .sh)}"
++# These variables are used in some selftests, read-only
++declare -rx MPTCP_LIB_EVENT_ANNOUNCED=6         # MPTCP_EVENT_ANNOUNCED
++declare -rx MPTCP_LIB_EVENT_REMOVED=7           # MPTCP_EVENT_REMOVED
++declare -rx MPTCP_LIB_EVENT_SUB_ESTABLISHED=10  # MPTCP_EVENT_SUB_ESTABLISHED
++declare -rx MPTCP_LIB_EVENT_SUB_CLOSED=11       # MPTCP_EVENT_SUB_CLOSED
++declare -rx MPTCP_LIB_EVENT_LISTENER_CREATED=15 # MPTCP_EVENT_LISTENER_CREATED
++declare -rx MPTCP_LIB_EVENT_LISTENER_CLOSED=16  # MPTCP_EVENT_LISTENER_CLOSED
++
++declare -rx MPTCP_LIB_AF_INET=2
++declare -rx MPTCP_LIB_AF_INET6=10
++
+ MPTCP_LIB_SUBTESTS=()
+ # only if supported (or forced) and not disabled, see no-color.org
+diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh
+index 4e58291550498..59bdb17b2b7f4 100755
+--- a/tools/testing/selftests/net/mptcp/userspace_pm.sh
++++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh
+@@ -23,15 +23,15 @@ if ! ip -Version &> /dev/null; then
+       exit ${KSFT_SKIP}
+ fi
+-ANNOUNCED=6        # MPTCP_EVENT_ANNOUNCED
+-REMOVED=7          # MPTCP_EVENT_REMOVED
+-SUB_ESTABLISHED=10 # MPTCP_EVENT_SUB_ESTABLISHED
+-SUB_CLOSED=11      # MPTCP_EVENT_SUB_CLOSED
+-LISTENER_CREATED=15 #MPTCP_EVENT_LISTENER_CREATED
+-LISTENER_CLOSED=16  #MPTCP_EVENT_LISTENER_CLOSED
+-
+-AF_INET=2
+-AF_INET6=10
++ANNOUNCED=${MPTCP_LIB_EVENT_ANNOUNCED}
++REMOVED=${MPTCP_LIB_EVENT_REMOVED}
++SUB_ESTABLISHED=${MPTCP_LIB_EVENT_SUB_ESTABLISHED}
++SUB_CLOSED=${MPTCP_LIB_EVENT_SUB_CLOSED}
++LISTENER_CREATED=${MPTCP_LIB_EVENT_LISTENER_CREATED}
++LISTENER_CLOSED=${MPTCP_LIB_EVENT_LISTENER_CLOSED}
++
++AF_INET=${MPTCP_LIB_AF_INET}
++AF_INET6=${MPTCP_LIB_AF_INET6}
+ file=""
+ server_evts=""
+-- 
+2.43.0
+
diff --git a/queue-6.6/selftests-mptcp-dump-userspace-addrs-list.patch b/queue-6.6/selftests-mptcp-dump-userspace-addrs-list.patch
new file mode 100644 (file)
index 0000000..1efec86
--- /dev/null
@@ -0,0 +1,150 @@
+From 82e53879bd5f186823a9ccfb064dc68dda90c06c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 1 Mar 2024 19:18:34 +0100
+Subject: selftests: mptcp: dump userspace addrs list
+
+From: Geliang Tang <tanggeliang@kylinos.cn>
+
+[ Upstream commit 38f027fca1b724c6814fff4b8ad16b59c14a3e2a ]
+
+This patch adds a new helper userspace_pm_dump() to dump addresses
+for the userspace PM. Use this helper to check whether an ID 0 subflow
+is listed in the output of dump command after creating an ID 0 subflow
+in "userspace pm create id 0 subflow" test. Dump userspace PM addresses
+list in "userspace pm add & remove address" test and in "userspace pm
+create destroy subflow" test.
+
+Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
+Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Reviewed-by: Mat Martineau <martineau@kernel.org>
+Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Stable-dep-of: e93681afcb96 ("selftests: mptcp: join: cannot rm sf if closed")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ .../testing/selftests/net/mptcp/mptcp_join.sh | 61 +++++++++++++++++++
+ 1 file changed, 61 insertions(+)
+
+diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
+index d378f23bb31a6..df071b8c675fb 100755
+--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
++++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
+@@ -21,6 +21,7 @@ cinfail=""
+ cinsent=""
+ tmpfile=""
+ cout=""
++err=""
+ capout=""
+ ns1=""
+ ns2=""
+@@ -187,6 +188,7 @@ init() {
+       cin=$(mktemp)
+       cinsent=$(mktemp)
+       cout=$(mktemp)
++      err=$(mktemp)
+       evts_ns1=$(mktemp)
+       evts_ns2=$(mktemp)
+@@ -202,6 +204,7 @@ cleanup()
+       rm -f "$sin" "$sout" "$cinsent" "$cinfail"
+       rm -f "$tmpfile"
+       rm -rf $evts_ns1 $evts_ns2
++      rm -f "$err"
+       cleanup_partial
+ }
+@@ -3422,6 +3425,50 @@ userspace_pm_rm_sf()
+       wait_rm_sf $1 "${cnt}"
+ }
++check_output()
++{
++      local cmd="$1"
++      local expected="$2"
++      local msg="$3"
++      local rc=0
++
++      mptcp_lib_check_output "${err}" "${cmd}" "${expected}" || rc=${?}
++      if [ ${rc} -eq 2 ]; then
++              fail_test "fail to check output # error ${rc}"
++      elif [ ${rc} -eq 0 ]; then
++              print_ok
++      elif [ ${rc} -eq 1 ]; then
++              fail_test "fail to check output # different output"
++      fi
++}
++
++# $1: ns
++userspace_pm_dump()
++{
++      local evts=$evts_ns1
++      local tk
++
++      [ "$1" == "$ns2" ] && evts=$evts_ns2
++      tk=$(mptcp_lib_evts_get_info token "$evts")
++
++      ip netns exec $1 ./pm_nl_ctl dump token $tk
++}
++
++userspace_pm_chk_dump_addr()
++{
++      local ns="${1}"
++      local exp="${2}"
++      local check="${3}"
++
++      print_check "dump addrs ${check}"
++
++      if mptcp_lib_kallsyms_has "mptcp_userspace_pm_dump_addr$"; then
++              check_output "userspace_pm_dump ${ns}" "${exp}"
++      else
++              print_skip
++      fi
++}
++
+ userspace_tests()
+ {
+       # userspace pm type prevents add_addr
+@@ -3513,10 +3560,16 @@ userspace_tests()
+               chk_mptcp_info subflows 2 subflows 2
+               chk_subflows_total 3 3
+               chk_mptcp_info add_addr_signal 2 add_addr_accepted 2
++              userspace_pm_chk_dump_addr "${ns1}" \
++                      $'id 10 flags signal 10.0.2.1\nid 20 flags signal 10.0.3.1' \
++                      "signal"
+               userspace_pm_rm_addr $ns1 10
+               userspace_pm_rm_sf $ns1 "::ffff:10.0.2.1" $SUB_ESTABLISHED
++              userspace_pm_chk_dump_addr "${ns1}" \
++                      "id 20 flags signal 10.0.3.1" "after rm_addr 10"
+               userspace_pm_rm_addr $ns1 20
+               userspace_pm_rm_sf $ns1 10.0.3.1 $SUB_ESTABLISHED
++              userspace_pm_chk_dump_addr "${ns1}" "" "after rm_addr 20"
+               chk_rm_nr 2 2 invert
+               chk_mptcp_info subflows 0 subflows 0
+               chk_subflows_total 1 1
+@@ -3537,8 +3590,14 @@ userspace_tests()
+               chk_join_nr 1 1 1
+               chk_mptcp_info subflows 1 subflows 1
+               chk_subflows_total 2 2
++              userspace_pm_chk_dump_addr "${ns2}" \
++                      "id 20 flags subflow 10.0.3.2" \
++                      "subflow"
+               userspace_pm_rm_addr $ns2 20
+               userspace_pm_rm_sf $ns2 10.0.3.2 $SUB_ESTABLISHED
++              userspace_pm_chk_dump_addr "${ns2}" \
++                      "" \
++                      "after rm_addr 20"
+               chk_rm_nr 1 1
+               chk_mptcp_info subflows 0 subflows 0
+               chk_subflows_total 1 1
+@@ -3558,6 +3617,8 @@ userspace_tests()
+               chk_mptcp_info subflows 0 subflows 0
+               chk_subflows_total 1 1
+               userspace_pm_add_sf $ns2 10.0.3.2 0
++              userspace_pm_chk_dump_addr "${ns2}" \
++                      "id 0 flags subflow 10.0.3.2" "id 0 subflow"
+               chk_join_nr 1 1 1
+               chk_mptcp_info subflows 1 subflows 1
+               chk_subflows_total 2 2
+-- 
+2.43.0
+
diff --git a/queue-6.6/selftests-mptcp-join-cannot-rm-sf-if-closed.patch b/queue-6.6/selftests-mptcp-join-cannot-rm-sf-if-closed.patch
new file mode 100644 (file)
index 0000000..53ed416
--- /dev/null
@@ -0,0 +1,85 @@
+From 75944eba336e854c45e90492f6145fb48bdbdc3d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 26 Aug 2024 19:11:19 +0200
+Subject: selftests: mptcp: join: cannot rm sf if closed
+
+From: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+
+[ Upstream commit e93681afcb96864ec26c3b2ce94008ce93577373 ]
+
+Thanks to the previous commit, the MPTCP subflows are now closed on both
+directions even when only the MPTCP path-manager of one peer asks for
+their closure.
+
+In the two tests modified here -- "userspace pm add & remove address"
+and "userspace pm create destroy subflow" -- one peer is controlled by
+the userspace PM, and the other one by the in-kernel PM. When the
+userspace PM sends a RM_ADDR notification, the in-kernel PM will
+automatically react by closing all subflows using this address. Now,
+thanks to the previous commit, the subflows are properly closed on both
+directions, the userspace PM can then no longer closes the same
+subflows if they are already closed. Before, it was OK to do that,
+because the subflows were still half-opened, still OK to send a RM_ADDR.
+
+In other words, thanks to the previous commit closing the subflows, an
+error will be returned to the userspace if it tries to close a subflow
+that has already been closed. So no need to run this command, which mean
+that the linked counters will then not be incremented.
+
+These tests are then no longer sending both a RM_ADDR, then closing the
+linked subflow just after. The test with the userspace PM on the server
+side is now removing one subflow linked to one address, then sending
+a RM_ADDR for another address. The test with the userspace PM on the
+client side is now only removing the subflow that was previously
+created.
+
+Fixes: 4369c198e599 ("selftests: mptcp: test userspace pm out of transfer")
+Cc: stable@vger.kernel.org
+Reviewed-by: Mat Martineau <martineau@kernel.org>
+Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Link: https://patch.msgid.link/20240826-net-mptcp-close-extra-sf-fin-v1-2-905199fe1172@kernel.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ tools/testing/selftests/net/mptcp/mptcp_join.sh | 11 ++++-------
+ 1 file changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
+index 71404a4241f4a..59fdf308c8f14 100755
+--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
++++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
+@@ -3587,14 +3587,12 @@ userspace_tests()
+                       "signal"
+               userspace_pm_chk_get_addr "${ns1}" "10" "id 10 flags signal 10.0.2.1"
+               userspace_pm_chk_get_addr "${ns1}" "20" "id 20 flags signal 10.0.3.1"
+-              userspace_pm_rm_addr $ns1 10
+               userspace_pm_rm_sf $ns1 "::ffff:10.0.2.1" $MPTCP_LIB_EVENT_SUB_ESTABLISHED
+               userspace_pm_chk_dump_addr "${ns1}" \
+-                      "id 20 flags signal 10.0.3.1" "after rm_addr 10"
++                      "id 20 flags signal 10.0.3.1" "after rm_sf 10"
+               userspace_pm_rm_addr $ns1 20
+-              userspace_pm_rm_sf $ns1 10.0.3.1 $MPTCP_LIB_EVENT_SUB_ESTABLISHED
+               userspace_pm_chk_dump_addr "${ns1}" "" "after rm_addr 20"
+-              chk_rm_nr 2 2 invert
++              chk_rm_nr 1 1 invert
+               chk_mptcp_info subflows 0 subflows 0
+               chk_subflows_total 1 1
+               kill_events_pids
+@@ -3618,12 +3616,11 @@ userspace_tests()
+                       "id 20 flags subflow 10.0.3.2" \
+                       "subflow"
+               userspace_pm_chk_get_addr "${ns2}" "20" "id 20 flags subflow 10.0.3.2"
+-              userspace_pm_rm_addr $ns2 20
+               userspace_pm_rm_sf $ns2 10.0.3.2 $MPTCP_LIB_EVENT_SUB_ESTABLISHED
+               userspace_pm_chk_dump_addr "${ns2}" \
+                       "" \
+-                      "after rm_addr 20"
+-              chk_rm_nr 1 1
++                      "after rm_sf 20"
++              chk_rm_nr 0 1
+               chk_mptcp_info subflows 0 subflows 0
+               chk_subflows_total 1 1
+               kill_events_pids
+-- 
+2.43.0
+
diff --git a/queue-6.6/selftests-mptcp-join-check-re-adding-init-endp-with-.patch b/queue-6.6/selftests-mptcp-join-check-re-adding-init-endp-with-.patch
new file mode 100644 (file)
index 0000000..3608900
--- /dev/null
@@ -0,0 +1,86 @@
+From 2588076c501e8cf2fc68ee491c72c4029e0bddf2 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 28 Aug 2024 08:14:30 +0200
+Subject: selftests: mptcp: join: check re-adding init endp with != id
+
+From: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+
+[ Upstream commit 1c2326fcae4f0c5de8ad0d734ced43a8e5f17dac ]
+
+The initial subflow has a special local ID: 0. It is specific per
+connection.
+
+When a global endpoint is deleted and re-added later, it can have a
+different ID, but the kernel should still use the ID 0 if it corresponds
+to the initial address.
+
+This test validates this behaviour: the endpoint linked to the initial
+subflow is removed, and re-added with a different ID.
+
+Note that removing the initial subflow will not decrement the 'subflows'
+counters, which corresponds to the *additional* subflows. On the other
+hand, when the same endpoint is re-added, it will increment this
+counter, as it will be seen as an additional subflow this time.
+
+The 'Fixes' tag here below is the same as the one from the previous
+commit: this patch here is not fixing anything wrong in the selftests,
+but it validates the previous fix for an issue introduced by this commit
+ID.
+
+Fixes: 3ad14f54bd74 ("mptcp: more accurate MPC endpoint tracking")
+Cc: stable@vger.kernel.org
+Reviewed-by: Mat Martineau <martineau@kernel.org>
+Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ .../testing/selftests/net/mptcp/mptcp_join.sh | 21 ++++++++++++++-----
+ 1 file changed, 16 insertions(+), 5 deletions(-)
+
+diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
+index 67675ce3b9a38..0ff60b3744c06 100755
+--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
++++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
+@@ -3738,11 +3738,12 @@ endpoint_tests()
+       # remove and re-add
+       if reset "delete re-add signal" &&
+          mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
+-              pm_nl_set_limits $ns1 0 2
+-              pm_nl_set_limits $ns2 2 2
++              pm_nl_set_limits $ns1 0 3
++              pm_nl_set_limits $ns2 3 3
+               pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal
+               # broadcast IP: no packet for this address will be received on ns1
+               pm_nl_add_endpoint $ns1 224.0.0.1 id 2 flags signal
++              pm_nl_add_endpoint $ns1 10.0.1.1 id 42 flags signal
+               test_linkfail=4 speed=20 \
+                       run_tests $ns1 $ns2 10.0.1.1 &
+               local tests_pid=$!
+@@ -3764,11 +3765,21 @@ endpoint_tests()
+               wait_mpj $ns2
+               chk_subflow_nr "after re-add" 3
+               chk_mptcp_info subflows 2 subflows 2
++
++              pm_nl_del_endpoint $ns1 42 10.0.1.1
++              sleep 0.5
++              chk_subflow_nr "after delete ID 0" 2
++              chk_mptcp_info subflows 2 subflows 2
++
++              pm_nl_add_endpoint $ns1 10.0.1.1 id 99 flags signal
++              wait_mpj $ns2
++              chk_subflow_nr "after re-add" 3
++              chk_mptcp_info subflows 3 subflows 3
+               mptcp_lib_kill_wait $tests_pid
+-              chk_join_nr 3 3 3
+-              chk_add_nr 4 4
+-              chk_rm_nr 2 1 invert
++              chk_join_nr 4 4 4
++              chk_add_nr 5 5
++              chk_rm_nr 3 2 invert
+       fi
+ }
+-- 
+2.43.0
+
diff --git a/queue-6.6/selftests-mptcp-join-check-re-using-id-of-unused-add.patch b/queue-6.6/selftests-mptcp-join-check-re-using-id-of-unused-add.patch
new file mode 100644 (file)
index 0000000..521b88f
--- /dev/null
@@ -0,0 +1,85 @@
+From cf8893705722056ebb021efc81c886adb99f5984 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 19 Aug 2024 21:45:20 +0200
+Subject: selftests: mptcp: join: check re-using ID of unused ADD_ADDR
+
+From: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+
+[ Upstream commit a13d5aad4dd9a309eecdc33cfd75045bd5f376a3 ]
+
+This test extends "delete re-add signal" to validate the previous
+commit. An extra address is announced by the server, but this address
+cannot be used by the client. The result is that no subflow will be
+established to this address.
+
+Later, the server will delete this extra endpoint, and set a new one,
+with a valid address, but re-using the same ID. Before the previous
+commit, the server would not have been able to announce this new
+address.
+
+While at it, extra checks have been added to validate the expected
+numbers of MPJ, ADD_ADDR and RM_ADDR.
+
+The 'Fixes' tag here below is the same as the one from the previous
+commit: this patch here is not fixing anything wrong in the selftests,
+but it validates the previous fix for an issue introduced by this commit
+ID.
+
+Fixes: b6c08380860b ("mptcp: remove addr and subflow in PM netlink")
+Cc: stable@vger.kernel.org
+Reviewed-by: Mat Martineau <martineau@kernel.org>
+Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Link: https://patch.msgid.link/20240819-net-mptcp-pm-reusing-id-v1-2-38035d40de5b@kernel.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Stable-dep-of: 1c2326fcae4f ("selftests: mptcp: join: check re-adding init endp with != id")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ .../testing/selftests/net/mptcp/mptcp_join.sh  | 18 +++++++++++++-----
+ 1 file changed, 13 insertions(+), 5 deletions(-)
+
+diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
+index b5ed323ed9c59..67675ce3b9a38 100755
+--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
++++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
+@@ -3738,9 +3738,11 @@ endpoint_tests()
+       # remove and re-add
+       if reset "delete re-add signal" &&
+          mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
+-              pm_nl_set_limits $ns1 1 1
+-              pm_nl_set_limits $ns2 1 1
++              pm_nl_set_limits $ns1 0 2
++              pm_nl_set_limits $ns2 2 2
+               pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal
++              # broadcast IP: no packet for this address will be received on ns1
++              pm_nl_add_endpoint $ns1 224.0.0.1 id 2 flags signal
+               test_linkfail=4 speed=20 \
+                       run_tests $ns1 $ns2 10.0.1.1 &
+               local tests_pid=$!
+@@ -3752,15 +3754,21 @@ endpoint_tests()
+               chk_mptcp_info subflows 1 subflows 1
+               pm_nl_del_endpoint $ns1 1 10.0.2.1
++              pm_nl_del_endpoint $ns1 2 224.0.0.1
+               sleep 0.5
+               chk_subflow_nr "after delete" 1
+               chk_mptcp_info subflows 0 subflows 0
+-              pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
++              pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal
++              pm_nl_add_endpoint $ns1 10.0.3.1 id 2 flags signal
+               wait_mpj $ns2
+-              chk_subflow_nr "after re-add" 2
+-              chk_mptcp_info subflows 1 subflows 1
++              chk_subflow_nr "after re-add" 3
++              chk_mptcp_info subflows 2 subflows 2
+               mptcp_lib_kill_wait $tests_pid
++
++              chk_join_nr 3 3 3
++              chk_add_nr 4 4
++              chk_rm_nr 2 1 invert
+       fi
+ }
+-- 
+2.43.0
+
diff --git a/queue-6.6/selftests-mptcp-userspace-pm-create-id-0-subflow.patch b/queue-6.6/selftests-mptcp-userspace-pm-create-id-0-subflow.patch
new file mode 100644 (file)
index 0000000..9bc8acd
--- /dev/null
@@ -0,0 +1,58 @@
+From 5a5a43b65eaa09e99301b39c79680c036e2664ff Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 28 Nov 2023 15:18:49 -0800
+Subject: selftests: mptcp: userspace pm create id 0 subflow
+
+From: Geliang Tang <geliang.tang@suse.com>
+
+[ Upstream commit b2e2248f365a7ef0687fe048c335fe1a32f98b36 ]
+
+This patch adds a selftest to create id 0 subflow. Pass id 0 to the
+helper userspace_pm_add_sf() to create id 0 subflow. chk_mptcp_info
+shows one subflow but chk_subflows_total shows two subflows in each
+namespace.
+
+Reviewed-by: Matthieu Baerts <matttbe@kernel.org>
+Signed-off-by: Geliang Tang <geliang.tang@suse.com>
+Signed-off-by: Mat Martineau <martineau@kernel.org>
+Link: https://lore.kernel.org/r/20231128-send-net-next-2023107-v4-5-8d6b94150f6b@kernel.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Stable-dep-of: e93681afcb96 ("selftests: mptcp: join: cannot rm sf if closed")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ .../testing/selftests/net/mptcp/mptcp_join.sh | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
+index 2be13dd19ddd2..d378f23bb31a6 100755
+--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
++++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
+@@ -3545,6 +3545,25 @@ userspace_tests()
+               kill_events_pids
+               mptcp_lib_kill_wait $tests_pid
+       fi
++
++      # userspace pm create id 0 subflow
++      if reset_with_events "userspace pm create id 0 subflow" &&
++         continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then
++              set_userspace_pm $ns2
++              pm_nl_set_limits $ns1 0 1
++              speed=5 \
++                      run_tests $ns1 $ns2 10.0.1.1 &
++              local tests_pid=$!
++              wait_mpj $ns2
++              chk_mptcp_info subflows 0 subflows 0
++              chk_subflows_total 1 1
++              userspace_pm_add_sf $ns2 10.0.3.2 0
++              chk_join_nr 1 1 1
++              chk_mptcp_info subflows 1 subflows 1
++              chk_subflows_total 2 2
++              kill_events_pids
++              wait $tests_pid
++      fi
+ }
+ endpoint_tests()
+-- 
+2.43.0
+
diff --git a/queue-6.6/selftests-mptcp-userspace-pm-get-addr-tests.patch b/queue-6.6/selftests-mptcp-userspace-pm-get-addr-tests.patch
new file mode 100644 (file)
index 0000000..755d59d
--- /dev/null
@@ -0,0 +1,90 @@
+From 40e39a7780e8a00fc513040bb60757c475fd8981 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 1 Mar 2024 19:18:39 +0100
+Subject: selftests: mptcp: userspace pm get addr tests
+
+From: Geliang Tang <tanggeliang@kylinos.cn>
+
+[ Upstream commit 4cc5cc7ca052c816e20ed0cbc160299b454cbb75 ]
+
+This patch adds a new helper userspace_pm_get_addr() in mptcp_join.sh.
+In it, parse the token value from the output of 'pm_nl_ctl events', then
+pass it to pm_nl_ctl get_addr command. Use this helper in userspace pm
+dump tests.
+
+Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
+Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Reviewed-by: Mat Martineau <martineau@kernel.org>
+Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Stable-dep-of: e93681afcb96 ("selftests: mptcp: join: cannot rm sf if closed")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ .../testing/selftests/net/mptcp/mptcp_join.sh | 30 +++++++++++++++++++
+ 1 file changed, 30 insertions(+)
+
+diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
+index df071b8c675fb..f03df10947c15 100755
+--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
++++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
+@@ -3454,6 +3454,18 @@ userspace_pm_dump()
+       ip netns exec $1 ./pm_nl_ctl dump token $tk
+ }
++# $1: ns ; $2: id
++userspace_pm_get_addr()
++{
++      local evts=$evts_ns1
++      local tk
++
++      [ "$1" == "$ns2" ] && evts=$evts_ns2
++      tk=$(mptcp_lib_evts_get_info token "$evts")
++
++      ip netns exec $1 ./pm_nl_ctl get $2 token $tk
++}
++
+ userspace_pm_chk_dump_addr()
+ {
+       local ns="${1}"
+@@ -3469,6 +3481,21 @@ userspace_pm_chk_dump_addr()
+       fi
+ }
++userspace_pm_chk_get_addr()
++{
++      local ns="${1}"
++      local id="${2}"
++      local exp="${3}"
++
++      print_check "get id ${id} addr"
++
++      if mptcp_lib_kallsyms_has "mptcp_userspace_pm_get_addr$"; then
++              check_output "userspace_pm_get_addr ${ns} ${id}" "${exp}"
++      else
++              print_skip
++      fi
++}
++
+ userspace_tests()
+ {
+       # userspace pm type prevents add_addr
+@@ -3563,6 +3590,8 @@ userspace_tests()
+               userspace_pm_chk_dump_addr "${ns1}" \
+                       $'id 10 flags signal 10.0.2.1\nid 20 flags signal 10.0.3.1' \
+                       "signal"
++              userspace_pm_chk_get_addr "${ns1}" "10" "id 10 flags signal 10.0.2.1"
++              userspace_pm_chk_get_addr "${ns1}" "20" "id 20 flags signal 10.0.3.1"
+               userspace_pm_rm_addr $ns1 10
+               userspace_pm_rm_sf $ns1 "::ffff:10.0.2.1" $SUB_ESTABLISHED
+               userspace_pm_chk_dump_addr "${ns1}" \
+@@ -3593,6 +3622,7 @@ userspace_tests()
+               userspace_pm_chk_dump_addr "${ns2}" \
+                       "id 20 flags subflow 10.0.3.2" \
+                       "subflow"
++              userspace_pm_chk_get_addr "${ns2}" "20" "id 20 flags subflow 10.0.3.2"
+               userspace_pm_rm_addr $ns2 20
+               userspace_pm_rm_sf $ns2 10.0.3.2 $SUB_ESTABLISHED
+               userspace_pm_chk_dump_addr "${ns2}" \
+-- 
+2.43.0
+
diff --git a/queue-6.6/series b/queue-6.6/series
new file mode 100644 (file)
index 0000000..be4b7da
--- /dev/null
@@ -0,0 +1,31 @@
+drm-fb-helper-don-t-schedule_work-to-flush-frame-buf.patch
+drm-panel-orientation-quirks-add-quirk-for-orangepi-.patch
+scsi-ufs-core-check-lsdbs-cap-when-mcq.patch
+scsi-ufs-core-bypass-quick-recovery-if-force-reset-i.patch
+btrfs-tree-checker-validate-dref-root-and-objectid.patch
+alsa-hda-generic-add-a-helper-to-mute-speakers-at-su.patch
+alsa-hda-conexant-mute-speakers-at-suspend-shutdown.patch
+alsa-ump-transmit-rpn-nrpn-message-at-each-msb-lsb-d.patch
+alsa-ump-explicitly-reset-rpn-with-null-rpn.patch
+alsa-seq-ump-use-the-common-rpn-bank-conversion-cont.patch
+alsa-seq-ump-transmit-rpn-nrpn-message-at-each-msb-l.patch
+alsa-seq-ump-explicitly-reset-rpn-with-null-rpn.patch
+net-mlx5-dr-fix-stack-guard-page-was-hit-error-in-dr.patch
+smb-client-fix-fsctl_get_reparse_point-against-netap.patch
+asoc-amd-yc-support-mic-on-hp-14-em0002la.patch
+spi-hisi-kunpeng-add-validation-for-the-minimum-valu.patch
+i2c-fix-conditional-for-substituting-empty-acpi-func.patch
+dma-debug-avoid-deadlock-between-dma-debug-vs-printk.patch
+net-usb-qmi_wwan-add-meig-smart-srm825l.patch
+asoc-amd-yc-support-mic-on-lenovo-thinkpad-e14-gen-6.patch
+asoc-codecs-es8326-button-detect-issue.patch
+mptcp-make-pm_remove_addrs_and_subflows-static.patch
+mptcp-pm-fix-rm_addr-id-for-the-initial-subflow.patch
+selftests-mptcp-userspace-pm-create-id-0-subflow.patch
+selftests-mptcp-dump-userspace-addrs-list.patch
+selftests-mptcp-userspace-pm-get-addr-tests.patch
+selftests-mptcp-declare-event-macros-in-mptcp_lib.patch
+selftests-mptcp-join-cannot-rm-sf-if-closed.patch
+selftests-mptcp-add-explicit-test-case-for-remove-re.patch
+selftests-mptcp-join-check-re-using-id-of-unused-add.patch
+selftests-mptcp-join-check-re-adding-init-endp-with-.patch
diff --git a/queue-6.6/smb-client-fix-fsctl_get_reparse_point-against-netap.patch b/queue-6.6/smb-client-fix-fsctl_get_reparse_point-against-netap.patch
new file mode 100644 (file)
index 0000000..013e90e
--- /dev/null
@@ -0,0 +1,55 @@
+From bea9b6c0e7a5a4119297070b10ca0c2ed9d01794 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 1 Aug 2024 18:12:39 -0300
+Subject: smb: client: fix FSCTL_GET_REPARSE_POINT against NetApp
+
+From: Paulo Alcantara <pc@manguebit.com>
+
+[ Upstream commit ddecea00f87f0c46e9c8339a7c89fb2ff891521a ]
+
+NetApp server requires the file to be open with FILE_READ_EA access in
+order to support FSCTL_GET_REPARSE_POINT, otherwise it will return
+STATUS_INVALID_DEVICE_REQUEST.  It doesn't make any sense because
+there's no requirement for FILE_READ_EA bit to be set nor
+STATUS_INVALID_DEVICE_REQUEST being used for something other than
+"unsupported reparse points" in MS-FSA.
+
+To fix it and improve compatibility, set FILE_READ_EA & SYNCHRONIZE
+bits to match what Windows client currently does.
+
+Tested-by: Sebastian Steinbeisser <Sebastian.Steinbeisser@lrz.de>
+Acked-by: Tom Talpey <tom@talpey.com>
+Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/smb/client/smb2inode.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/fs/smb/client/smb2inode.c b/fs/smb/client/smb2inode.c
+index 28031c7ba6b19..15cbfec4c28c7 100644
+--- a/fs/smb/client/smb2inode.c
++++ b/fs/smb/client/smb2inode.c
+@@ -950,7 +950,8 @@ int smb2_query_path_info(const unsigned int xid,
+                       cmds[num_cmds++] = SMB2_OP_GET_REPARSE;
+               oparms = CIFS_OPARMS(cifs_sb, tcon, full_path,
+-                                   FILE_READ_ATTRIBUTES | FILE_READ_EA,
++                                   FILE_READ_ATTRIBUTES |
++                                   FILE_READ_EA | SYNCHRONIZE,
+                                    FILE_OPEN, create_options |
+                                    OPEN_REPARSE_POINT, ACL_NO_MODE);
+               cifs_get_readable_path(tcon, full_path, &cfile);
+@@ -1258,7 +1259,8 @@ int smb2_query_reparse_point(const unsigned int xid,
+       cifs_dbg(FYI, "%s: path: %s\n", __func__, full_path);
+       cifs_get_readable_path(tcon, full_path, &cfile);
+-      oparms = CIFS_OPARMS(cifs_sb, tcon, full_path, FILE_READ_ATTRIBUTES,
++      oparms = CIFS_OPARMS(cifs_sb, tcon, full_path,
++                           FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE,
+                            FILE_OPEN, OPEN_REPARSE_POINT, ACL_NO_MODE);
+       rc = smb2_compound_op(xid, tcon, cifs_sb,
+                             full_path, &oparms, &in_iov,
+-- 
+2.43.0
+
diff --git a/queue-6.6/spi-hisi-kunpeng-add-validation-for-the-minimum-valu.patch b/queue-6.6/spi-hisi-kunpeng-add-validation-for-the-minimum-valu.patch
new file mode 100644 (file)
index 0000000..6de3f9e
--- /dev/null
@@ -0,0 +1,40 @@
+From 09ec26f43ea28dd902434f08da5c7a8fb3a7d1f4 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 30 Jul 2024 11:20:39 +0800
+Subject: spi: hisi-kunpeng: Add validation for the minimum value of speed_hz
+
+From: Devyn Liu <liudingyuan@huawei.com>
+
+[ Upstream commit c3c4f22b7c814a6ee485ce294065836f8ede30fa ]
+
+The speed specified by the user is used to calculate the clk_div based
+on the max_speed_hz in hisi_calc_effective_speed.  A very low speed
+value can lead to a clk_div larger than the variable range. Avoid this
+by setting the min_speed_hz so that such a small speed value is
+rejected.  __spi_validate() in spi.c will return -EINVAL for the
+specified speed_hz lower than min_speed_hz.
+
+Signed-off-by: Devyn Liu <liudingyuan@huawei.com>
+Reviewed-by: Jay Fang <f.fangjian@huawei.com>
+Link: https://patch.msgid.link/20240730032040.3156393-2-liudingyuan@huawei.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/spi/spi-hisi-kunpeng.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/spi/spi-hisi-kunpeng.c b/drivers/spi/spi-hisi-kunpeng.c
+index 77e9738e42f60..6910b4d4c427b 100644
+--- a/drivers/spi/spi-hisi-kunpeng.c
++++ b/drivers/spi/spi-hisi-kunpeng.c
+@@ -495,6 +495,7 @@ static int hisi_spi_probe(struct platform_device *pdev)
+       host->transfer_one = hisi_spi_transfer_one;
+       host->handle_err = hisi_spi_handle_err;
+       host->dev.fwnode = dev->fwnode;
++      host->min_speed_hz = DIV_ROUND_UP(host->max_speed_hz, CLK_DIV_MAX);
+       hisi_spi_hw_init(hs);
+-- 
+2.43.0
+