From: Greg Kroah-Hartman Date: Sun, 28 Feb 2021 14:02:32 +0000 (+0100) Subject: 4.19-stable patches X-Git-Tag: v4.4.259~80 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9c131d5e44488da2bf352cac62a28388c168fef5;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: alsa-usb-audio-fix-pcm-buffer-allocation-in-non-vmalloc-mode.patch bfq-avoid-false-bfq-queue-merging.patch kdb-make-memory-allocations-more-robust.patch mips-vmlinux.lds.s-add-missing-page_aligned_data-section.patch pci-qcom-use-phy_refclk_use_pad-only-for-ipq8064.patch random-fix-the-rndreseedcrng-ioctl.patch --- diff --git a/queue-4.19/alsa-usb-audio-fix-pcm-buffer-allocation-in-non-vmalloc-mode.patch b/queue-4.19/alsa-usb-audio-fix-pcm-buffer-allocation-in-non-vmalloc-mode.patch new file mode 100644 index 00000000000..ba45026a230 --- /dev/null +++ b/queue-4.19/alsa-usb-audio-fix-pcm-buffer-allocation-in-non-vmalloc-mode.patch @@ -0,0 +1,41 @@ +From fb3c293b82c31a9a68fbcf4e7a45fadd8a47ea2b Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Fri, 5 Feb 2021 15:45:59 +0100 +Subject: ALSA: usb-audio: Fix PCM buffer allocation in non-vmalloc mode + +From: Takashi Iwai + +commit fb3c293b82c31a9a68fbcf4e7a45fadd8a47ea2b upstream. + +The commit f274baa49be6 ("ALSA: usb-audio: Allow non-vmalloc buffer +for PCM buffers") introduced the mode to allocate coherent pages for +PCM buffers, and it used bus->controller device as its DMA device. +It turned out, however, that bus->sysdev is a more appropriate device +to be used for DMA mapping in HCD code. + +This patch corrects the device reference accordingly. + +Note that, on most platforms, both point to the very same device, +hence this patch doesn't change anything practically. But on +platforms like xhcd-plat hcd, the change becomes effective. + +Fixes: f274baa49be6 ("ALSA: usb-audio: Allow non-vmalloc buffer for PCM buffers") +Cc: +Link: https://lore.kernel.org/r/20210205144559.29555-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/pcm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/usb/pcm.c ++++ b/sound/usb/pcm.c +@@ -1853,7 +1853,7 @@ void snd_usb_preallocate_buffer(struct s + { + struct snd_pcm *pcm = subs->stream->pcm; + struct snd_pcm_substream *s = pcm->streams[subs->direction].substream; +- struct device *dev = subs->dev->bus->controller; ++ struct device *dev = subs->dev->bus->sysdev; + + if (!snd_usb_use_vmalloc) + snd_pcm_lib_preallocate_pages(s, SNDRV_DMA_TYPE_DEV_SG, diff --git a/queue-4.19/bfq-avoid-false-bfq-queue-merging.patch b/queue-4.19/bfq-avoid-false-bfq-queue-merging.patch new file mode 100644 index 00000000000..13a349caa73 --- /dev/null +++ b/queue-4.19/bfq-avoid-false-bfq-queue-merging.patch @@ -0,0 +1,55 @@ +From 41e76c85660c022c6bf5713bfb6c21e64a487cec Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Fri, 5 Jun 2020 16:16:16 +0200 +Subject: bfq: Avoid false bfq queue merging + +From: Jan Kara + +commit 41e76c85660c022c6bf5713bfb6c21e64a487cec upstream. + +bfq_setup_cooperator() uses bfqd->in_serv_last_pos so detect whether it +makes sense to merge current bfq queue with the in-service queue. +However if the in-service queue is freshly scheduled and didn't dispatch +any requests yet, bfqd->in_serv_last_pos is stale and contains value +from the previously scheduled bfq queue which can thus result in a bogus +decision that the two queues should be merged. This bug can be observed +for example with the following fio jobfile: + +[global] +direct=0 +ioengine=sync +invalidate=1 +size=1g +rw=read + +[reader] +numjobs=4 +directory=/mnt + +where the 4 processes will end up in the one shared bfq queue although +they do IO to physically very distant files (for some reason I was able to +observe this only with slice_idle=1ms setting). + +Fix the problem by invalidating bfqd->in_serv_last_pos when switching +in-service queue. + +Fixes: 058fdecc6de7 ("block, bfq: fix in-service-queue check for queue merging") +CC: stable@vger.kernel.org +Signed-off-by: Jan Kara +Acked-by: Paolo Valente +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + block/bfq-iosched.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/block/bfq-iosched.c ++++ b/block/bfq-iosched.c +@@ -2478,6 +2478,7 @@ static void __bfq_set_in_service_queue(s + } + + bfqd->in_service_queue = bfqq; ++ bfqd->in_serv_last_pos = 0; + } + + /* diff --git a/queue-4.19/kdb-make-memory-allocations-more-robust.patch b/queue-4.19/kdb-make-memory-allocations-more-robust.patch new file mode 100644 index 00000000000..f3e3f9f5e01 --- /dev/null +++ b/queue-4.19/kdb-make-memory-allocations-more-robust.patch @@ -0,0 +1,40 @@ +From 93f7a6d818deef69d0ba652d46bae6fbabbf365c Mon Sep 17 00:00:00 2001 +From: Sumit Garg +Date: Fri, 22 Jan 2021 16:35:56 +0530 +Subject: kdb: Make memory allocations more robust + +From: Sumit Garg + +commit 93f7a6d818deef69d0ba652d46bae6fbabbf365c upstream. + +Currently kdb uses in_interrupt() to determine whether its library +code has been called from the kgdb trap handler or from a saner calling +context such as driver init. This approach is broken because +in_interrupt() alone isn't able to determine kgdb trap handler entry from +normal task context. This can happen during normal use of basic features +such as breakpoints and can also be trivially reproduced using: +echo g > /proc/sysrq-trigger + +We can improve this by adding check for in_dbg_master() instead which +explicitly determines if we are running in debugger context. + +Cc: stable@vger.kernel.org +Signed-off-by: Sumit Garg +Link: https://lore.kernel.org/r/1611313556-4004-1-git-send-email-sumit.garg@linaro.org +Signed-off-by: Daniel Thompson +Signed-off-by: Greg Kroah-Hartman +--- + kernel/debug/kdb/kdb_private.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/kernel/debug/kdb/kdb_private.h ++++ b/kernel/debug/kdb/kdb_private.h +@@ -233,7 +233,7 @@ extern struct task_struct *kdb_curr_task + #define kdb_do_each_thread(g, p) do_each_thread(g, p) + #define kdb_while_each_thread(g, p) while_each_thread(g, p) + +-#define GFP_KDB (in_interrupt() ? GFP_ATOMIC : GFP_KERNEL) ++#define GFP_KDB (in_dbg_master() ? GFP_ATOMIC : GFP_KERNEL) + + extern void *debug_kmalloc(size_t size, gfp_t flags); + extern void debug_kfree(void *); diff --git a/queue-4.19/mips-vmlinux.lds.s-add-missing-page_aligned_data-section.patch b/queue-4.19/mips-vmlinux.lds.s-add-missing-page_aligned_data-section.patch new file mode 100644 index 00000000000..60961a2dfb8 --- /dev/null +++ b/queue-4.19/mips-vmlinux.lds.s-add-missing-page_aligned_data-section.patch @@ -0,0 +1,66 @@ +From 8ac7c87acdcac156670f9920c8acbd84308ff4b1 Mon Sep 17 00:00:00 2001 +From: Alexander Lobakin +Date: Sun, 10 Jan 2021 11:56:08 +0000 +Subject: MIPS: vmlinux.lds.S: add missing PAGE_ALIGNED_DATA() section + +From: Alexander Lobakin + +commit 8ac7c87acdcac156670f9920c8acbd84308ff4b1 upstream. + +MIPS uses its own declaration of rwdata, and thus it should be kept +in sync with the asm-generic one. Currently PAGE_ALIGNED_DATA() is +missing from the linker script, which emits the following ld +warnings: + +mips-alpine-linux-musl-ld: warning: orphan section +`.data..page_aligned' from `arch/mips/kernel/vdso.o' being placed +in section `.data..page_aligned' +mips-alpine-linux-musl-ld: warning: orphan section +`.data..page_aligned' from `arch/mips/vdso/vdso-image.o' being placed +in section `.data..page_aligned' + +Add the necessary declaration, so the mentioned structures will be +placed in vmlinux as intended: + +ffffffff80630580 D __end_once +ffffffff80630580 D __start___dyndbg +ffffffff80630580 D __start_once +ffffffff80630580 D __stop___dyndbg +ffffffff80634000 d mips_vdso_data +ffffffff80638000 d vdso_data +ffffffff80638580 D _gp +ffffffff8063c000 T __init_begin +ffffffff8063c000 D _edata +ffffffff8063c000 T _sinittext + +-> + +ffffffff805a4000 D __end_init_task +ffffffff805a4000 D __nosave_begin +ffffffff805a4000 D __nosave_end +ffffffff805a4000 d mips_vdso_data +ffffffff805a8000 d vdso_data +ffffffff805ac000 D mmlist_lock +ffffffff805ac080 D tasklist_lock + +Fixes: ebb5e78cc634 ("MIPS: Initial implementation of a VDSO") +Signed-off-by: Alexander Lobakin +Reviewed-by: Kees Cook +Reviewed-by: Nathan Chancellor +Cc: stable@vger.kernel.org # 4.4+ +Signed-off-by: Thomas Bogendoerfer +Signed-off-by: Greg Kroah-Hartman +--- + arch/mips/kernel/vmlinux.lds.S | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/mips/kernel/vmlinux.lds.S ++++ b/arch/mips/kernel/vmlinux.lds.S +@@ -93,6 +93,7 @@ SECTIONS + + INIT_TASK_DATA(THREAD_SIZE) + NOSAVE_DATA ++ PAGE_ALIGNED_DATA(PAGE_SIZE) + CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT) + READ_MOSTLY_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT) + DATA_DATA diff --git a/queue-4.19/pci-qcom-use-phy_refclk_use_pad-only-for-ipq8064.patch b/queue-4.19/pci-qcom-use-phy_refclk_use_pad-only-for-ipq8064.patch new file mode 100644 index 00000000000..b57e2e909c0 --- /dev/null +++ b/queue-4.19/pci-qcom-use-phy_refclk_use_pad-only-for-ipq8064.patch @@ -0,0 +1,40 @@ +From 2cfef1971aea6119ee27429181d6cb3383031ac2 Mon Sep 17 00:00:00 2001 +From: Ansuel Smith +Date: Mon, 19 Oct 2020 18:55:55 +0200 +Subject: PCI: qcom: Use PHY_REFCLK_USE_PAD only for ipq8064 + +From: Ansuel Smith + +commit 2cfef1971aea6119ee27429181d6cb3383031ac2 upstream. + +The use of PHY_REFCLK_USE_PAD introduced a regression for apq8064 devices. +It was tested that while apq doesn't require the padding, ipq SoC must use +it or the kernel hangs on boot. + +Link: https://lore.kernel.org/r/20201019165555.8269-1-ansuelsmth@gmail.com +Fixes: de3c4bf64897 ("PCI: qcom: Add support for tx term offset for rev 2.1.0") +Reported-by: Ilia Mirkin +Signed-off-by: Ilia Mirkin +Signed-off-by: Ansuel Smith +Signed-off-by: Lorenzo Pieralisi +Signed-off-by: Bjorn Helgaas +Acked-by: Stanimir Varbanov +Cc: stable@vger.kernel.org # v4.19+ +Signed-off-by: Greg Kroah-Hartman +--- + drivers/pci/controller/dwc/pcie-qcom.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/pci/controller/dwc/pcie-qcom.c ++++ b/drivers/pci/controller/dwc/pcie-qcom.c +@@ -371,7 +371,9 @@ static int qcom_pcie_init_2_1_0(struct q + + /* enable external reference clock */ + val = readl(pcie->parf + PCIE20_PARF_PHY_REFCLK); +- val &= ~PHY_REFCLK_USE_PAD; ++ /* USE_PAD is required only for ipq806x */ ++ if (!of_device_is_compatible(node, "qcom,pcie-apq8064")) ++ val &= ~PHY_REFCLK_USE_PAD; + val |= PHY_REFCLK_SSP_EN; + writel(val, pcie->parf + PCIE20_PARF_PHY_REFCLK); + diff --git a/queue-4.19/random-fix-the-rndreseedcrng-ioctl.patch b/queue-4.19/random-fix-the-rndreseedcrng-ioctl.patch new file mode 100644 index 00000000000..bb579c00260 --- /dev/null +++ b/queue-4.19/random-fix-the-rndreseedcrng-ioctl.patch @@ -0,0 +1,38 @@ +From 11a0b5e0ec8c13bef06f7414f9e914506140d5cb Mon Sep 17 00:00:00 2001 +From: Eric Biggers +Date: Tue, 12 Jan 2021 11:28:18 -0800 +Subject: random: fix the RNDRESEEDCRNG ioctl + +From: Eric Biggers + +commit 11a0b5e0ec8c13bef06f7414f9e914506140d5cb upstream. + +The RNDRESEEDCRNG ioctl reseeds the primary_crng from itself, which +doesn't make sense. Reseed it from the input_pool instead. + +Fixes: d848e5f8e1eb ("random: add new ioctl RNDRESEEDCRNG") +Cc: stable@vger.kernel.org +Cc: linux-crypto@vger.kernel.org +Cc: Andy Lutomirski +Cc: Jann Horn +Cc: Theodore Ts'o +Reviewed-by: Jann Horn +Acked-by: Ard Biesheuvel +Signed-off-by: Eric Biggers +Link: https://lore.kernel.org/r/20210112192818.69921-1-ebiggers@kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/char/random.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/char/random.c ++++ b/drivers/char/random.c +@@ -2071,7 +2071,7 @@ static long random_ioctl(struct file *f, + return -EPERM; + if (crng_init < 2) + return -ENODATA; +- crng_reseed(&primary_crng, NULL); ++ crng_reseed(&primary_crng, &input_pool); + crng_global_init_time = jiffies - 1; + return 0; + default: diff --git a/queue-4.19/series b/queue-4.19/series index 5e2133495ef..0394e707dd5 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -15,3 +15,9 @@ scripts-recordmcount.pl-support-big-endian-for-arch-.patch jump_label-lockdep-assert-we-hold-the-hotplug-lock-for-_cpuslocked-operations.patch locking-static_key-fix-false-positive-warnings-on-concurrent-dec-inc.patch vmlinux.lds.h-add-dwarf-v5-sections.patch +kdb-make-memory-allocations-more-robust.patch +pci-qcom-use-phy_refclk_use_pad-only-for-ipq8064.patch +bfq-avoid-false-bfq-queue-merging.patch +alsa-usb-audio-fix-pcm-buffer-allocation-in-non-vmalloc-mode.patch +mips-vmlinux.lds.s-add-missing-page_aligned_data-section.patch +random-fix-the-rndreseedcrng-ioctl.patch