From: Greg Kroah-Hartman Date: Mon, 4 May 2020 09:59:51 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v4.4.222~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dcc353eac6d7d00b1ac36420dc25299c79c70a91;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: alsa-hda-hdmi-fix-without-unlocked-before-return.patch alsa-hda-realtek-two-front-mics-on-a-lenovo-thinkcenter.patch alsa-pcm-oss-place-the-plugin-buffer-overflow-checks-correctly.patch dm-verity-fec-fix-hash-block-number-in-verity_fec_decode.patch pm-acpi-output-correct-message-on-target-power-state.patch pm-hibernate-freeze-kernel-threads-in-software_resume.patch --- diff --git a/queue-4.14/alsa-hda-hdmi-fix-without-unlocked-before-return.patch b/queue-4.14/alsa-hda-hdmi-fix-without-unlocked-before-return.patch new file mode 100644 index 00000000000..2b5790965ac --- /dev/null +++ b/queue-4.14/alsa-hda-hdmi-fix-without-unlocked-before-return.patch @@ -0,0 +1,41 @@ +From a2f647240998aa49632fb09b01388fdf2b87acfc Mon Sep 17 00:00:00 2001 +From: Wu Bo +Date: Sun, 26 Apr 2020 21:17:22 +0800 +Subject: ALSA: hda/hdmi: fix without unlocked before return + +From: Wu Bo + +commit a2f647240998aa49632fb09b01388fdf2b87acfc upstream. + +Fix the following coccicheck warning: +sound/pci/hda/patch_hdmi.c:1852:2-8: preceding lock on line 1846 + +After add sanity check to pass klockwork check, +The spdif_mutex should be unlock before return true +in check_non_pcm_per_cvt(). + +Fixes: 960a581e22d9 ("ALSA: hda: fix some klockwork scan warnings") +Signed-off-by: Wu Bo +Cc: +Link: https://lore.kernel.org/r/1587907042-694161-1-git-send-email-wubo40@huawei.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_hdmi.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/sound/pci/hda/patch_hdmi.c ++++ b/sound/pci/hda/patch_hdmi.c +@@ -1849,8 +1849,10 @@ static bool check_non_pcm_per_cvt(struct + /* Add sanity check to pass klockwork check. + * This should never happen. + */ +- if (WARN_ON(spdif == NULL)) ++ if (WARN_ON(spdif == NULL)) { ++ mutex_unlock(&codec->spdif_mutex); + return true; ++ } + non_pcm = !!(spdif->status & IEC958_AES0_NONAUDIO); + mutex_unlock(&codec->spdif_mutex); + return non_pcm; diff --git a/queue-4.14/alsa-hda-realtek-two-front-mics-on-a-lenovo-thinkcenter.patch b/queue-4.14/alsa-hda-realtek-two-front-mics-on-a-lenovo-thinkcenter.patch new file mode 100644 index 00000000000..ead7e5faab7 --- /dev/null +++ b/queue-4.14/alsa-hda-realtek-two-front-mics-on-a-lenovo-thinkcenter.patch @@ -0,0 +1,33 @@ +From ef0b3203c758b6b8abdb5dca651880347eae6b8c Mon Sep 17 00:00:00 2001 +From: Hui Wang +Date: Mon, 27 Apr 2020 11:00:39 +0800 +Subject: ALSA: hda/realtek - Two front mics on a Lenovo ThinkCenter + +From: Hui Wang + +commit ef0b3203c758b6b8abdb5dca651880347eae6b8c upstream. + +This new Lenovo ThinkCenter has two front mics which can't be handled +by PA so far, so apply the fixup ALC283_FIXUP_HEADSET_MIC to change +the location for one of the mics. + +Cc: +Signed-off-by: Hui Wang +Link: https://lore.kernel.org/r/20200427030039.10121-1-hui.wang@canonical.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 +@@ -6590,6 +6590,7 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), + SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC), + SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS), ++ SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), + SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), + SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), + SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), diff --git a/queue-4.14/alsa-pcm-oss-place-the-plugin-buffer-overflow-checks-correctly.patch b/queue-4.14/alsa-pcm-oss-place-the-plugin-buffer-overflow-checks-correctly.patch new file mode 100644 index 00000000000..570e214c7c5 --- /dev/null +++ b/queue-4.14/alsa-pcm-oss-place-the-plugin-buffer-overflow-checks-correctly.patch @@ -0,0 +1,92 @@ +From 4285de0725b1bf73608abbcd35ad7fd3ddc0b61e Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Fri, 24 Apr 2020 21:33:50 +0200 +Subject: ALSA: pcm: oss: Place the plugin buffer overflow checks correctly + +From: Takashi Iwai + +commit 4285de0725b1bf73608abbcd35ad7fd3ddc0b61e upstream. + +The checks of the plugin buffer overflow in the previous fix by commit + f2ecf903ef06 ("ALSA: pcm: oss: Avoid plugin buffer overflow") +are put in the wrong places mistakenly, which leads to the expected +(repeated) sound when the rate plugin is involved. Fix in the right +places. + +Also, at those right places, the zero check is needed for the +termination node, so added there as well, and let's get it done, +finally. + +Fixes: f2ecf903ef06 ("ALSA: pcm: oss: Avoid plugin buffer overflow") +Cc: +Link: https://lore.kernel.org/r/20200424193350.19678-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/core/oss/pcm_plugin.c | 20 ++++++++++++-------- + 1 file changed, 12 insertions(+), 8 deletions(-) + +--- a/sound/core/oss/pcm_plugin.c ++++ b/sound/core/oss/pcm_plugin.c +@@ -211,21 +211,23 @@ static snd_pcm_sframes_t plug_client_siz + if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + plugin = snd_pcm_plug_last(plug); + while (plugin && drv_frames > 0) { +- if (check_size && drv_frames > plugin->buf_frames) +- drv_frames = plugin->buf_frames; + plugin_prev = plugin->prev; + if (plugin->src_frames) + drv_frames = plugin->src_frames(plugin, drv_frames); ++ if (check_size && plugin->buf_frames && ++ drv_frames > plugin->buf_frames) ++ drv_frames = plugin->buf_frames; + plugin = plugin_prev; + } + } else if (stream == SNDRV_PCM_STREAM_CAPTURE) { + plugin = snd_pcm_plug_first(plug); + while (plugin && drv_frames > 0) { + plugin_next = plugin->next; ++ if (check_size && plugin->buf_frames && ++ drv_frames > plugin->buf_frames) ++ drv_frames = plugin->buf_frames; + if (plugin->dst_frames) + drv_frames = plugin->dst_frames(plugin, drv_frames); +- if (check_size && drv_frames > plugin->buf_frames) +- drv_frames = plugin->buf_frames; + plugin = plugin_next; + } + } else +@@ -251,26 +253,28 @@ static snd_pcm_sframes_t plug_slave_size + plugin = snd_pcm_plug_first(plug); + while (plugin && frames > 0) { + plugin_next = plugin->next; ++ if (check_size && plugin->buf_frames && ++ frames > plugin->buf_frames) ++ frames = plugin->buf_frames; + if (plugin->dst_frames) { + frames = plugin->dst_frames(plugin, frames); + if (frames < 0) + return frames; + } +- if (check_size && frames > plugin->buf_frames) +- frames = plugin->buf_frames; + plugin = plugin_next; + } + } else if (stream == SNDRV_PCM_STREAM_CAPTURE) { + plugin = snd_pcm_plug_last(plug); + while (plugin) { +- if (check_size && frames > plugin->buf_frames) +- frames = plugin->buf_frames; + plugin_prev = plugin->prev; + if (plugin->src_frames) { + frames = plugin->src_frames(plugin, frames); + if (frames < 0) + return frames; + } ++ if (check_size && plugin->buf_frames && ++ frames > plugin->buf_frames) ++ frames = plugin->buf_frames; + plugin = plugin_prev; + } + } else diff --git a/queue-4.14/dm-verity-fec-fix-hash-block-number-in-verity_fec_decode.patch b/queue-4.14/dm-verity-fec-fix-hash-block-number-in-verity_fec_decode.patch new file mode 100644 index 00000000000..6877e8ac877 --- /dev/null +++ b/queue-4.14/dm-verity-fec-fix-hash-block-number-in-verity_fec_decode.patch @@ -0,0 +1,35 @@ +From ad4e80a639fc61d5ecebb03caa5cdbfb91fcebfc Mon Sep 17 00:00:00 2001 +From: Sunwook Eom +Date: Fri, 10 Apr 2020 12:54:19 +0900 +Subject: dm verity fec: fix hash block number in verity_fec_decode + +From: Sunwook Eom + +commit ad4e80a639fc61d5ecebb03caa5cdbfb91fcebfc upstream. + +The error correction data is computed as if data and hash blocks +were concatenated. But hash block number starts from v->hash_start. +So, we have to calculate hash block number based on that. + +Fixes: a739ff3f543af ("dm verity: add support for forward error correction") +Cc: stable@vger.kernel.org +Signed-off-by: Sunwook Eom +Reviewed-by: Sami Tolvanen +Signed-off-by: Mike Snitzer +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/md/dm-verity-fec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/md/dm-verity-fec.c ++++ b/drivers/md/dm-verity-fec.c +@@ -436,7 +436,7 @@ int verity_fec_decode(struct dm_verity * + fio->level++; + + if (type == DM_VERITY_BLOCK_TYPE_METADATA) +- block += v->data_blocks; ++ block = block - v->hash_start + v->data_blocks; + + /* + * For RS(M, N), the continuous FEC data is divided into blocks of N diff --git a/queue-4.14/pm-acpi-output-correct-message-on-target-power-state.patch b/queue-4.14/pm-acpi-output-correct-message-on-target-power-state.patch new file mode 100644 index 00000000000..30828f80afe --- /dev/null +++ b/queue-4.14/pm-acpi-output-correct-message-on-target-power-state.patch @@ -0,0 +1,43 @@ +From a9b760b0266f563b4784f695bbd0e717610dc10a Mon Sep 17 00:00:00 2001 +From: Kai-Heng Feng +Date: Tue, 21 Apr 2020 15:55:16 +0800 +Subject: PM: ACPI: Output correct message on target power state + +From: Kai-Heng Feng + +commit a9b760b0266f563b4784f695bbd0e717610dc10a upstream. + +Transitioned power state logged at the end of setting ACPI power. + +However, D3cold won't be in the message because state can only be +D3hot at most. + +Use target_state to corretly report when power state is D3cold. + +Cc: All applicable +Signed-off-by: Kai-Heng Feng +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/device_pm.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/acpi/device_pm.c ++++ b/drivers/acpi/device_pm.c +@@ -227,13 +227,13 @@ int acpi_device_set_power(struct acpi_de + end: + if (result) { + dev_warn(&device->dev, "Failed to change power state to %s\n", +- acpi_power_state_string(state)); ++ acpi_power_state_string(target_state)); + } else { + device->power.state = target_state; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Device [%s] transitioned to %s\n", + device->pnp.bus_id, +- acpi_power_state_string(state))); ++ acpi_power_state_string(target_state))); + } + + return result; diff --git a/queue-4.14/pm-hibernate-freeze-kernel-threads-in-software_resume.patch b/queue-4.14/pm-hibernate-freeze-kernel-threads-in-software_resume.patch new file mode 100644 index 00000000000..a29e4c45878 --- /dev/null +++ b/queue-4.14/pm-hibernate-freeze-kernel-threads-in-software_resume.patch @@ -0,0 +1,46 @@ +From 2351f8d295ed63393190e39c2f7c1fee1a80578f Mon Sep 17 00:00:00 2001 +From: Dexuan Cui +Date: Thu, 23 Apr 2020 20:40:16 -0700 +Subject: PM: hibernate: Freeze kernel threads in software_resume() + +From: Dexuan Cui + +commit 2351f8d295ed63393190e39c2f7c1fee1a80578f upstream. + +Currently the kernel threads are not frozen in software_resume(), so +between dpm_suspend_start(PMSG_QUIESCE) and resume_target_kernel(), +system_freezable_power_efficient_wq can still try to submit SCSI +commands and this can cause a panic since the low level SCSI driver +(e.g. hv_storvsc) has quiesced the SCSI adapter and can not accept +any SCSI commands: https://lkml.org/lkml/2020/4/10/47 + +At first I posted a fix (https://lkml.org/lkml/2020/4/21/1318) trying +to resolve the issue from hv_storvsc, but with the help of +Bart Van Assche, I realized it's better to fix software_resume(), +since this looks like a generic issue, not only pertaining to SCSI. + +Cc: All applicable +Signed-off-by: Dexuan Cui +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/power/hibernate.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/kernel/power/hibernate.c ++++ b/kernel/power/hibernate.c +@@ -892,6 +892,13 @@ static int software_resume(void) + error = freeze_processes(); + if (error) + goto Close_Finish; ++ ++ error = freeze_kernel_threads(); ++ if (error) { ++ thaw_processes(); ++ goto Close_Finish; ++ } ++ + error = load_image_and_restore(); + thaw_processes(); + Finish: diff --git a/queue-4.14/series b/queue-4.14/series index 44bbd767ec7..d5f1255c264 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -7,3 +7,9 @@ btrfs-fix-block-group-leak-when-removing-fails.patch btrfs-fix-partial-loss-of-prealloc-extent-past-i_size-after-fsync.patch mmc-sdhci-xenon-fix-annoying-1.8v-regulator-warning.patch mmc-sdhci-pci-fix-emmc-driver-strength-for-byt-based-controllers.patch +alsa-hda-realtek-two-front-mics-on-a-lenovo-thinkcenter.patch +alsa-hda-hdmi-fix-without-unlocked-before-return.patch +alsa-pcm-oss-place-the-plugin-buffer-overflow-checks-correctly.patch +pm-acpi-output-correct-message-on-target-power-state.patch +pm-hibernate-freeze-kernel-threads-in-software_resume.patch +dm-verity-fec-fix-hash-block-number-in-verity_fec_decode.patch