From c44dbbbb7d737e60ec134f07d4076ccb81590ff1 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 7 Nov 2020 16:47:22 +0100 Subject: [PATCH] 4.14-stable patches added patches: alsa-usb-audio-add-implicit-feedback-quirk-for-qu-16.patch fonts-replace-discarded-const-qualifier.patch gfs2-wake-up-when-sd_glock_disposal-becomes-zero.patch kthread_worker-prevent-queuing-delayed-work-from-timer_fn-when-it-is-being-canceled.patch lib-crc32test-remove-extra-local_irq_disable-enable.patch mm-always-have-io_remap_pfn_range-set-pgprot_decrypted.patch --- ...dd-implicit-feedback-quirk-for-qu-16.patch | 32 ++++ ...ts-replace-discarded-const-qualifier.patch | 171 ++++++++++++++++++ ...-when-sd_glock_disposal-becomes-zero.patch | 38 ++++ ...m-timer_fn-when-it-is-being-canceled.patch | 48 +++++ ...emove-extra-local_irq_disable-enable.patch | 78 ++++++++ ...remap_pfn_range-set-pgprot_decrypted.patch | 86 +++++++++ queue-4.14/series | 6 + 7 files changed, 459 insertions(+) create mode 100644 queue-4.14/alsa-usb-audio-add-implicit-feedback-quirk-for-qu-16.patch create mode 100644 queue-4.14/fonts-replace-discarded-const-qualifier.patch create mode 100644 queue-4.14/gfs2-wake-up-when-sd_glock_disposal-becomes-zero.patch create mode 100644 queue-4.14/kthread_worker-prevent-queuing-delayed-work-from-timer_fn-when-it-is-being-canceled.patch create mode 100644 queue-4.14/lib-crc32test-remove-extra-local_irq_disable-enable.patch create mode 100644 queue-4.14/mm-always-have-io_remap_pfn_range-set-pgprot_decrypted.patch diff --git a/queue-4.14/alsa-usb-audio-add-implicit-feedback-quirk-for-qu-16.patch b/queue-4.14/alsa-usb-audio-add-implicit-feedback-quirk-for-qu-16.patch new file mode 100644 index 00000000000..8b6cc9ea648 --- /dev/null +++ b/queue-4.14/alsa-usb-audio-add-implicit-feedback-quirk-for-qu-16.patch @@ -0,0 +1,32 @@ +From 0938ecae432e7ac8b01080c35dd81d50a1e43033 Mon Sep 17 00:00:00 2001 +From: "Geoffrey D. Bennett" +Date: Wed, 4 Nov 2020 22:27:17 +1030 +Subject: ALSA: usb-audio: Add implicit feedback quirk for Qu-16 + +From: Geoffrey D. Bennett + +commit 0938ecae432e7ac8b01080c35dd81d50a1e43033 upstream. + +This patch fixes audio distortion on playback for the Allen&Heath +Qu-16. + +Signed-off-by: Geoffrey D. Bennett +Cc: +Link: https://lore.kernel.org/r/20201104115717.GA19046@b4.vu +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/pcm.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/usb/pcm.c ++++ b/sound/usb/pcm.c +@@ -332,6 +332,7 @@ static int set_sync_ep_implicit_fb_quirk + switch (subs->stream->chip->usb_id) { + case USB_ID(0x0763, 0x2030): /* M-Audio Fast Track C400 */ + case USB_ID(0x0763, 0x2031): /* M-Audio Fast Track C600 */ ++ case USB_ID(0x22f0, 0x0006): /* Allen&Heath Qu-16 */ + ep = 0x81; + iface = usb_ifnum_to_if(dev, 3); + diff --git a/queue-4.14/fonts-replace-discarded-const-qualifier.patch b/queue-4.14/fonts-replace-discarded-const-qualifier.patch new file mode 100644 index 00000000000..3182b993daf --- /dev/null +++ b/queue-4.14/fonts-replace-discarded-const-qualifier.patch @@ -0,0 +1,171 @@ +From 9522750c66c689b739e151fcdf895420dc81efc0 Mon Sep 17 00:00:00 2001 +From: Lee Jones +Date: Mon, 2 Nov 2020 13:32:42 -0500 +Subject: Fonts: Replace discarded const qualifier + +From: Lee Jones + +commit 9522750c66c689b739e151fcdf895420dc81efc0 upstream. + +Commit 6735b4632def ("Fonts: Support FONT_EXTRA_WORDS macros for built-in +fonts") introduced the following error when building rpc_defconfig (only +this build appears to be affected): + + `acorndata_8x8' referenced in section `.text' of arch/arm/boot/compressed/ll_char_wr.o: + defined in discarded section `.data' of arch/arm/boot/compressed/font.o + `acorndata_8x8' referenced in section `.data.rel.ro' of arch/arm/boot/compressed/font.o: + defined in discarded section `.data' of arch/arm/boot/compressed/font.o + make[3]: *** [/scratch/linux/arch/arm/boot/compressed/Makefile:191: arch/arm/boot/compressed/vmlinux] Error 1 + make[2]: *** [/scratch/linux/arch/arm/boot/Makefile:61: arch/arm/boot/compressed/vmlinux] Error 2 + make[1]: *** [/scratch/linux/arch/arm/Makefile:317: zImage] Error 2 + +The .data section is discarded at link time. Reinstating acorndata_8x8 as +const ensures it is still available after linking. Do the same for the +other 12 built-in fonts as well, for consistency purposes. + +Cc: +Cc: Russell King +Reviewed-by: Greg Kroah-Hartman +Fixes: 6735b4632def ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts") +Signed-off-by: Lee Jones +Co-developed-by: Peilin Ye +Signed-off-by: Peilin Ye +Signed-off-by: Daniel Vetter +Link: https://patchwork.freedesktop.org/patch/msgid/20201102183242.2031659-1-yepeilin.cs@gmail.com +Signed-off-by: Greg Kroah-Hartman + +--- + lib/fonts/font_10x18.c | 2 +- + lib/fonts/font_6x10.c | 2 +- + lib/fonts/font_6x11.c | 2 +- + lib/fonts/font_7x14.c | 2 +- + lib/fonts/font_8x16.c | 2 +- + lib/fonts/font_8x8.c | 2 +- + lib/fonts/font_acorn_8x8.c | 2 +- + lib/fonts/font_mini_4x6.c | 2 +- + lib/fonts/font_pearl_8x8.c | 2 +- + lib/fonts/font_sun12x22.c | 2 +- + lib/fonts/font_sun8x16.c | 2 +- + 11 files changed, 11 insertions(+), 11 deletions(-) + +--- a/lib/fonts/font_10x18.c ++++ b/lib/fonts/font_10x18.c +@@ -8,7 +8,7 @@ + + #define FONTDATAMAX 9216 + +-static struct font_data fontdata_10x18 = { ++static const struct font_data fontdata_10x18 = { + { 0, 0, FONTDATAMAX, 0 }, { + /* 0 0x00 '^@' */ + 0x00, 0x00, /* 0000000000 */ +--- a/lib/fonts/font_6x10.c ++++ b/lib/fonts/font_6x10.c +@@ -3,7 +3,7 @@ + + #define FONTDATAMAX 2560 + +-static struct font_data fontdata_6x10 = { ++static const struct font_data fontdata_6x10 = { + { 0, 0, FONTDATAMAX, 0 }, { + /* 0 0x00 '^@' */ + 0x00, /* 00000000 */ +--- a/lib/fonts/font_6x11.c ++++ b/lib/fonts/font_6x11.c +@@ -9,7 +9,7 @@ + + #define FONTDATAMAX (11*256) + +-static struct font_data fontdata_6x11 = { ++static const struct font_data fontdata_6x11 = { + { 0, 0, FONTDATAMAX, 0 }, { + /* 0 0x00 '^@' */ + 0x00, /* 00000000 */ +--- a/lib/fonts/font_7x14.c ++++ b/lib/fonts/font_7x14.c +@@ -8,7 +8,7 @@ + + #define FONTDATAMAX 3584 + +-static struct font_data fontdata_7x14 = { ++static const struct font_data fontdata_7x14 = { + { 0, 0, FONTDATAMAX, 0 }, { + /* 0 0x00 '^@' */ + 0x00, /* 0000000 */ +--- a/lib/fonts/font_8x16.c ++++ b/lib/fonts/font_8x16.c +@@ -10,7 +10,7 @@ + + #define FONTDATAMAX 4096 + +-static struct font_data fontdata_8x16 = { ++static const struct font_data fontdata_8x16 = { + { 0, 0, FONTDATAMAX, 0 }, { + /* 0 0x00 '^@' */ + 0x00, /* 00000000 */ +--- a/lib/fonts/font_8x8.c ++++ b/lib/fonts/font_8x8.c +@@ -9,7 +9,7 @@ + + #define FONTDATAMAX 2048 + +-static struct font_data fontdata_8x8 = { ++static const struct font_data fontdata_8x8 = { + { 0, 0, FONTDATAMAX, 0 }, { + /* 0 0x00 '^@' */ + 0x00, /* 00000000 */ +--- a/lib/fonts/font_acorn_8x8.c ++++ b/lib/fonts/font_acorn_8x8.c +@@ -5,7 +5,7 @@ + + #define FONTDATAMAX 2048 + +-static struct font_data acorndata_8x8 = { ++static const struct font_data acorndata_8x8 = { + { 0, 0, FONTDATAMAX, 0 }, { + /* 00 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ^@ */ + /* 01 */ 0x7e, 0x81, 0xa5, 0x81, 0xbd, 0x99, 0x81, 0x7e, /* ^A */ +--- a/lib/fonts/font_mini_4x6.c ++++ b/lib/fonts/font_mini_4x6.c +@@ -43,7 +43,7 @@ __END__; + + #define FONTDATAMAX 1536 + +-static struct font_data fontdata_mini_4x6 = { ++static const struct font_data fontdata_mini_4x6 = { + { 0, 0, FONTDATAMAX, 0 }, { + /*{*/ + /* Char 0: ' ' */ +--- a/lib/fonts/font_pearl_8x8.c ++++ b/lib/fonts/font_pearl_8x8.c +@@ -14,7 +14,7 @@ + + #define FONTDATAMAX 2048 + +-static struct font_data fontdata_pearl8x8 = { ++static const struct font_data fontdata_pearl8x8 = { + { 0, 0, FONTDATAMAX, 0 }, { + /* 0 0x00 '^@' */ + 0x00, /* 00000000 */ +--- a/lib/fonts/font_sun12x22.c ++++ b/lib/fonts/font_sun12x22.c +@@ -3,7 +3,7 @@ + + #define FONTDATAMAX 11264 + +-static struct font_data fontdata_sun12x22 = { ++static const struct font_data fontdata_sun12x22 = { + { 0, 0, FONTDATAMAX, 0 }, { + /* 0 0x00 '^@' */ + 0x00, 0x00, /* 000000000000 */ +--- a/lib/fonts/font_sun8x16.c ++++ b/lib/fonts/font_sun8x16.c +@@ -3,7 +3,7 @@ + + #define FONTDATAMAX 4096 + +-static struct font_data fontdata_sun8x16 = { ++static const struct font_data fontdata_sun8x16 = { + { 0, 0, FONTDATAMAX, 0 }, { + /* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + /* */ 0x00,0x00,0x7e,0x81,0xa5,0x81,0x81,0xbd,0x99,0x81,0x81,0x7e,0x00,0x00,0x00,0x00, diff --git a/queue-4.14/gfs2-wake-up-when-sd_glock_disposal-becomes-zero.patch b/queue-4.14/gfs2-wake-up-when-sd_glock_disposal-becomes-zero.patch new file mode 100644 index 00000000000..7b0b2136d9f --- /dev/null +++ b/queue-4.14/gfs2-wake-up-when-sd_glock_disposal-becomes-zero.patch @@ -0,0 +1,38 @@ +From da7d554f7c62d0c17c1ac3cc2586473c2d99f0bd Mon Sep 17 00:00:00 2001 +From: Alexander Aring +Date: Mon, 26 Oct 2020 10:52:29 -0400 +Subject: gfs2: Wake up when sd_glock_disposal becomes zero + +From: Alexander Aring + +commit da7d554f7c62d0c17c1ac3cc2586473c2d99f0bd upstream. + +Commit fc0e38dae645 ("GFS2: Fix glock deallocation race") fixed a +sd_glock_disposal accounting bug by adding a missing atomic_dec +statement, but it failed to wake up sd_glock_wait when that decrement +causes sd_glock_disposal to reach zero. As a consequence, +gfs2_gl_hash_clear can now run into a 10-minute timeout instead of +being woken up. Add the missing wakeup. + +Fixes: fc0e38dae645 ("GFS2: Fix glock deallocation race") +Cc: stable@vger.kernel.org # v2.6.39+ +Signed-off-by: Alexander Aring +Signed-off-by: Andreas Gruenbacher +Signed-off-by: Greg Kroah-Hartman + +--- + fs/gfs2/glock.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/fs/gfs2/glock.c ++++ b/fs/gfs2/glock.c +@@ -870,7 +870,8 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, + out_free: + kfree(gl->gl_lksb.sb_lvbptr); + kmem_cache_free(cachep, gl); +- atomic_dec(&sdp->sd_glock_disposal); ++ if (atomic_dec_and_test(&sdp->sd_glock_disposal)) ++ wake_up(&sdp->sd_glock_wait); + + out: + return ret; diff --git a/queue-4.14/kthread_worker-prevent-queuing-delayed-work-from-timer_fn-when-it-is-being-canceled.patch b/queue-4.14/kthread_worker-prevent-queuing-delayed-work-from-timer_fn-when-it-is-being-canceled.patch new file mode 100644 index 00000000000..1dfabc0f0f8 --- /dev/null +++ b/queue-4.14/kthread_worker-prevent-queuing-delayed-work-from-timer_fn-when-it-is-being-canceled.patch @@ -0,0 +1,48 @@ +From 6993d0fdbee0eb38bfac350aa016f65ad11ed3b1 Mon Sep 17 00:00:00 2001 +From: Zqiang +Date: Sun, 1 Nov 2020 17:07:53 -0800 +Subject: kthread_worker: prevent queuing delayed work from timer_fn when it is being canceled + +From: Zqiang + +commit 6993d0fdbee0eb38bfac350aa016f65ad11ed3b1 upstream. + +There is a small race window when a delayed work is being canceled and +the work still might be queued from the timer_fn: + + CPU0 CPU1 +kthread_cancel_delayed_work_sync() + __kthread_cancel_work_sync() + __kthread_cancel_work() + work->canceling++; + kthread_delayed_work_timer_fn() + kthread_insert_work(); + +BUG: kthread_insert_work() should not get called when work->canceling is +set. + +Signed-off-by: Zqiang +Signed-off-by: Andrew Morton +Reviewed-by: Petr Mladek +Acked-by: Tejun Heo +Cc: +Link: https://lkml.kernel.org/r/20201014083030.16895-1-qiang.zhang@windriver.com +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/kthread.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/kernel/kthread.c ++++ b/kernel/kthread.c +@@ -831,7 +831,8 @@ void kthread_delayed_work_timer_fn(unsig + /* Move the work from worker->delayed_work_list. */ + WARN_ON_ONCE(list_empty(&work->node)); + list_del_init(&work->node); +- kthread_insert_work(worker, work, &worker->work_list); ++ if (!work->canceling) ++ kthread_insert_work(worker, work, &worker->work_list); + + spin_unlock(&worker->lock); + } diff --git a/queue-4.14/lib-crc32test-remove-extra-local_irq_disable-enable.patch b/queue-4.14/lib-crc32test-remove-extra-local_irq_disable-enable.patch new file mode 100644 index 00000000000..aa2bb0e3017 --- /dev/null +++ b/queue-4.14/lib-crc32test-remove-extra-local_irq_disable-enable.patch @@ -0,0 +1,78 @@ +From aa4e460f0976351fddd2f5ac6e08b74320c277a1 Mon Sep 17 00:00:00 2001 +From: Vasily Gorbik +Date: Sun, 1 Nov 2020 17:07:47 -0800 +Subject: lib/crc32test: remove extra local_irq_disable/enable + +From: Vasily Gorbik + +commit aa4e460f0976351fddd2f5ac6e08b74320c277a1 upstream. + +Commit 4d004099a668 ("lockdep: Fix lockdep recursion") uncovered the +following issue in lib/crc32test reported on s390: + + BUG: using __this_cpu_read() in preemptible [00000000] code: swapper/0/1 + caller is lockdep_hardirqs_on_prepare+0x48/0x270 + CPU: 6 PID: 1 Comm: swapper/0 Not tainted 5.9.0-next-20201015-15164-g03d992bd2de6 #19 + Hardware name: IBM 3906 M04 704 (LPAR) + Call Trace: + lockdep_hardirqs_on_prepare+0x48/0x270 + trace_hardirqs_on+0x9c/0x1b8 + crc32_test.isra.0+0x170/0x1c0 + crc32test_init+0x1c/0x40 + do_one_initcall+0x40/0x130 + do_initcalls+0x126/0x150 + kernel_init_freeable+0x1f6/0x230 + kernel_init+0x22/0x150 + ret_from_fork+0x24/0x2c + no locks held by swapper/0/1. + +Remove extra local_irq_disable/local_irq_enable helpers calls. + +Fixes: 5fb7f87408f1 ("lib: add module support to crc32 tests") +Signed-off-by: Vasily Gorbik +Signed-off-by: Andrew Morton +Cc: Peter Zijlstra +Cc: Ingo Molnar +Cc: Greg Kroah-Hartman +Link: https://lkml.kernel.org/r/patch.git-4369da00c06e.your-ad-here.call-01602859837-ext-1679@work.hours +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + lib/crc32test.c | 4 ---- + 1 file changed, 4 deletions(-) + +--- a/lib/crc32test.c ++++ b/lib/crc32test.c +@@ -683,7 +683,6 @@ static int __init crc32c_test(void) + + /* reduce OS noise */ + local_irq_save(flags); +- local_irq_disable(); + + nsec = ktime_get_ns(); + for (i = 0; i < 100; i++) { +@@ -694,7 +693,6 @@ static int __init crc32c_test(void) + nsec = ktime_get_ns() - nsec; + + local_irq_restore(flags); +- local_irq_enable(); + + pr_info("crc32c: CRC_LE_BITS = %d\n", CRC_LE_BITS); + +@@ -768,7 +766,6 @@ static int __init crc32_test(void) + + /* reduce OS noise */ + local_irq_save(flags); +- local_irq_disable(); + + nsec = ktime_get_ns(); + for (i = 0; i < 100; i++) { +@@ -783,7 +780,6 @@ static int __init crc32_test(void) + nsec = ktime_get_ns() - nsec; + + local_irq_restore(flags); +- local_irq_enable(); + + pr_info("crc32: CRC_LE_BITS = %d, CRC_BE BITS = %d\n", + CRC_LE_BITS, CRC_BE_BITS); diff --git a/queue-4.14/mm-always-have-io_remap_pfn_range-set-pgprot_decrypted.patch b/queue-4.14/mm-always-have-io_remap_pfn_range-set-pgprot_decrypted.patch new file mode 100644 index 00000000000..88ebdbf9bc5 --- /dev/null +++ b/queue-4.14/mm-always-have-io_remap_pfn_range-set-pgprot_decrypted.patch @@ -0,0 +1,86 @@ +From f8f6ae5d077a9bdaf5cbf2ac960a5d1a04b47482 Mon Sep 17 00:00:00 2001 +From: Jason Gunthorpe +Date: Sun, 1 Nov 2020 17:08:00 -0800 +Subject: mm: always have io_remap_pfn_range() set pgprot_decrypted() + +From: Jason Gunthorpe + +commit f8f6ae5d077a9bdaf5cbf2ac960a5d1a04b47482 upstream. + +The purpose of io_remap_pfn_range() is to map IO memory, such as a +memory mapped IO exposed through a PCI BAR. IO devices do not +understand encryption, so this memory must always be decrypted. +Automatically call pgprot_decrypted() as part of the generic +implementation. + +This fixes a bug where enabling AMD SME causes subsystems, such as RDMA, +using io_remap_pfn_range() to expose BAR pages to user space to fail. +The CPU will encrypt access to those BAR pages instead of passing +unencrypted IO directly to the device. + +Places not mapping IO should use remap_pfn_range(). + +Fixes: aca20d546214 ("x86/mm: Add support to make use of Secure Memory Encryption") +Signed-off-by: Jason Gunthorpe +Signed-off-by: Andrew Morton +Cc: Arnd Bergmann +Cc: Tom Lendacky +Cc: Thomas Gleixner +Cc: Andrey Ryabinin +Cc: Borislav Petkov +Cc: Brijesh Singh +Cc: Jonathan Corbet +Cc: Dmitry Vyukov +Cc: "Dave Young" +Cc: Alexander Potapenko +Cc: Konrad Rzeszutek Wilk +Cc: Andy Lutomirski +Cc: Larry Woodman +Cc: Matt Fleming +Cc: Ingo Molnar +Cc: "Michael S. Tsirkin" +Cc: Paolo Bonzini +Cc: Peter Zijlstra +Cc: Rik van Riel +Cc: Toshimitsu Kani +Cc: +Link: https://lkml.kernel.org/r/0-v1-025d64bdf6c4+e-amd_sme_fix_jgg@nvidia.com +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + include/asm-generic/pgtable.h | 4 ---- + include/linux/mm.h | 9 +++++++++ + 2 files changed, 9 insertions(+), 4 deletions(-) + +--- a/include/asm-generic/pgtable.h ++++ b/include/asm-generic/pgtable.h +@@ -1069,10 +1069,6 @@ static inline bool arch_has_pfn_modify_c + + #endif /* !__ASSEMBLY__ */ + +-#ifndef io_remap_pfn_range +-#define io_remap_pfn_range remap_pfn_range +-#endif +- + #ifndef has_transparent_hugepage + #ifdef CONFIG_TRANSPARENT_HUGEPAGE + #define has_transparent_hugepage() 1 +--- a/include/linux/mm.h ++++ b/include/linux/mm.h +@@ -2422,6 +2422,15 @@ static inline int vm_fault_to_errno(int + return 0; + } + ++#ifndef io_remap_pfn_range ++static inline int io_remap_pfn_range(struct vm_area_struct *vma, ++ unsigned long addr, unsigned long pfn, ++ unsigned long size, pgprot_t prot) ++{ ++ return remap_pfn_range(vma, addr, pfn, size, pgprot_decrypted(prot)); ++} ++#endif ++ + typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, + void *data); + extern int apply_to_page_range(struct mm_struct *mm, unsigned long address, diff --git a/queue-4.14/series b/queue-4.14/series index 0baa804c1fb..ec56db3011b 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -13,3 +13,9 @@ i40e-add-num_vectors-checker-in-iwarp-handler.patch i40e-wrong-truncation-from-u16-to-u8.patch i40e-fix-of-memory-leak-and-integer-truncation-in-i40e_virtchnl.c.patch i40e-memory-leak-in-i40e_config_iwarp_qvlist.patch +fonts-replace-discarded-const-qualifier.patch +alsa-usb-audio-add-implicit-feedback-quirk-for-qu-16.patch +lib-crc32test-remove-extra-local_irq_disable-enable.patch +kthread_worker-prevent-queuing-delayed-work-from-timer_fn-when-it-is-being-canceled.patch +mm-always-have-io_remap_pfn_range-set-pgprot_decrypted.patch +gfs2-wake-up-when-sd_glock_disposal-becomes-zero.patch -- 2.47.3