From: Greg Kroah-Hartman Date: Sun, 20 Feb 2022 11:38:59 +0000 (+0100) Subject: 5.16-stable patches X-Git-Tag: v4.9.303~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=78f84007c603114ca8efed84481a3d37211c3f33;p=thirdparty%2Fkernel%2Fstable-queue.git 5.16-stable patches added patches: acpi-processor-idle-fix-lockup-regression-on-32-bit-thinkpad-t40.patch alsa-hda-fix-missing-codec-probe-on-shenker-dock-15.patch alsa-hda-fix-regression-on-forced-probe-mask-option.patch alsa-hda-realtek-add-quirk-for-legion-y9000x-2019.patch alsa-hda-realtek-fix-deadlock-by-coef-mutex.patch alsa-memalloc-fix-dma_need_sync-checks.patch alsa-memalloc-invalidate-sg-pages-before-sync.patch alsa-usb-audio-don-t-abort-resume-upon-errors.patch alsa-usb-audio-revert-to-implicit_fb_fixed_dev-for-m-audio-fasttrack-ultra.patch arm64-correct-wrong-label-in-macro-__init_el2_gicv3.patch asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw.patch asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw_range.patch asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw_sx.patch asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_xr_sx.patch cifs-fix-confusing-unneeded-warning-message-on-smb2.1-and-earlier.patch cifs-fix-set-of-group-sid-via-ntsd-xattrs.patch mtd-rawnand-gpmi-don-t-leak-pm-reference-in-error-path.patch powerpc-603-fix-boot-failure-with-debug_pagealloc-and-kfence.patch powerpc-lib-sstep-fix-ptesync-build-error.patch scsi-ufs-fix-a-deadlock-in-the-error-handler.patch scsi-ufs-remove-dead-code.patch smb3-fix-snapshot-mount-option.patch tipc-fix-wrong-notification-node-addresses.patch --- diff --git a/queue-5.16/acpi-processor-idle-fix-lockup-regression-on-32-bit-thinkpad-t40.patch b/queue-5.16/acpi-processor-idle-fix-lockup-regression-on-32-bit-thinkpad-t40.patch new file mode 100644 index 00000000000..da305df7ce8 --- /dev/null +++ b/queue-5.16/acpi-processor-idle-fix-lockup-regression-on-32-bit-thinkpad-t40.patch @@ -0,0 +1,60 @@ +From bfe55a1f7fd6bfede16078bf04c6250fbca11588 Mon Sep 17 00:00:00 2001 +From: Woody Suwalski +Date: Wed, 9 Feb 2022 16:05:09 -0500 +Subject: ACPI: processor: idle: fix lockup regression on 32-bit ThinkPad T40 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Woody Suwalski + +commit bfe55a1f7fd6bfede16078bf04c6250fbca11588 upstream. + +Add and ACPI idle power level limit for 32-bit ThinkPad T40. + +There is a regression on T40 introduced by commit d6b88ce2, starting +with kernel 5.16: + +commit d6b88ce2eb9d2698eb24451eb92c0a1649b17bb1 +Author: Richard Gong +Date:   Wed Sep 22 08:31:16 2021 -0500 + + ACPI: processor idle: Allow playing dead in C3 state + +The above patch is trying to enter C3 state during init, what is causing +a T40 system freeze. I have not found a similar issue on any other of my +32-bit machines. + +The fix is to add another exception to the processor_power_dmi_table[] list. +As a result the dmesg shows as expected: + +[2.155398] ACPI: IBM ThinkPad T40 detected - limiting to C2 max_cstate. Override with "processor.max_cstate=9" +[2.155404] ACPI: processor limited to max C-state 2 + +The fix is trivial and affects only vintage T40 systems. + +Fixes: d6b88ce2eb9d ("CPI: processor idle: Allow playing dead in C3 state") +Signed-off-by: Woody Suwalski +Reviewed-by: Hans de Goede +Cc: 5.16+ # 5.16+ +[ rjw: New subject ] +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman +--- + drivers/acpi/processor_idle.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/acpi/processor_idle.c ++++ b/drivers/acpi/processor_idle.c +@@ -95,6 +95,11 @@ static const struct dmi_system_id proces + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."), + DMI_MATCH(DMI_PRODUCT_NAME,"L8400B series Notebook PC")}, + (void *)1}, ++ /* T40 can not handle C3 idle state */ ++ { set_max_cstate, "IBM ThinkPad T40", { ++ DMI_MATCH(DMI_SYS_VENDOR, "IBM"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "23737CU")}, ++ (void *)2}, + {}, + }; + diff --git a/queue-5.16/alsa-hda-fix-missing-codec-probe-on-shenker-dock-15.patch b/queue-5.16/alsa-hda-fix-missing-codec-probe-on-shenker-dock-15.patch new file mode 100644 index 00000000000..535b755aead --- /dev/null +++ b/queue-5.16/alsa-hda-fix-missing-codec-probe-on-shenker-dock-15.patch @@ -0,0 +1,33 @@ +From dd8e5b161d7fb9cefa1f1d6e35a39b9e1563c8d3 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 14 Feb 2022 11:00:20 +0100 +Subject: ALSA: hda: Fix missing codec probe on Shenker Dock 15 + +From: Takashi Iwai + +commit dd8e5b161d7fb9cefa1f1d6e35a39b9e1563c8d3 upstream. + +By some unknown reason, BIOS on Shenker Dock 15 doesn't set up the +codec mask properly for the onboard audio. Let's set the forced codec +mask to enable the codec discovery. + +Reported-by: dmummenschanz@web.de +Cc: +Link: https://lore.kernel.org/r/trinity-f018660b-95c9-442b-a2a8-c92a56eb07ed-1644345967148@3c-app-webde-bap22 +Link: https://lore.kernel.org/r/20220214100020.8870-2-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/hda_intel.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/pci/hda/hda_intel.c ++++ b/sound/pci/hda/hda_intel.c +@@ -1611,6 +1611,7 @@ static const struct snd_pci_quirk probe_ + /* forced codec slots */ + SND_PCI_QUIRK(0x1043, 0x1262, "ASUS W5Fm", 0x103), + SND_PCI_QUIRK(0x1046, 0x1262, "ASUS W5F", 0x103), ++ SND_PCI_QUIRK(0x1558, 0x0351, "Schenker Dock 15", 0x105), + /* WinFast VP200 H (Teradici) user reported broken communication */ + SND_PCI_QUIRK(0x3a21, 0x040d, "WinFast VP200 H", 0x101), + {} diff --git a/queue-5.16/alsa-hda-fix-regression-on-forced-probe-mask-option.patch b/queue-5.16/alsa-hda-fix-regression-on-forced-probe-mask-option.patch new file mode 100644 index 00000000000..b201dc366bc --- /dev/null +++ b/queue-5.16/alsa-hda-fix-regression-on-forced-probe-mask-option.patch @@ -0,0 +1,45 @@ +From 6317f7449348a897483a2b4841f7a9190745c81b Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 14 Feb 2022 11:00:19 +0100 +Subject: ALSA: hda: Fix regression on forced probe mask option + +From: Takashi Iwai + +commit 6317f7449348a897483a2b4841f7a9190745c81b upstream. + +The forced probe mask via probe_mask 0x100 bit doesn't work any longer +as expected since the bus init code was moved and it's clearing the +codec_mask value that was set beforehand. This patch fixes the +long-time regression by moving the check_probe_mask() call. + +Fixes: a41d122449be ("ALSA: hda - Embed bus into controller object") +Reported-by: dmummenschanz@web.de +Cc: +Link: https://lore.kernel.org/r/trinity-f018660b-95c9-442b-a2a8-c92a56eb07ed-1644345967148@3c-app-webde-bap22 +Link: https://lore.kernel.org/r/20220214100020.8870-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/hda_intel.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/sound/pci/hda/hda_intel.c ++++ b/sound/pci/hda/hda_intel.c +@@ -1794,8 +1794,6 @@ static int azx_create(struct snd_card *c + + assign_position_fix(chip, check_position_fix(chip, position_fix[dev])); + +- check_probe_mask(chip, dev); +- + if (single_cmd < 0) /* allow fallback to single_cmd at errors */ + chip->fallback_to_single_cmd = 1; + else /* explicitly set to single_cmd or not */ +@@ -1821,6 +1819,8 @@ static int azx_create(struct snd_card *c + chip->bus.core.needs_damn_long_delay = 1; + } + ++ check_probe_mask(chip, dev); ++ + err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); + if (err < 0) { + dev_err(card->dev, "Error creating device [card]!\n"); diff --git a/queue-5.16/alsa-hda-realtek-add-quirk-for-legion-y9000x-2019.patch b/queue-5.16/alsa-hda-realtek-add-quirk-for-legion-y9000x-2019.patch new file mode 100644 index 00000000000..59188c35ffc --- /dev/null +++ b/queue-5.16/alsa-hda-realtek-add-quirk-for-legion-y9000x-2019.patch @@ -0,0 +1,32 @@ +From c07f2c7b45413a9e50ba78630fda04ecfa17b4f2 Mon Sep 17 00:00:00 2001 +From: Yu Huang +Date: Sun, 13 Feb 2022 00:08:33 +0800 +Subject: ALSA: hda/realtek: Add quirk for Legion Y9000X 2019 + +From: Yu Huang + +commit c07f2c7b45413a9e50ba78630fda04ecfa17b4f2 upstream. + +Legion Y9000X 2019 has the same speaker with Y9000X 2020, +but with a different quirk address. Add one quirk entry +to make the speaker work on Y9000X 2019 too. + +Signed-off-by: Yu Huang +Cc: +Link: https://lore.kernel.org/r/20220212160835.165065-1-diwang90@gmail.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -9013,6 +9013,7 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS), + SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF), + SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), ++ SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS), + SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP), + SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), + SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), diff --git a/queue-5.16/alsa-hda-realtek-fix-deadlock-by-coef-mutex.patch b/queue-5.16/alsa-hda-realtek-fix-deadlock-by-coef-mutex.patch new file mode 100644 index 00000000000..b4c9e2594b7 --- /dev/null +++ b/queue-5.16/alsa-hda-realtek-fix-deadlock-by-coef-mutex.patch @@ -0,0 +1,118 @@ +From 2a845837e3d0ddaed493b4c5c4643d7f0542804d Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 14 Feb 2022 14:04:10 +0100 +Subject: ALSA: hda/realtek: Fix deadlock by COEF mutex + +From: Takashi Iwai + +commit 2a845837e3d0ddaed493b4c5c4643d7f0542804d upstream. + +The recently introduced coef_mutex for Realtek codec seems causing a +deadlock when the relevant code is invoked from the power-off state; +then the HD-audio core tries to power-up internally, and this kicks +off the codec runtime PM code that tries to take the same coef_mutex. + +In order to avoid the deadlock, do the temporary power up/down around +the coef_mutex acquisition and release. This assures that the +power-up sequence runs before the mutex, hence no re-entrance will +happen. + +Fixes: b837a9f5ab3b ("ALSA: hda: realtek: Fix race at concurrent COEF updates") +Reported-and-tested-by: Julian Wollrath +Cc: +Link: https://lore.kernel.org/r/20220214132838.4db10fca@schienar +Link: https://lore.kernel.org/r/20220214130410.21230-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 39 ++++++++++++++++++++++++--------------- + 1 file changed, 24 insertions(+), 15 deletions(-) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -133,6 +133,22 @@ struct alc_spec { + * COEF access helper functions + */ + ++static void coef_mutex_lock(struct hda_codec *codec) ++{ ++ struct alc_spec *spec = codec->spec; ++ ++ snd_hda_power_up_pm(codec); ++ mutex_lock(&spec->coef_mutex); ++} ++ ++static void coef_mutex_unlock(struct hda_codec *codec) ++{ ++ struct alc_spec *spec = codec->spec; ++ ++ mutex_unlock(&spec->coef_mutex); ++ snd_hda_power_down_pm(codec); ++} ++ + static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, + unsigned int coef_idx) + { +@@ -146,12 +162,11 @@ static int __alc_read_coefex_idx(struct + static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, + unsigned int coef_idx) + { +- struct alc_spec *spec = codec->spec; + unsigned int val; + +- mutex_lock(&spec->coef_mutex); ++ coef_mutex_lock(codec); + val = __alc_read_coefex_idx(codec, nid, coef_idx); +- mutex_unlock(&spec->coef_mutex); ++ coef_mutex_unlock(codec); + return val; + } + +@@ -168,11 +183,9 @@ static void __alc_write_coefex_idx(struc + static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, + unsigned int coef_idx, unsigned int coef_val) + { +- struct alc_spec *spec = codec->spec; +- +- mutex_lock(&spec->coef_mutex); ++ coef_mutex_lock(codec); + __alc_write_coefex_idx(codec, nid, coef_idx, coef_val); +- mutex_unlock(&spec->coef_mutex); ++ coef_mutex_unlock(codec); + } + + #define alc_write_coef_idx(codec, coef_idx, coef_val) \ +@@ -193,11 +206,9 @@ static void alc_update_coefex_idx(struct + unsigned int coef_idx, unsigned int mask, + unsigned int bits_set) + { +- struct alc_spec *spec = codec->spec; +- +- mutex_lock(&spec->coef_mutex); ++ coef_mutex_lock(codec); + __alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set); +- mutex_unlock(&spec->coef_mutex); ++ coef_mutex_unlock(codec); + } + + #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ +@@ -230,9 +241,7 @@ struct coef_fw { + static void alc_process_coef_fw(struct hda_codec *codec, + const struct coef_fw *fw) + { +- struct alc_spec *spec = codec->spec; +- +- mutex_lock(&spec->coef_mutex); ++ coef_mutex_lock(codec); + for (; fw->nid; fw++) { + if (fw->mask == (unsigned short)-1) + __alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); +@@ -240,7 +249,7 @@ static void alc_process_coef_fw(struct h + __alc_update_coefex_idx(codec, fw->nid, fw->idx, + fw->mask, fw->val); + } +- mutex_unlock(&spec->coef_mutex); ++ coef_mutex_unlock(codec); + } + + /* diff --git a/queue-5.16/alsa-memalloc-fix-dma_need_sync-checks.patch b/queue-5.16/alsa-memalloc-fix-dma_need_sync-checks.patch new file mode 100644 index 00000000000..85f6d9faf69 --- /dev/null +++ b/queue-5.16/alsa-memalloc-fix-dma_need_sync-checks.patch @@ -0,0 +1,54 @@ +From 8e1741c658996a16bd096e077dae0da2460a997f Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 10 Feb 2022 13:33:43 +0100 +Subject: ALSA: memalloc: Fix dma_need_sync() checks + +From: Takashi Iwai + +commit 8e1741c658996a16bd096e077dae0da2460a997f upstream. + +dma_need_sync() checks each DMA address. Fix the incorrect usages +for non-contiguous and non-coherent page allocations. +Fortunately, there are no actual call sites that need manual syncs +yet. + +Fixes: a25684a95646 ("ALSA: memalloc: Support for non-contiguous page allocation") +Fixes: 73325f60e2ed ("ALSA: memalloc: Support for non-coherent page allocation") +Cc: +Reported-by: Ezequiel Garcia +Link: https://lore.kernel.org/r/20220210123344.8756-2-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/core/memalloc.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +--- a/sound/core/memalloc.c ++++ b/sound/core/memalloc.c +@@ -511,7 +511,8 @@ static void *snd_dma_noncontig_alloc(str + DEFAULT_GFP, 0); + if (!sgt) + return NULL; +- dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, dmab->dev.dir); ++ dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, ++ sg_dma_address(sgt->sgl)); + p = dma_vmap_noncontiguous(dmab->dev.dev, size, sgt); + if (p) + dmab->private_data = sgt; +@@ -625,9 +626,13 @@ static const struct snd_malloc_ops snd_d + */ + static void *snd_dma_noncoherent_alloc(struct snd_dma_buffer *dmab, size_t size) + { +- dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, dmab->dev.dir); +- return dma_alloc_noncoherent(dmab->dev.dev, size, &dmab->addr, +- dmab->dev.dir, DEFAULT_GFP); ++ void *p; ++ ++ p = dma_alloc_noncoherent(dmab->dev.dev, size, &dmab->addr, ++ dmab->dev.dir, DEFAULT_GFP); ++ if (p) ++ dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, dmab->addr); ++ return p; + } + + static void snd_dma_noncoherent_free(struct snd_dma_buffer *dmab) diff --git a/queue-5.16/alsa-memalloc-invalidate-sg-pages-before-sync.patch b/queue-5.16/alsa-memalloc-invalidate-sg-pages-before-sync.patch new file mode 100644 index 00000000000..16eea831f48 --- /dev/null +++ b/queue-5.16/alsa-memalloc-invalidate-sg-pages-before-sync.patch @@ -0,0 +1,38 @@ +From 3e16dc50d77dc3494275a241fac250c94bf45206 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 10 Feb 2022 13:33:44 +0100 +Subject: ALSA: memalloc: invalidate SG pages before sync + +From: Takashi Iwai + +commit 3e16dc50d77dc3494275a241fac250c94bf45206 upstream. + +It seems that calling invalidate_kernel_vmap_range() is more correct +to be called before dma_sync_*(), judging from the other thread: + https://lore.kernel.org/all/20220111085958.GA22795@lst.de/ +Although this won't matter much in practice, let's fix the call order +for consistency. + +Fixes: a25684a95646 ("ALSA: memalloc: Support for non-contiguous page allocation") +Reported-by: Ezequiel Garcia +Cc: +Link: https://lore.kernel.org/r/20220210123344.8756-3-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/core/memalloc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/core/memalloc.c ++++ b/sound/core/memalloc.c +@@ -541,9 +541,9 @@ static void snd_dma_noncontig_sync(struc + if (mode == SNDRV_DMA_SYNC_CPU) { + if (dmab->dev.dir == DMA_TO_DEVICE) + return; ++ invalidate_kernel_vmap_range(dmab->area, dmab->bytes); + dma_sync_sgtable_for_cpu(dmab->dev.dev, dmab->private_data, + dmab->dev.dir); +- invalidate_kernel_vmap_range(dmab->area, dmab->bytes); + } else { + if (dmab->dev.dir == DMA_FROM_DEVICE) + return; diff --git a/queue-5.16/alsa-usb-audio-don-t-abort-resume-upon-errors.patch b/queue-5.16/alsa-usb-audio-don-t-abort-resume-upon-errors.patch new file mode 100644 index 00000000000..197cac1dbf0 --- /dev/null +++ b/queue-5.16/alsa-usb-audio-don-t-abort-resume-upon-errors.patch @@ -0,0 +1,57 @@ +From 9a5adeb28b77416446658e75bdef3bbe5fb92a83 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 14 Feb 2022 13:57:11 +0100 +Subject: ALSA: usb-audio: Don't abort resume upon errors + +From: Takashi Iwai + +commit 9a5adeb28b77416446658e75bdef3bbe5fb92a83 upstream. + +The default mixer resume code treats the errors at restoring the +modified mixer items as a fatal error, and it returns back to the +caller. This ends up in the resume failure, and the device will be +come unavailable, although basically those errors are intermittent and +can be safely ignored. + +The problem itself has been present from the beginning, but it didn't +hit usually because the code tries to resume only the modified items. +But now with the recent commit to forcibly initialize each item at the +probe time, the problem surfaced more often, hence it appears as a +regression. + +This patch fixes the regression simply by ignoring the errors at +resume. + +Fixes: b96681bd5827 ("ALSA: usb-audio: Initialize every feature unit once at probe time") +Cc: +BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215561 +Link: https://lore.kernel.org/r/20220214125711.20531-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/mixer.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +--- a/sound/usb/mixer.c ++++ b/sound/usb/mixer.c +@@ -3678,17 +3678,14 @@ static int restore_mixer_value(struct us + err = snd_usb_set_cur_mix_value(cval, c + 1, idx, + cval->cache_val[idx]); + if (err < 0) +- return err; ++ break; + } + idx++; + } + } else { + /* master */ +- if (cval->cached) { +- err = snd_usb_set_cur_mix_value(cval, 0, 0, *cval->cache_val); +- if (err < 0) +- return err; +- } ++ if (cval->cached) ++ snd_usb_set_cur_mix_value(cval, 0, 0, *cval->cache_val); + } + + return 0; diff --git a/queue-5.16/alsa-usb-audio-revert-to-implicit_fb_fixed_dev-for-m-audio-fasttrack-ultra.patch b/queue-5.16/alsa-usb-audio-revert-to-implicit_fb_fixed_dev-for-m-audio-fasttrack-ultra.patch new file mode 100644 index 00000000000..9e17ce2d14a --- /dev/null +++ b/queue-5.16/alsa-usb-audio-revert-to-implicit_fb_fixed_dev-for-m-audio-fasttrack-ultra.patch @@ -0,0 +1,45 @@ +From 19d20c7a29bf2e46ff1ab8e8c4fcd2da8a4f38e2 Mon Sep 17 00:00:00 2001 +From: Matteo Martelli +Date: Fri, 11 Feb 2022 23:49:13 +0100 +Subject: ALSA: usb-audio: revert to IMPLICIT_FB_FIXED_DEV for M-Audio FastTrack Ultra + +From: Matteo Martelli + +commit 19d20c7a29bf2e46ff1ab8e8c4fcd2da8a4f38e2 upstream. + +Commit 83b7dcbc51c930fc2079ab6c6fc9d719768321f1 introduced a generic +implicit feedback parser, which fails to execute for M-Audio FastTrack +Ultra sound cards. The issue is with the ENDPOINT_SYNCTYPE check in +add_generic_implicit_fb() where the SYNCTYPE is ADAPTIVE instead of ASYNC. +The reason is that the sync type of the FastTrack output endpoints are +set to adaptive in the quirks table since commit +65f04443c96dbda11b8fff21d6390e082846aa3c. + +Fixes: 83b7dcbc51c9 ("ALSA: usb-audio: Add generic implicit fb parsing") +Signed-off-by: Matteo Martelli +Cc: +Link: https://lore.kernel.org/r/20220211224913.20683-2-matteomartelli3@gmail.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/implicit.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/sound/usb/implicit.c ++++ b/sound/usb/implicit.c +@@ -47,13 +47,13 @@ struct snd_usb_implicit_fb_match { + static const struct snd_usb_implicit_fb_match playback_implicit_fb_quirks[] = { + /* Generic matching */ + IMPLICIT_FB_GENERIC_DEV(0x0499, 0x1509), /* Steinberg UR22 */ +- IMPLICIT_FB_GENERIC_DEV(0x0763, 0x2080), /* M-Audio FastTrack Ultra */ +- IMPLICIT_FB_GENERIC_DEV(0x0763, 0x2081), /* M-Audio FastTrack Ultra */ + IMPLICIT_FB_GENERIC_DEV(0x0763, 0x2030), /* M-Audio Fast Track C400 */ + IMPLICIT_FB_GENERIC_DEV(0x0763, 0x2031), /* M-Audio Fast Track C600 */ + + /* Fixed EP */ + /* FIXME: check the availability of generic matching */ ++ IMPLICIT_FB_FIXED_DEV(0x0763, 0x2080, 0x81, 2), /* M-Audio FastTrack Ultra */ ++ IMPLICIT_FB_FIXED_DEV(0x0763, 0x2081, 0x81, 2), /* M-Audio FastTrack Ultra */ + IMPLICIT_FB_FIXED_DEV(0x2466, 0x8010, 0x81, 2), /* Fractal Audio Axe-Fx III */ + IMPLICIT_FB_FIXED_DEV(0x31e9, 0x0001, 0x81, 2), /* Solid State Logic SSL2 */ + IMPLICIT_FB_FIXED_DEV(0x31e9, 0x0002, 0x81, 2), /* Solid State Logic SSL2+ */ diff --git a/queue-5.16/arm64-correct-wrong-label-in-macro-__init_el2_gicv3.patch b/queue-5.16/arm64-correct-wrong-label-in-macro-__init_el2_gicv3.patch new file mode 100644 index 00000000000..945eaafaa93 --- /dev/null +++ b/queue-5.16/arm64-correct-wrong-label-in-macro-__init_el2_gicv3.patch @@ -0,0 +1,44 @@ +From 4f6de676d94ee8ddfc2e7e7cd935fc7cb2feff3a Mon Sep 17 00:00:00 2001 +From: Joakim Tjernlund +Date: Mon, 14 Feb 2022 18:56:43 +0100 +Subject: arm64: Correct wrong label in macro __init_el2_gicv3 + +From: Joakim Tjernlund + +commit 4f6de676d94ee8ddfc2e7e7cd935fc7cb2feff3a upstream. + +In commit: + + 114945d84a30a5fe ("arm64: Fix labels in el2_setup macros") + +We renamed a label from '1' to '.Lskip_gicv3_\@', but failed to update +a branch to it, which now targets a later label also called '1'. + +The branch is taken rarely, when GICv3 is present but SRE is disabled +at EL3, causing a boot-time crash. + +Update the caller to the new label name. + +Fixes: 114945d84a30 ("arm64: Fix labels in el2_setup macros") +Cc: # 5.12.x +Signed-off-by: Joakim Tjernlund +Link: https://lore.kernel.org/r/20220214175643.21931-1-joakim.tjernlund@infinera.com +Reviewed-by: Mark Rutland +Reviewed-by: Marc Zyngier +Signed-off-by: Catalin Marinas +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm64/include/asm/el2_setup.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm64/include/asm/el2_setup.h ++++ b/arch/arm64/include/asm/el2_setup.h +@@ -106,7 +106,7 @@ + msr_s SYS_ICC_SRE_EL2, x0 + isb // Make sure SRE is now set + mrs_s x0, SYS_ICC_SRE_EL2 // Read SRE back, +- tbz x0, #0, 1f // and check that it sticks ++ tbz x0, #0, .Lskip_gicv3_\@ // and check that it sticks + msr_s SYS_ICH_HCR_EL2, xzr // Reset ICC_HCR_EL2 to defaults + .Lskip_gicv3_\@: + .endm diff --git a/queue-5.16/asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw.patch b/queue-5.16/asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw.patch new file mode 100644 index 00000000000..25ba113de55 --- /dev/null +++ b/queue-5.16/asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw.patch @@ -0,0 +1,56 @@ +From 564778d7b1ea465f9487eedeece7527a033549c5 Mon Sep 17 00:00:00 2001 +From: Mark Brown +Date: Tue, 1 Feb 2022 15:56:26 +0000 +Subject: ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw() + +From: Mark Brown + +commit 564778d7b1ea465f9487eedeece7527a033549c5 upstream. + +When writing out a stereo control we discard the change notification from +the first channel, meaning that events are only generated based on changes +to the second channel. Ensure that we report a change if either channel +has changed. + +Signed-off-by: Mark Brown +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20220201155629.120510-2-broonie@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/soc-ops.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +--- a/sound/soc/soc-ops.c ++++ b/sound/soc/soc-ops.c +@@ -308,7 +308,7 @@ int snd_soc_put_volsw(struct snd_kcontro + unsigned int sign_bit = mc->sign_bit; + unsigned int mask = (1 << fls(max)) - 1; + unsigned int invert = mc->invert; +- int err; ++ int err, ret; + bool type_2r = false; + unsigned int val2 = 0; + unsigned int val, val_mask; +@@ -350,12 +350,18 @@ int snd_soc_put_volsw(struct snd_kcontro + err = snd_soc_component_update_bits(component, reg, val_mask, val); + if (err < 0) + return err; ++ ret = err; + +- if (type_2r) ++ if (type_2r) { + err = snd_soc_component_update_bits(component, reg2, val_mask, +- val2); ++ val2); ++ /* Don't discard any error code or drop change flag */ ++ if (ret == 0 || err < 0) { ++ ret = err; ++ } ++ } + +- return err; ++ return ret; + } + EXPORT_SYMBOL_GPL(snd_soc_put_volsw); + diff --git a/queue-5.16/asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw_range.patch b/queue-5.16/asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw_range.patch new file mode 100644 index 00000000000..5787bbb48d5 --- /dev/null +++ b/queue-5.16/asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw_range.patch @@ -0,0 +1,62 @@ +From 650204ded3703b5817bd4b6a77fa47d333c4f902 Mon Sep 17 00:00:00 2001 +From: Mark Brown +Date: Tue, 1 Feb 2022 15:56:28 +0000 +Subject: ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw_range() + +From: Mark Brown + +commit 650204ded3703b5817bd4b6a77fa47d333c4f902 upstream. + +When writing out a stereo control we discard the change notification from +the first channel, meaning that events are only generated based on changes +to the second channel. Ensure that we report a change if either channel +has changed. + +Signed-off-by: Mark Brown +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20220201155629.120510-4-broonie@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/soc-ops.c | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +--- a/sound/soc/soc-ops.c ++++ b/sound/soc/soc-ops.c +@@ -512,7 +512,7 @@ int snd_soc_put_volsw_range(struct snd_k + unsigned int mask = (1 << fls(max)) - 1; + unsigned int invert = mc->invert; + unsigned int val, val_mask; +- int ret; ++ int err, ret; + + if (invert) + val = (max - ucontrol->value.integer.value[0]) & mask; +@@ -521,9 +521,10 @@ int snd_soc_put_volsw_range(struct snd_k + val_mask = mask << shift; + val = val << shift; + +- ret = snd_soc_component_update_bits(component, reg, val_mask, val); +- if (ret < 0) +- return ret; ++ err = snd_soc_component_update_bits(component, reg, val_mask, val); ++ if (err < 0) ++ return err; ++ ret = err; + + if (snd_soc_volsw_is_stereo(mc)) { + if (invert) +@@ -533,8 +534,12 @@ int snd_soc_put_volsw_range(struct snd_k + val_mask = mask << shift; + val = val << shift; + +- ret = snd_soc_component_update_bits(component, rreg, val_mask, ++ err = snd_soc_component_update_bits(component, rreg, val_mask, + val); ++ /* Don't discard any error code or drop change flag */ ++ if (ret == 0 || err < 0) { ++ ret = err; ++ } + } + + return ret; diff --git a/queue-5.16/asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw_sx.patch b/queue-5.16/asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw_sx.patch new file mode 100644 index 00000000000..1584dcb9126 --- /dev/null +++ b/queue-5.16/asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw_sx.patch @@ -0,0 +1,53 @@ +From 7f3d90a3519680dfa23e750f80bfdefc0f5eda4a Mon Sep 17 00:00:00 2001 +From: Mark Brown +Date: Tue, 1 Feb 2022 15:56:27 +0000 +Subject: ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw_sx() + +From: Mark Brown + +commit 7f3d90a3519680dfa23e750f80bfdefc0f5eda4a upstream. + +When writing out a stereo control we discard the change notification from +the first channel, meaning that events are only generated based on changes +to the second channel. Ensure that we report a change if either channel +has changed. + +Signed-off-by: Mark Brown +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20220201155629.120510-3-broonie@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/soc-ops.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/sound/soc/soc-ops.c ++++ b/sound/soc/soc-ops.c +@@ -427,6 +427,7 @@ int snd_soc_put_volsw_sx(struct snd_kcon + int min = mc->min; + unsigned int mask = (1U << (fls(min + max) - 1)) - 1; + int err = 0; ++ int ret; + unsigned int val, val_mask; + + val = ucontrol->value.integer.value[0]; +@@ -443,6 +444,7 @@ int snd_soc_put_volsw_sx(struct snd_kcon + err = snd_soc_component_update_bits(component, reg, val_mask, val); + if (err < 0) + return err; ++ ret = err; + + if (snd_soc_volsw_is_stereo(mc)) { + unsigned int val2; +@@ -453,6 +455,11 @@ int snd_soc_put_volsw_sx(struct snd_kcon + + err = snd_soc_component_update_bits(component, reg2, val_mask, + val2); ++ ++ /* Don't discard any error code or drop change flag */ ++ if (ret == 0 || err < 0) { ++ ret = err; ++ } + } + return err; + } diff --git a/queue-5.16/asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_xr_sx.patch b/queue-5.16/asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_xr_sx.patch new file mode 100644 index 00000000000..067a1890448 --- /dev/null +++ b/queue-5.16/asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_xr_sx.patch @@ -0,0 +1,46 @@ +From 2b7c46369f09c358164d31d17e5695185403185e Mon Sep 17 00:00:00 2001 +From: Mark Brown +Date: Tue, 1 Feb 2022 15:56:29 +0000 +Subject: ASoC: ops: Fix stereo change notifications in snd_soc_put_xr_sx() + +From: Mark Brown + +commit 2b7c46369f09c358164d31d17e5695185403185e upstream. + +When writing out a stereo control we discard the change notification from +the first channel, meaning that events are only generated based on changes +to the second channel. Ensure that we report a change if either channel +has changed. + +Signed-off-by: Mark Brown +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20220201155629.120510-5-broonie@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/soc-ops.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/sound/soc/soc-ops.c ++++ b/sound/soc/soc-ops.c +@@ -895,6 +895,7 @@ int snd_soc_put_xr_sx(struct snd_kcontro + unsigned long mask = (1UL<nbits)-1; + long max = mc->max; + long val = ucontrol->value.integer.value[0]; ++ int ret = 0; + unsigned int i; + + if (val < mc->min || val > mc->max) +@@ -909,9 +910,11 @@ int snd_soc_put_xr_sx(struct snd_kcontro + regmask, regval); + if (err < 0) + return err; ++ if (err > 0) ++ ret = err; + } + +- return 0; ++ return ret; + } + EXPORT_SYMBOL_GPL(snd_soc_put_xr_sx); + diff --git a/queue-5.16/cifs-fix-confusing-unneeded-warning-message-on-smb2.1-and-earlier.patch b/queue-5.16/cifs-fix-confusing-unneeded-warning-message-on-smb2.1-and-earlier.patch new file mode 100644 index 00000000000..c862c749ec5 --- /dev/null +++ b/queue-5.16/cifs-fix-confusing-unneeded-warning-message-on-smb2.1-and-earlier.patch @@ -0,0 +1,53 @@ +From 53923e0fe2098f90f339510aeaa0e1413ae99a16 Mon Sep 17 00:00:00 2001 +From: Steve French +Date: Wed, 16 Feb 2022 13:23:53 -0600 +Subject: cifs: fix confusing unneeded warning message on smb2.1 and earlier + +From: Steve French + +commit 53923e0fe2098f90f339510aeaa0e1413ae99a16 upstream. + +When mounting with SMB2.1 or earlier, even with nomultichannel, we +log the confusing warning message: + "CIFS: VFS: multichannel is not supported on this protocol version, use 3.0 or above" + +Fix this so that we don't log this unless they really are trying +to mount with multichannel. + +BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215608 +Reported-by: Kim Scarborough +Cc: stable@vger.kernel.org # 5.11+ +Reviewed-by: Paulo Alcantara (SUSE) +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman +--- + fs/cifs/sess.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +--- a/fs/cifs/sess.c ++++ b/fs/cifs/sess.c +@@ -76,11 +76,6 @@ int cifs_try_adding_channels(struct cifs + struct cifs_server_iface *ifaces = NULL; + size_t iface_count; + +- if (ses->server->dialect < SMB30_PROT_ID) { +- cifs_dbg(VFS, "multichannel is not supported on this protocol version, use 3.0 or above\n"); +- return 0; +- } +- + spin_lock(&ses->chan_lock); + + new_chan_count = old_chan_count = ses->chan_count; +@@ -94,6 +89,12 @@ int cifs_try_adding_channels(struct cifs + return 0; + } + ++ if (ses->server->dialect < SMB30_PROT_ID) { ++ spin_unlock(&ses->chan_lock); ++ cifs_dbg(VFS, "multichannel is not supported on this protocol version, use 3.0 or above\n"); ++ return 0; ++ } ++ + if (!(ses->server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) { + ses->chan_max = 1; + spin_unlock(&ses->chan_lock); diff --git a/queue-5.16/cifs-fix-set-of-group-sid-via-ntsd-xattrs.patch b/queue-5.16/cifs-fix-set-of-group-sid-via-ntsd-xattrs.patch new file mode 100644 index 00000000000..db467b50ba5 --- /dev/null +++ b/queue-5.16/cifs-fix-set-of-group-sid-via-ntsd-xattrs.patch @@ -0,0 +1,40 @@ +From dd5a927e411836eaef44eb9b00fece615e82e242 Mon Sep 17 00:00:00 2001 +From: Amir Goldstein +Date: Mon, 3 Jan 2022 16:50:25 +0200 +Subject: cifs: fix set of group SID via NTSD xattrs + +From: Amir Goldstein + +commit dd5a927e411836eaef44eb9b00fece615e82e242 upstream. + +'setcifsacl -g ' silently fails to set the group SID on server. + +Actually, the bug existed since commit 438471b67963 ("CIFS: Add support +for setting owner info, dos attributes, and create time"), but this fix +will not apply cleanly to kernel versions <= v5.10. + +Fixes: 3970acf7ddb9 ("SMB3: Add support for getting and setting SACLs") +Cc: stable@vger.kernel.org # 5.11+ +Signed-off-by: Amir Goldstein +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman +--- + fs/cifs/xattr.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/fs/cifs/xattr.c ++++ b/fs/cifs/xattr.c +@@ -175,11 +175,13 @@ static int cifs_xattr_set(const struct x + switch (handler->flags) { + case XATTR_CIFS_NTSD_FULL: + aclflags = (CIFS_ACL_OWNER | ++ CIFS_ACL_GROUP | + CIFS_ACL_DACL | + CIFS_ACL_SACL); + break; + case XATTR_CIFS_NTSD: + aclflags = (CIFS_ACL_OWNER | ++ CIFS_ACL_GROUP | + CIFS_ACL_DACL); + break; + case XATTR_CIFS_ACL: diff --git a/queue-5.16/mtd-rawnand-gpmi-don-t-leak-pm-reference-in-error-path.patch b/queue-5.16/mtd-rawnand-gpmi-don-t-leak-pm-reference-in-error-path.patch new file mode 100644 index 00000000000..f5308cc6da8 --- /dev/null +++ b/queue-5.16/mtd-rawnand-gpmi-don-t-leak-pm-reference-in-error-path.patch @@ -0,0 +1,42 @@ +From 9161f365c91614e5a3f5c6dcc44c3b1b33bc59c0 Mon Sep 17 00:00:00 2001 +From: Christian Eggers +Date: Tue, 25 Jan 2022 09:16:19 +0100 +Subject: mtd: rawnand: gpmi: don't leak PM reference in error path + +From: Christian Eggers + +commit 9161f365c91614e5a3f5c6dcc44c3b1b33bc59c0 upstream. + +If gpmi_nfc_apply_timings() fails, the PM runtime usage counter must be +dropped. + +Reported-by: Pavel Machek +Fixes: f53d4c109a66 ("mtd: rawnand: gpmi: Add ERR007117 protection for nfc_apply_timings") +Signed-off-by: Christian Eggers +Cc: stable@vger.kernel.org +Signed-off-by: Miquel Raynal +Link: https://lore.kernel.org/linux-mtd/20220125081619.6286-1-ceggers@arri.de +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c ++++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +@@ -2291,7 +2291,7 @@ static int gpmi_nfc_exec_op(struct nand_ + this->hw.must_apply_timings = false; + ret = gpmi_nfc_apply_timings(this); + if (ret) +- return ret; ++ goto out_pm; + } + + dev_dbg(this->dev, "%s: %d instructions\n", __func__, op->ninstrs); +@@ -2420,6 +2420,7 @@ unmap: + + this->bch = false; + ++out_pm: + pm_runtime_mark_last_busy(this->dev); + pm_runtime_put_autosuspend(this->dev); + diff --git a/queue-5.16/powerpc-603-fix-boot-failure-with-debug_pagealloc-and-kfence.patch b/queue-5.16/powerpc-603-fix-boot-failure-with-debug_pagealloc-and-kfence.patch new file mode 100644 index 00000000000..47de805fb1d --- /dev/null +++ b/queue-5.16/powerpc-603-fix-boot-failure-with-debug_pagealloc-and-kfence.patch @@ -0,0 +1,50 @@ +From 9bb162fa26ed76031ed0e7dbc77ccea0bf977758 Mon Sep 17 00:00:00 2001 +From: Christophe Leroy +Date: Tue, 7 Dec 2021 06:10:05 +0000 +Subject: powerpc/603: Fix boot failure with DEBUG_PAGEALLOC and KFENCE + +From: Christophe Leroy + +commit 9bb162fa26ed76031ed0e7dbc77ccea0bf977758 upstream. + +Allthough kernel text is always mapped with BATs, we still have +inittext mapped with pages, so TLB miss handling is required +when CONFIG_DEBUG_PAGEALLOC or CONFIG_KFENCE is set. + +The final solution should be to set a BAT that also maps inittext +but that BAT then needs to be cleared at end of init, and it will +require more changes to be able to do it properly. + +As DEBUG_PAGEALLOC or KFENCE are debugging, performance is not a big +deal so let's fix it simply for now to enable easy stable application. + +Fixes: 035b19a15a98 ("powerpc/32s: Always map kernel text and rodata with BATs") +Cc: stable@vger.kernel.org # v5.11+ +Reported-by: Maxime Bizon +Signed-off-by: Christophe Leroy +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/aea33b4813a26bdb9378b5f273f00bd5d4abe240.1638857364.git.christophe.leroy@csgroup.eu +Signed-off-by: Greg Kroah-Hartman +--- + arch/powerpc/kernel/head_book3s_32.S | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/powerpc/kernel/head_book3s_32.S ++++ b/arch/powerpc/kernel/head_book3s_32.S +@@ -421,14 +421,14 @@ InstructionTLBMiss: + */ + /* Get PTE (linux-style) and check access */ + mfspr r3,SPRN_IMISS +-#ifdef CONFIG_MODULES ++#if defined(CONFIG_MODULES) || defined(CONFIG_DEBUG_PAGEALLOC) || defined(CONFIG_KFENCE) + lis r1, TASK_SIZE@h /* check if kernel address */ + cmplw 0,r1,r3 + #endif + mfspr r2, SPRN_SDR1 + li r1,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC | _PAGE_USER + rlwinm r2, r2, 28, 0xfffff000 +-#ifdef CONFIG_MODULES ++#if defined(CONFIG_MODULES) || defined(CONFIG_DEBUG_PAGEALLOC) || defined(CONFIG_KFENCE) + bgt- 112f + lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */ + li r1,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC diff --git a/queue-5.16/powerpc-lib-sstep-fix-ptesync-build-error.patch b/queue-5.16/powerpc-lib-sstep-fix-ptesync-build-error.patch new file mode 100644 index 00000000000..defad0e39fd --- /dev/null +++ b/queue-5.16/powerpc-lib-sstep-fix-ptesync-build-error.patch @@ -0,0 +1,56 @@ +From fe663df7825811358531dc2e8a52d9eaa5e3515e Mon Sep 17 00:00:00 2001 +From: Anders Roxell +Date: Fri, 11 Feb 2022 01:51:13 +0100 +Subject: powerpc/lib/sstep: fix 'ptesync' build error + +From: Anders Roxell + +commit fe663df7825811358531dc2e8a52d9eaa5e3515e upstream. + +Building tinyconfig with gcc (Debian 11.2.0-16) and assembler (Debian +2.37.90.20220207) the following build error shows up: + + {standard input}: Assembler messages: + {standard input}:2088: Error: unrecognized opcode: `ptesync' + make[3]: *** [/builds/linux/scripts/Makefile.build:287: arch/powerpc/lib/sstep.o] Error 1 + +Add the 'ifdef CONFIG_PPC64' around the 'ptesync' in function +'emulate_update_regs()' to like it is in 'analyse_instr()'. Since it looks like +it got dropped inadvertently by commit 3cdfcbfd32b9 ("powerpc: Change +analyse_instr so it doesn't modify *regs"). + +A key detail is that analyse_instr() will never recognise lwsync or +ptesync on 32-bit (because of the existing ifdef), and as a result +emulate_update_regs() should never be called with an op specifying +either of those on 32-bit. So removing them from emulate_update_regs() +should be a nop in terms of runtime behaviour. + +Fixes: 3cdfcbfd32b9 ("powerpc: Change analyse_instr so it doesn't modify *regs") +Cc: stable@vger.kernel.org # v4.14+ +Suggested-by: Arnd Bergmann +Signed-off-by: Anders Roxell +[mpe: Add last paragraph of change log mentioning analyse_instr() details] +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20220211005113.1361436-1-anders.roxell@linaro.org +Signed-off-by: Greg Kroah-Hartman +--- + arch/powerpc/lib/sstep.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/powerpc/lib/sstep.c ++++ b/arch/powerpc/lib/sstep.c +@@ -3264,12 +3264,14 @@ void emulate_update_regs(struct pt_regs + case BARRIER_EIEIO: + eieio(); + break; ++#ifdef CONFIG_PPC64 + case BARRIER_LWSYNC: + asm volatile("lwsync" : : : "memory"); + break; + case BARRIER_PTESYNC: + asm volatile("ptesync" : : : "memory"); + break; ++#endif + } + break; + diff --git a/queue-5.16/scsi-ufs-fix-a-deadlock-in-the-error-handler.patch b/queue-5.16/scsi-ufs-fix-a-deadlock-in-the-error-handler.patch new file mode 100644 index 00000000000..ea8be0ebb08 --- /dev/null +++ b/queue-5.16/scsi-ufs-fix-a-deadlock-in-the-error-handler.patch @@ -0,0 +1,187 @@ +From 945c3cca05d78351bba29fa65d93834cb7934c7b Mon Sep 17 00:00:00 2001 +From: Bart Van Assche +Date: Fri, 3 Dec 2021 15:19:42 -0800 +Subject: scsi: ufs: Fix a deadlock in the error handler + +From: Bart Van Assche + +commit 945c3cca05d78351bba29fa65d93834cb7934c7b upstream. + +The following deadlock has been observed on a test setup: + + - All tags allocated + + - The SCSI error handler calls ufshcd_eh_host_reset_handler() + + - ufshcd_eh_host_reset_handler() queues work that calls + ufshcd_err_handler() + + - ufshcd_err_handler() locks up as follows: + +Workqueue: ufs_eh_wq_0 ufshcd_err_handler.cfi_jt +Call trace: + __switch_to+0x298/0x5d8 + __schedule+0x6cc/0xa94 + schedule+0x12c/0x298 + blk_mq_get_tag+0x210/0x480 + __blk_mq_alloc_request+0x1c8/0x284 + blk_get_request+0x74/0x134 + ufshcd_exec_dev_cmd+0x68/0x640 + ufshcd_verify_dev_init+0x68/0x35c + ufshcd_probe_hba+0x12c/0x1cb8 + ufshcd_host_reset_and_restore+0x88/0x254 + ufshcd_reset_and_restore+0xd0/0x354 + ufshcd_err_handler+0x408/0xc58 + process_one_work+0x24c/0x66c + worker_thread+0x3e8/0xa4c + kthread+0x150/0x1b4 + ret_from_fork+0x10/0x30 + +Fix this lockup by making ufshcd_exec_dev_cmd() allocate a reserved +request. + +Link: https://lore.kernel.org/r/20211203231950.193369-10-bvanassche@acm.org +Tested-by: Bean Huo +Reviewed-by: Adrian Hunter +Reviewed-by: Bean Huo +Signed-off-by: Bart Van Assche +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/ufs/ufshcd.c | 53 ++++++++++++---------------------------------- + drivers/scsi/ufs/ufshcd.h | 2 + + 2 files changed, 16 insertions(+), 39 deletions(-) + +--- a/drivers/scsi/ufs/ufshcd.c ++++ b/drivers/scsi/ufs/ufshcd.c +@@ -128,8 +128,9 @@ EXPORT_SYMBOL_GPL(ufshcd_dump_regs); + enum { + UFSHCD_MAX_CHANNEL = 0, + UFSHCD_MAX_ID = 1, +- UFSHCD_CMD_PER_LUN = 32, +- UFSHCD_CAN_QUEUE = 32, ++ UFSHCD_NUM_RESERVED = 1, ++ UFSHCD_CMD_PER_LUN = 32 - UFSHCD_NUM_RESERVED, ++ UFSHCD_CAN_QUEUE = 32 - UFSHCD_NUM_RESERVED, + }; + + static const char *const ufshcd_state_name[] = { +@@ -2194,6 +2195,7 @@ static inline int ufshcd_hba_capabilitie + hba->nutrs = (hba->capabilities & MASK_TRANSFER_REQUESTS_SLOTS) + 1; + hba->nutmrs = + ((hba->capabilities & MASK_TASK_MANAGEMENT_REQUEST_SLOTS) >> 16) + 1; ++ hba->reserved_slot = hba->nutrs - 1; + + /* Read crypto capabilities */ + err = ufshcd_hba_init_crypto_capabilities(hba); +@@ -2941,30 +2943,15 @@ static int ufshcd_wait_for_dev_cmd(struc + static int ufshcd_exec_dev_cmd(struct ufs_hba *hba, + enum dev_cmd_type cmd_type, int timeout) + { +- struct request_queue *q = hba->cmd_queue; + DECLARE_COMPLETION_ONSTACK(wait); +- struct request *req; ++ const u32 tag = hba->reserved_slot; + struct ufshcd_lrb *lrbp; + int err; +- int tag; + +- down_read(&hba->clk_scaling_lock); ++ /* Protects use of hba->reserved_slot. */ ++ lockdep_assert_held(&hba->dev_cmd.lock); + +- /* +- * Get free slot, sleep if slots are unavailable. +- * Even though we use wait_event() which sleeps indefinitely, +- * the maximum wait time is bounded by SCSI request timeout. +- */ +- req = blk_mq_alloc_request(q, REQ_OP_DRV_OUT, 0); +- if (IS_ERR(req)) { +- err = PTR_ERR(req); +- goto out_unlock; +- } +- tag = req->tag; +- WARN_ONCE(tag < 0, "Invalid tag %d\n", tag); +- /* Set the timeout such that the SCSI error handler is not activated. */ +- req->timeout = msecs_to_jiffies(2 * timeout); +- blk_mq_start_request(req); ++ down_read(&hba->clk_scaling_lock); + + lrbp = &hba->lrb[tag]; + WARN_ON(lrbp->cmd); +@@ -2982,8 +2969,6 @@ static int ufshcd_exec_dev_cmd(struct uf + (struct utp_upiu_req *)lrbp->ucd_rsp_ptr); + + out: +- blk_mq_free_request(req); +-out_unlock: + up_read(&hba->clk_scaling_lock); + return err; + } +@@ -6716,23 +6701,16 @@ static int ufshcd_issue_devman_upiu_cmd( + enum dev_cmd_type cmd_type, + enum query_opcode desc_op) + { +- struct request_queue *q = hba->cmd_queue; + DECLARE_COMPLETION_ONSTACK(wait); +- struct request *req; ++ const u32 tag = hba->reserved_slot; + struct ufshcd_lrb *lrbp; + int err = 0; +- int tag; + u8 upiu_flags; + +- down_read(&hba->clk_scaling_lock); ++ /* Protects use of hba->reserved_slot. */ ++ lockdep_assert_held(&hba->dev_cmd.lock); + +- req = blk_mq_alloc_request(q, REQ_OP_DRV_OUT, 0); +- if (IS_ERR(req)) { +- err = PTR_ERR(req); +- goto out_unlock; +- } +- tag = req->tag; +- WARN_ONCE(tag < 0, "Invalid tag %d\n", tag); ++ down_read(&hba->clk_scaling_lock); + + lrbp = &hba->lrb[tag]; + WARN_ON(lrbp->cmd); +@@ -6801,9 +6779,6 @@ static int ufshcd_issue_devman_upiu_cmd( + ufshcd_add_query_upiu_trace(hba, err ? UFS_QUERY_ERR : UFS_QUERY_COMP, + (struct utp_upiu_req *)lrbp->ucd_rsp_ptr); + +- blk_mq_free_request(req); +- +-out_unlock: + up_read(&hba->clk_scaling_lock); + return err; + } +@@ -9538,8 +9513,8 @@ int ufshcd_init(struct ufs_hba *hba, voi + /* Configure LRB */ + ufshcd_host_memory_configure(hba); + +- host->can_queue = hba->nutrs; +- host->cmd_per_lun = hba->nutrs; ++ host->can_queue = hba->nutrs - UFSHCD_NUM_RESERVED; ++ host->cmd_per_lun = hba->nutrs - UFSHCD_NUM_RESERVED; + host->max_id = UFSHCD_MAX_ID; + host->max_lun = UFS_MAX_LUNS; + host->max_channel = UFSHCD_MAX_CHANNEL; +--- a/drivers/scsi/ufs/ufshcd.h ++++ b/drivers/scsi/ufs/ufshcd.h +@@ -744,6 +744,7 @@ struct ufs_hba_monitor { + * @capabilities: UFS Controller Capabilities + * @nutrs: Transfer Request Queue depth supported by controller + * @nutmrs: Task Management Queue depth supported by controller ++ * @reserved_slot: Used to submit device commands. Protected by @dev_cmd.lock. + * @ufs_version: UFS Version to which controller complies + * @vops: pointer to variant specific operations + * @priv: pointer to variant specific private data +@@ -836,6 +837,7 @@ struct ufs_hba { + u32 capabilities; + int nutrs; + int nutmrs; ++ u32 reserved_slot; + u32 ufs_version; + const struct ufs_hba_variant_ops *vops; + struct ufs_hba_variant_params *vps; diff --git a/queue-5.16/scsi-ufs-remove-dead-code.patch b/queue-5.16/scsi-ufs-remove-dead-code.patch new file mode 100644 index 00000000000..a57f067ade7 --- /dev/null +++ b/queue-5.16/scsi-ufs-remove-dead-code.patch @@ -0,0 +1,48 @@ +From d77ea8226b3be23b0b45aa42851243b62a27bda1 Mon Sep 17 00:00:00 2001 +From: Bart Van Assche +Date: Fri, 3 Dec 2021 15:19:38 -0800 +Subject: scsi: ufs: Remove dead code + +From: Bart Van Assche + +commit d77ea8226b3be23b0b45aa42851243b62a27bda1 upstream. + +Commit 7252a3603015 ("scsi: ufs: Avoid busy-waiting by eliminating tag +conflicts") guarantees that 'tag' is not in use by any SCSI command. +Remove the check that returns early if a conflict occurs. + +Link: https://lore.kernel.org/r/20211203231950.193369-6-bvanassche@acm.org +Tested-by: Bean Huo +Reviewed-by: Bean Huo +Acked-by: Avri Altman +Signed-off-by: Bart Van Assche +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/ufs/ufshcd.c | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +--- a/drivers/scsi/ufs/ufshcd.c ++++ b/drivers/scsi/ufs/ufshcd.c +@@ -6734,11 +6734,6 @@ static int ufshcd_issue_devman_upiu_cmd( + tag = req->tag; + WARN_ONCE(tag < 0, "Invalid tag %d\n", tag); + +- if (unlikely(test_bit(tag, &hba->outstanding_reqs))) { +- err = -EBUSY; +- goto out; +- } +- + lrbp = &hba->lrb[tag]; + WARN_ON(lrbp->cmd); + lrbp->cmd = NULL; +@@ -6806,8 +6801,8 @@ static int ufshcd_issue_devman_upiu_cmd( + ufshcd_add_query_upiu_trace(hba, err ? UFS_QUERY_ERR : UFS_QUERY_COMP, + (struct utp_upiu_req *)lrbp->ucd_rsp_ptr); + +-out: + blk_mq_free_request(req); ++ + out_unlock: + up_read(&hba->clk_scaling_lock); + return err; diff --git a/queue-5.16/series b/queue-5.16/series index 8de3cfa7ade..627b96e2903 100644 --- a/queue-5.16/series +++ b/queue-5.16/series @@ -131,3 +131,26 @@ net-mscc-ocelot-fix-use-after-free-in-ocelot_vlan_del.patch net-bridge-multicast-notify-switchdev-driver-whenever-mc-processing-gets-disabled.patch perf-bpf-defer-freeing-string-after-possible-strlen-on-it.patch selftests-exec-add-non-regular-to-test_gen_progs.patch +arm64-correct-wrong-label-in-macro-__init_el2_gicv3.patch +alsa-usb-audio-don-t-abort-resume-upon-errors.patch +alsa-usb-audio-revert-to-implicit_fb_fixed_dev-for-m-audio-fasttrack-ultra.patch +alsa-memalloc-fix-dma_need_sync-checks.patch +alsa-memalloc-invalidate-sg-pages-before-sync.patch +alsa-hda-realtek-add-quirk-for-legion-y9000x-2019.patch +alsa-hda-realtek-fix-deadlock-by-coef-mutex.patch +alsa-hda-fix-regression-on-forced-probe-mask-option.patch +alsa-hda-fix-missing-codec-probe-on-shenker-dock-15.patch +asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw.patch +asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw_range.patch +asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw_sx.patch +asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_xr_sx.patch +cifs-fix-set-of-group-sid-via-ntsd-xattrs.patch +cifs-fix-confusing-unneeded-warning-message-on-smb2.1-and-earlier.patch +acpi-processor-idle-fix-lockup-regression-on-32-bit-thinkpad-t40.patch +powerpc-603-fix-boot-failure-with-debug_pagealloc-and-kfence.patch +powerpc-lib-sstep-fix-ptesync-build-error.patch +mtd-rawnand-gpmi-don-t-leak-pm-reference-in-error-path.patch +smb3-fix-snapshot-mount-option.patch +tipc-fix-wrong-notification-node-addresses.patch +scsi-ufs-remove-dead-code.patch +scsi-ufs-fix-a-deadlock-in-the-error-handler.patch diff --git a/queue-5.16/smb3-fix-snapshot-mount-option.patch b/queue-5.16/smb3-fix-snapshot-mount-option.patch new file mode 100644 index 00000000000..282105bd2b2 --- /dev/null +++ b/queue-5.16/smb3-fix-snapshot-mount-option.patch @@ -0,0 +1,42 @@ +From 9405b5f8b20c2bfa6523a555279a0379640dc136 Mon Sep 17 00:00:00 2001 +From: Steve French +Date: Sat, 12 Feb 2022 01:54:14 -0600 +Subject: smb3: fix snapshot mount option + +From: Steve French + +commit 9405b5f8b20c2bfa6523a555279a0379640dc136 upstream. + +The conversion to the new API broke the snapshot mount option +due to 32 vs. 64 bit type mismatch + +Fixes: 24e0a1eff9e2 ("cifs: switch to new mount api") +Cc: stable@vger.kernel.org # 5.11+ +Reported-by: +Acked-by: Ronnie Sahlberg +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman +--- + fs/cifs/fs_context.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/fs/cifs/fs_context.c ++++ b/fs/cifs/fs_context.c +@@ -147,7 +147,7 @@ const struct fs_parameter_spec smb3_fs_p + fsparam_u32("echo_interval", Opt_echo_interval), + fsparam_u32("max_credits", Opt_max_credits), + fsparam_u32("handletimeout", Opt_handletimeout), +- fsparam_u32("snapshot", Opt_snapshot), ++ fsparam_u64("snapshot", Opt_snapshot), + fsparam_u32("max_channels", Opt_max_channels), + + /* Mount options which take string value */ +@@ -1072,7 +1072,7 @@ static int smb3_fs_context_parse_param(s + ctx->echo_interval = result.uint_32; + break; + case Opt_snapshot: +- ctx->snapshot_time = result.uint_32; ++ ctx->snapshot_time = result.uint_64; + break; + case Opt_max_credits: + if (result.uint_32 < 20 || result.uint_32 > 60000) { diff --git a/queue-5.16/tipc-fix-wrong-notification-node-addresses.patch b/queue-5.16/tipc-fix-wrong-notification-node-addresses.patch new file mode 100644 index 00000000000..bb645be9df5 --- /dev/null +++ b/queue-5.16/tipc-fix-wrong-notification-node-addresses.patch @@ -0,0 +1,64 @@ +From c08e58438d4a709fb451b6d7d33432cc9907a2a8 Mon Sep 17 00:00:00 2001 +From: Jon Maloy +Date: Tue, 15 Feb 2022 21:00:09 -0500 +Subject: tipc: fix wrong notification node addresses + +From: Jon Maloy + +commit c08e58438d4a709fb451b6d7d33432cc9907a2a8 upstream. + +The previous bug fix had an unfortunate side effect that broke +distribution of binding table entries between nodes. The updated +tipc_sock_addr struct is also used further down in the same +function, and there the old value is still the correct one. + +Fixes: 032062f363b4 ("tipc: fix wrong publisher node address in link publications") +Signed-off-by: Jon Maloy +Link: https://lore.kernel.org/r/20220216020009.3404578-1-jmaloy@redhat.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/tipc/node.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +--- a/net/tipc/node.c ++++ b/net/tipc/node.c +@@ -403,7 +403,7 @@ static void tipc_node_write_unlock(struc + u32 flags = n->action_flags; + struct list_head *publ_list; + struct tipc_uaddr ua; +- u32 bearer_id; ++ u32 bearer_id, node; + + if (likely(!flags)) { + write_unlock_bh(&n->lock); +@@ -414,6 +414,7 @@ static void tipc_node_write_unlock(struc + TIPC_LINK_STATE, n->addr, n->addr); + sk.ref = n->link_id; + sk.node = tipc_own_addr(net); ++ node = n->addr; + bearer_id = n->link_id & 0xffff; + publ_list = &n->publ_list; + +@@ -423,17 +424,17 @@ static void tipc_node_write_unlock(struc + write_unlock_bh(&n->lock); + + if (flags & TIPC_NOTIFY_NODE_DOWN) +- tipc_publ_notify(net, publ_list, sk.node, n->capabilities); ++ tipc_publ_notify(net, publ_list, node, n->capabilities); + + if (flags & TIPC_NOTIFY_NODE_UP) +- tipc_named_node_up(net, sk.node, n->capabilities); ++ tipc_named_node_up(net, node, n->capabilities); + + if (flags & TIPC_NOTIFY_LINK_UP) { +- tipc_mon_peer_up(net, sk.node, bearer_id); ++ tipc_mon_peer_up(net, node, bearer_id); + tipc_nametbl_publish(net, &ua, &sk, sk.ref); + } + if (flags & TIPC_NOTIFY_LINK_DOWN) { +- tipc_mon_peer_down(net, sk.node, bearer_id); ++ tipc_mon_peer_down(net, node, bearer_id); + tipc_nametbl_withdraw(net, &ua, &sk, sk.ref); + } + }