From: Greg Kroah-Hartman Date: Mon, 9 Nov 2020 10:18:29 +0000 (+0100) Subject: 5.9-stable patches X-Git-Tag: v4.4.242~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c7a8c5e06c4e554a91eeb2df5202e56a9e2acd83;p=thirdparty%2Fkernel%2Fstable-queue.git 5.9-stable patches added patches: entry-fix-the-incorrect-ordering-of-lockdep-and-rcu-check.patch fork-fix-copy_process-clone_parent-race-with-the-exiting-real_parent.patch powerpc-40x-always-fault-when-_page_accessed-is-not-set.patch powerpc-8xx-always-fault-when-_page_accessed-is-not-set.patch s390-mm-make-pmd-pud_deref-large-page-aware.patch s390-pci-fix-hot-plug-of-pci-function-missing-bus.patch s390-pkey-fix-paes-selftest-failure-with-paes-and-pkey-static-build.patch serial-8250_mtk-fix-uart_get_baud_rate-warning.patch serial-txx9-add-missing-platform_driver_unregister-on-error-in-serial_txx9_init.patch usb-serial-cyberjack-fix-write-urb-completion-race.patch usb-serial-option-add-le910cx-compositions-0x1203-0x1230-0x1231.patch usb-serial-option-add-quectel-ec200t-module-support.patch usb-serial-option-add-telit-fn980-composition-0x1055.patch --- diff --git a/queue-5.9/entry-fix-the-incorrect-ordering-of-lockdep-and-rcu-check.patch b/queue-5.9/entry-fix-the-incorrect-ordering-of-lockdep-and-rcu-check.patch new file mode 100644 index 00000000000..18d21d8c246 --- /dev/null +++ b/queue-5.9/entry-fix-the-incorrect-ordering-of-lockdep-and-rcu-check.patch @@ -0,0 +1,51 @@ +From 9d820f68b2bdba5b2e7bf135123c3f57c5051d05 Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner +Date: Wed, 4 Nov 2020 14:06:23 +0100 +Subject: entry: Fix the incorrect ordering of lockdep and RCU check + +From: Thomas Gleixner + +commit 9d820f68b2bdba5b2e7bf135123c3f57c5051d05 upstream. + +When an exception/interrupt hits kernel space and the kernel is not +currently in the idle task then RCU must be watching. + +irqentry_enter() validates this via rcu_irq_enter_check_tick(), which in +turn invokes lockdep when taking a lock. But at that point lockdep does not +yet know about the fact that interrupts have been disabled by the CPU, +which triggers a lockdep splat complaining about inconsistent state. + +Invoking trace_hardirqs_off() before rcu_irq_enter_check_tick() defeats the +point of rcu_irq_enter_check_tick() because trace_hardirqs_off() uses RCU. + +So use the same sequence as for the idle case and tell lockdep about the +irq state change first, invoke the RCU check and then do the lockdep and +tracer update. + +Fixes: a5497bab5f72 ("entry: Provide generic interrupt entry/exit code") +Reported-by: Mark Rutland +Signed-off-by: Thomas Gleixner +Tested-by: Mark Rutland +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/87y2jhl19s.fsf@nanos.tec.linutronix.de +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/entry/common.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/kernel/entry/common.c ++++ b/kernel/entry/common.c +@@ -338,10 +338,10 @@ noinstr irqentry_state_t irqentry_enter( + * already contains a warning when RCU is not watching, so no point + * in having another one here. + */ ++ lockdep_hardirqs_off(CALLER_ADDR0); + instrumentation_begin(); + rcu_irq_enter_check_tick(); +- /* Use the combo lockdep/tracing function */ +- trace_hardirqs_off(); ++ trace_hardirqs_off_finish(); + instrumentation_end(); + + return ret; diff --git a/queue-5.9/fork-fix-copy_process-clone_parent-race-with-the-exiting-real_parent.patch b/queue-5.9/fork-fix-copy_process-clone_parent-race-with-the-exiting-real_parent.patch new file mode 100644 index 00000000000..4631e0c4962 --- /dev/null +++ b/queue-5.9/fork-fix-copy_process-clone_parent-race-with-the-exiting-real_parent.patch @@ -0,0 +1,55 @@ +From b4e00444cab4c3f3fec876dc0cccc8cbb0d1a948 Mon Sep 17 00:00:00 2001 +From: Eddy Wu +Date: Sat, 7 Nov 2020 14:47:22 +0800 +Subject: fork: fix copy_process(CLONE_PARENT) race with the exiting ->real_parent + +From: Eddy Wu + +commit b4e00444cab4c3f3fec876dc0cccc8cbb0d1a948 upstream. + +current->group_leader->exit_signal may change during copy_process() if +current->real_parent exits. + +Move the assignment inside tasklist_lock to avoid the race. + +Signed-off-by: Eddy Wu +Acked-by: Oleg Nesterov +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/fork.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/kernel/fork.c ++++ b/kernel/fork.c +@@ -2167,14 +2167,9 @@ static __latent_entropy struct task_stru + /* ok, now we should be set up.. */ + p->pid = pid_nr(pid); + if (clone_flags & CLONE_THREAD) { +- p->exit_signal = -1; + p->group_leader = current->group_leader; + p->tgid = current->tgid; + } else { +- if (clone_flags & CLONE_PARENT) +- p->exit_signal = current->group_leader->exit_signal; +- else +- p->exit_signal = args->exit_signal; + p->group_leader = p; + p->tgid = p->pid; + } +@@ -2218,9 +2213,14 @@ static __latent_entropy struct task_stru + if (clone_flags & (CLONE_PARENT|CLONE_THREAD)) { + p->real_parent = current->real_parent; + p->parent_exec_id = current->parent_exec_id; ++ if (clone_flags & CLONE_THREAD) ++ p->exit_signal = -1; ++ else ++ p->exit_signal = current->group_leader->exit_signal; + } else { + p->real_parent = current; + p->parent_exec_id = current->self_exec_id; ++ p->exit_signal = args->exit_signal; + } + + klp_copy_process(p); diff --git a/queue-5.9/powerpc-40x-always-fault-when-_page_accessed-is-not-set.patch b/queue-5.9/powerpc-40x-always-fault-when-_page_accessed-is-not-set.patch new file mode 100644 index 00000000000..6381e48b919 --- /dev/null +++ b/queue-5.9/powerpc-40x-always-fault-when-_page_accessed-is-not-set.patch @@ -0,0 +1,51 @@ +From 0540b0d2ce9073fd2a736d636218faa61c99e572 Mon Sep 17 00:00:00 2001 +From: Christophe Leroy +Date: Sat, 10 Oct 2020 15:14:29 +0000 +Subject: powerpc/40x: Always fault when _PAGE_ACCESSED is not set + +From: Christophe Leroy + +commit 0540b0d2ce9073fd2a736d636218faa61c99e572 upstream. + +The kernel expects pte_young() to work regardless of CONFIG_SWAP. + +Make sure a minor fault is taken to set _PAGE_ACCESSED when it +is not already set, regardless of the selection of CONFIG_SWAP. + +Fixes: 2c74e2586bb9 ("powerpc/40x: Rework 40x PTE access and TLB miss") +Cc: stable@vger.kernel.org +Signed-off-by: Christophe Leroy +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/b02ca2ed2d3676a096219b48c0f69ec982a75bcf.1602342801.git.christophe.leroy@csgroup.eu +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/kernel/head_40x.S | 8 -------- + 1 file changed, 8 deletions(-) + +--- a/arch/powerpc/kernel/head_40x.S ++++ b/arch/powerpc/kernel/head_40x.S +@@ -285,11 +285,7 @@ _ENTRY(saved_ksp_limit) + + rlwimi r11, r10, 22, 20, 29 /* Compute PTE address */ + lwz r11, 0(r11) /* Get Linux PTE */ +-#ifdef CONFIG_SWAP + li r9, _PAGE_PRESENT | _PAGE_ACCESSED +-#else +- li r9, _PAGE_PRESENT +-#endif + andc. r9, r9, r11 /* Check permission */ + bne 5f + +@@ -370,11 +366,7 @@ _ENTRY(saved_ksp_limit) + + rlwimi r11, r10, 22, 20, 29 /* Compute PTE address */ + lwz r11, 0(r11) /* Get Linux PTE */ +-#ifdef CONFIG_SWAP + li r9, _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC +-#else +- li r9, _PAGE_PRESENT | _PAGE_EXEC +-#endif + andc. r9, r9, r11 /* Check permission */ + bne 5f + diff --git a/queue-5.9/powerpc-8xx-always-fault-when-_page_accessed-is-not-set.patch b/queue-5.9/powerpc-8xx-always-fault-when-_page_accessed-is-not-set.patch new file mode 100644 index 00000000000..8cad8b86c37 --- /dev/null +++ b/queue-5.9/powerpc-8xx-always-fault-when-_page_accessed-is-not-set.patch @@ -0,0 +1,93 @@ +From 29daf869cbab69088fe1755d9dd224e99ba78b56 Mon Sep 17 00:00:00 2001 +From: Christophe Leroy +Date: Mon, 12 Oct 2020 08:54:31 +0000 +Subject: powerpc/8xx: Always fault when _PAGE_ACCESSED is not set + +From: Christophe Leroy + +commit 29daf869cbab69088fe1755d9dd224e99ba78b56 upstream. + +The kernel expects pte_young() to work regardless of CONFIG_SWAP. + +Make sure a minor fault is taken to set _PAGE_ACCESSED when it +is not already set, regardless of the selection of CONFIG_SWAP. + +This adds at least 3 instructions to the TLB miss exception +handlers fast path. Following patch will reduce this overhead. + +Also update the rotation instruction to the correct number of bits +to reflect all changes done to _PAGE_ACCESSED over time. + +Fixes: d069cb4373fe ("powerpc/8xx: Don't touch ACCESSED when no SWAP.") +Fixes: 5f356497c384 ("powerpc/8xx: remove unused _PAGE_WRITETHRU") +Fixes: e0a8e0d90a9f ("powerpc/8xx: Handle PAGE_USER via APG bits") +Fixes: 5b2753fc3e8a ("powerpc/8xx: Implementation of PAGE_EXEC") +Fixes: a891c43b97d3 ("powerpc/8xx: Prepare handlers for _PAGE_HUGE for 512k pages.") +Cc: stable@vger.kernel.org +Signed-off-by: Christophe Leroy +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/af834e8a0f1fa97bfae65664950f0984a70c4750.1602492856.git.christophe.leroy@csgroup.eu +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/kernel/head_8xx.S | 14 ++------------ + 1 file changed, 2 insertions(+), 12 deletions(-) + +--- a/arch/powerpc/kernel/head_8xx.S ++++ b/arch/powerpc/kernel/head_8xx.S +@@ -202,9 +202,7 @@ SystemCall: + + InstructionTLBMiss: + mtspr SPRN_SPRG_SCRATCH0, r10 +-#if defined(ITLB_MISS_KERNEL) || defined(CONFIG_SWAP) || defined(CONFIG_HUGETLBFS) + mtspr SPRN_SPRG_SCRATCH1, r11 +-#endif + + /* If we are faulting a kernel address, we have to use the + * kernel page tables. +@@ -238,11 +236,9 @@ InstructionTLBMiss: + rlwimi r11, r10, 32 - 9, _PMD_PAGE_512K + mtspr SPRN_MI_TWC, r11 + #endif +-#ifdef CONFIG_SWAP +- rlwinm r11, r10, 32-5, _PAGE_PRESENT ++ rlwinm r11, r10, 32-7, _PAGE_PRESENT + and r11, r11, r10 + rlwimi r10, r11, 0, _PAGE_PRESENT +-#endif + /* The Linux PTE won't go exactly into the MMU TLB. + * Software indicator bits 20 and 23 must be clear. + * Software indicator bits 22, 24, 25, 26, and 27 must be +@@ -256,9 +252,7 @@ InstructionTLBMiss: + + /* Restore registers */ + 0: mfspr r10, SPRN_SPRG_SCRATCH0 +-#if defined(ITLB_MISS_KERNEL) || defined(CONFIG_SWAP) || defined(CONFIG_HUGETLBFS) + mfspr r11, SPRN_SPRG_SCRATCH1 +-#endif + rfi + patch_site 0b, patch__itlbmiss_exit_1 + +@@ -268,9 +262,7 @@ InstructionTLBMiss: + addi r10, r10, 1 + stw r10, (itlb_miss_counter - PAGE_OFFSET)@l(0) + mfspr r10, SPRN_SPRG_SCRATCH0 +-#if defined(ITLB_MISS_KERNEL) || defined(CONFIG_SWAP) + mfspr r11, SPRN_SPRG_SCRATCH1 +-#endif + rfi + #endif + +@@ -316,11 +308,9 @@ DataStoreTLBMiss: + * r11 = ((r10 & PRESENT) & ((r10 & ACCESSED) >> 5)); + * r10 = (r10 & ~PRESENT) | r11; + */ +-#ifdef CONFIG_SWAP +- rlwinm r11, r10, 32-5, _PAGE_PRESENT ++ rlwinm r11, r10, 32-7, _PAGE_PRESENT + and r11, r11, r10 + rlwimi r10, r11, 0, _PAGE_PRESENT +-#endif + /* The Linux PTE won't go exactly into the MMU TLB. + * Software indicator bits 24, 25, 26, and 27 must be + * set. All other Linux PTE bits control the behavior diff --git a/queue-5.9/s390-mm-make-pmd-pud_deref-large-page-aware.patch b/queue-5.9/s390-mm-make-pmd-pud_deref-large-page-aware.patch new file mode 100644 index 00000000000..5311224ca1c --- /dev/null +++ b/queue-5.9/s390-mm-make-pmd-pud_deref-large-page-aware.patch @@ -0,0 +1,115 @@ +From b0e98aa9c411585eb586b2fa98873c936735008e Mon Sep 17 00:00:00 2001 +From: Gerald Schaefer +Date: Tue, 20 Oct 2020 20:20:07 +0200 +Subject: s390/mm: make pmd/pud_deref() large page aware + +From: Gerald Schaefer + +commit b0e98aa9c411585eb586b2fa98873c936735008e upstream. + +pmd/pud_deref() assume that they will never operate on large pmd/pud +entries, and therefore only use the non-large _xxx_ENTRY_ORIGIN mask. +With commit 9ec8fa8dc331b ("s390/vmemmap: extend modify_pagetable() +to handle vmemmap"), that assumption is no longer true, at least for +pmd_deref(). + +In theory, we could end up with wrong addresses because some of the +non-address bits of a large entry would not be masked out. +In practice, this does not (yet) show any impact, because vmemmap_free() +is currently never used for s390. + +Fix pmd/pud_deref() to check for the entry type and use the +_xxx_ENTRY_ORIGIN_LARGE mask for large entries. + +While at it, also move pmd/pud_pfn() around, in order to avoid code +duplication, because they do the same thing. + +Fixes: 9ec8fa8dc331b ("s390/vmemmap: extend modify_pagetable() to handle vmemmap") +Cc: # 5.9 +Signed-off-by: Gerald Schaefer +Reviewed-by: Alexander Gordeev +Signed-off-by: Heiko Carstens +Signed-off-by: Greg Kroah-Hartman + +--- + arch/s390/include/asm/pgtable.h | 52 +++++++++++++++++++++++----------------- + 1 file changed, 30 insertions(+), 22 deletions(-) + +--- a/arch/s390/include/asm/pgtable.h ++++ b/arch/s390/include/asm/pgtable.h +@@ -691,16 +691,6 @@ static inline int pud_large(pud_t pud) + return !!(pud_val(pud) & _REGION3_ENTRY_LARGE); + } + +-static inline unsigned long pud_pfn(pud_t pud) +-{ +- unsigned long origin_mask; +- +- origin_mask = _REGION_ENTRY_ORIGIN; +- if (pud_large(pud)) +- origin_mask = _REGION3_ENTRY_ORIGIN_LARGE; +- return (pud_val(pud) & origin_mask) >> PAGE_SHIFT; +-} +- + #define pmd_leaf pmd_large + static inline int pmd_large(pmd_t pmd) + { +@@ -746,16 +736,6 @@ static inline int pmd_none(pmd_t pmd) + return pmd_val(pmd) == _SEGMENT_ENTRY_EMPTY; + } + +-static inline unsigned long pmd_pfn(pmd_t pmd) +-{ +- unsigned long origin_mask; +- +- origin_mask = _SEGMENT_ENTRY_ORIGIN; +- if (pmd_large(pmd)) +- origin_mask = _SEGMENT_ENTRY_ORIGIN_LARGE; +- return (pmd_val(pmd) & origin_mask) >> PAGE_SHIFT; +-} +- + #define pmd_write pmd_write + static inline int pmd_write(pmd_t pmd) + { +@@ -1230,11 +1210,39 @@ static inline pte_t mk_pte(struct page * + #define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) + #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) + +-#define pmd_deref(pmd) (pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN) +-#define pud_deref(pud) (pud_val(pud) & _REGION_ENTRY_ORIGIN) + #define p4d_deref(pud) (p4d_val(pud) & _REGION_ENTRY_ORIGIN) + #define pgd_deref(pgd) (pgd_val(pgd) & _REGION_ENTRY_ORIGIN) + ++static inline unsigned long pmd_deref(pmd_t pmd) ++{ ++ unsigned long origin_mask; ++ ++ origin_mask = _SEGMENT_ENTRY_ORIGIN; ++ if (pmd_large(pmd)) ++ origin_mask = _SEGMENT_ENTRY_ORIGIN_LARGE; ++ return pmd_val(pmd) & origin_mask; ++} ++ ++static inline unsigned long pmd_pfn(pmd_t pmd) ++{ ++ return pmd_deref(pmd) >> PAGE_SHIFT; ++} ++ ++static inline unsigned long pud_deref(pud_t pud) ++{ ++ unsigned long origin_mask; ++ ++ origin_mask = _REGION_ENTRY_ORIGIN; ++ if (pud_large(pud)) ++ origin_mask = _REGION3_ENTRY_ORIGIN_LARGE; ++ return pud_val(pud) & origin_mask; ++} ++ ++static inline unsigned long pud_pfn(pud_t pud) ++{ ++ return pud_deref(pud) >> PAGE_SHIFT; ++} ++ + /* + * The pgd_offset function *always* adds the index for the top-level + * region/segment table. This is done to get a sequence like the diff --git a/queue-5.9/s390-pci-fix-hot-plug-of-pci-function-missing-bus.patch b/queue-5.9/s390-pci-fix-hot-plug-of-pci-function-missing-bus.patch new file mode 100644 index 00000000000..553f8e2e565 --- /dev/null +++ b/queue-5.9/s390-pci-fix-hot-plug-of-pci-function-missing-bus.patch @@ -0,0 +1,46 @@ +From 0b2ca2c7d0c9e2731d01b6c862375d44a7e13923 Mon Sep 17 00:00:00 2001 +From: Niklas Schnelle +Date: Mon, 2 Nov 2020 11:33:04 +0100 +Subject: s390/pci: fix hot-plug of PCI function missing bus + +From: Niklas Schnelle + +commit 0b2ca2c7d0c9e2731d01b6c862375d44a7e13923 upstream. + +Under some circumstances in particular with "Reconfigure I/O Path" +a zPCI function may first appear in Standby through a PCI event with +PEC 0x0302 which initially makes it visible to the zPCI subsystem, +Only after that is it configured with a zPCI event with PEC 0x0301. +If the zbus is still missing a PCI function zero (devfn == 0) when the +PCI event 0x0301 is handled zdev->zbus->bus is still NULL and gets +dereferenced in common code. +Check for this case and enable but don't scan the zPCI function. +This matches what would happen if we immediately got the 0x0301 +configuration request or the function was included in CLP List PCI. +In all cases the PCI functions with devfn != 0 will be scanned once +function 0 appears. + +Fixes: 3047766bc6ec ("s390/pci: fix enabling a reserved PCI function") +Cc: # 5.8 +Signed-off-by: Niklas Schnelle +Acked-by: Pierre Morel +Signed-off-by: Heiko Carstens +Signed-off-by: Greg Kroah-Hartman + +--- + arch/s390/pci/pci_event.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/arch/s390/pci/pci_event.c ++++ b/arch/s390/pci/pci_event.c +@@ -101,6 +101,10 @@ static void __zpci_event_availability(st + if (ret) + break; + ++ /* the PCI function will be scanned once function 0 appears */ ++ if (!zdev->zbus->bus) ++ break; ++ + pdev = pci_scan_single_device(zdev->zbus->bus, zdev->devfn); + if (!pdev) + break; diff --git a/queue-5.9/s390-pkey-fix-paes-selftest-failure-with-paes-and-pkey-static-build.patch b/queue-5.9/s390-pkey-fix-paes-selftest-failure-with-paes-and-pkey-static-build.patch new file mode 100644 index 00000000000..7140e9d8952 --- /dev/null +++ b/queue-5.9/s390-pkey-fix-paes-selftest-failure-with-paes-and-pkey-static-build.patch @@ -0,0 +1,104 @@ +From 5b35047eb467c8cdd38a31beb9ac109221777843 Mon Sep 17 00:00:00 2001 +From: Harald Freudenberger +Date: Tue, 15 Sep 2020 11:00:17 +0200 +Subject: s390/pkey: fix paes selftest failure with paes and pkey static build + +From: Harald Freudenberger + +commit 5b35047eb467c8cdd38a31beb9ac109221777843 upstream. + +When both the paes and the pkey kernel module are statically build +into the kernel, the paes cipher selftests run before the pkey +kernel module is initialized. So a static variable set in the pkey +init function and used in the pkey_clr2protkey function is not +initialized when the paes cipher's selftests request to call pckmo for +transforming a clear key value into a protected key. + +This patch moves the initial setup of the static variable into +the function pck_clr2protkey. So it's possible, to use the function +for transforming a clear to a protected key even before the pkey +init function has been called and the paes selftests may run +successful. + +Reported-by: Alexander Egorenkov +Cc: # 4.20 +Fixes: f822ad2c2c03 ("s390/pkey: move pckmo subfunction available checks away from module init") +Signed-off-by: Harald Freudenberger +Signed-off-by: Heiko Carstens +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/s390/crypto/pkey_api.c | 30 ++++++++++++++++-------------- + 1 file changed, 16 insertions(+), 14 deletions(-) + +--- a/drivers/s390/crypto/pkey_api.c ++++ b/drivers/s390/crypto/pkey_api.c +@@ -34,9 +34,6 @@ MODULE_DESCRIPTION("s390 protected key i + #define KEYBLOBBUFSIZE 8192 /* key buffer size used for internal processing */ + #define MAXAPQNSINLIST 64 /* max 64 apqns within a apqn list */ + +-/* mask of available pckmo subfunctions, fetched once at module init */ +-static cpacf_mask_t pckmo_functions; +- + /* + * debug feature data and functions + */ +@@ -90,6 +87,9 @@ static int pkey_clr2protkey(u32 keytype, + const struct pkey_clrkey *clrkey, + struct pkey_protkey *protkey) + { ++ /* mask of available pckmo subfunctions */ ++ static cpacf_mask_t pckmo_functions; ++ + long fc; + int keysize; + u8 paramblock[64]; +@@ -113,11 +113,13 @@ static int pkey_clr2protkey(u32 keytype, + return -EINVAL; + } + +- /* +- * Check if the needed pckmo subfunction is available. +- * These subfunctions can be enabled/disabled by customers +- * in the LPAR profile or may even change on the fly. +- */ ++ /* Did we already check for PCKMO ? */ ++ if (!pckmo_functions.bytes[0]) { ++ /* no, so check now */ ++ if (!cpacf_query(CPACF_PCKMO, &pckmo_functions)) ++ return -ENODEV; ++ } ++ /* check for the pckmo subfunction we need now */ + if (!cpacf_test_func(&pckmo_functions, fc)) { + DEBUG_ERR("%s pckmo functions not available\n", __func__); + return -ENODEV; +@@ -1838,7 +1840,7 @@ static struct miscdevice pkey_dev = { + */ + static int __init pkey_init(void) + { +- cpacf_mask_t kmc_functions; ++ cpacf_mask_t func_mask; + + /* + * The pckmo instruction should be available - even if we don't +@@ -1846,15 +1848,15 @@ static int __init pkey_init(void) + * is also the minimum level for the kmc instructions which + * are able to work with protected keys. + */ +- if (!cpacf_query(CPACF_PCKMO, &pckmo_functions)) ++ if (!cpacf_query(CPACF_PCKMO, &func_mask)) + return -ENODEV; + + /* check for kmc instructions available */ +- if (!cpacf_query(CPACF_KMC, &kmc_functions)) ++ if (!cpacf_query(CPACF_KMC, &func_mask)) + return -ENODEV; +- if (!cpacf_test_func(&kmc_functions, CPACF_KMC_PAES_128) || +- !cpacf_test_func(&kmc_functions, CPACF_KMC_PAES_192) || +- !cpacf_test_func(&kmc_functions, CPACF_KMC_PAES_256)) ++ if (!cpacf_test_func(&func_mask, CPACF_KMC_PAES_128) || ++ !cpacf_test_func(&func_mask, CPACF_KMC_PAES_192) || ++ !cpacf_test_func(&func_mask, CPACF_KMC_PAES_256)) + return -ENODEV; + + pkey_debug_init(); diff --git a/queue-5.9/serial-8250_mtk-fix-uart_get_baud_rate-warning.patch b/queue-5.9/serial-8250_mtk-fix-uart_get_baud_rate-warning.patch new file mode 100644 index 00000000000..09de120f68a --- /dev/null +++ b/queue-5.9/serial-8250_mtk-fix-uart_get_baud_rate-warning.patch @@ -0,0 +1,38 @@ +From 912ab37c798770f21b182d656937072b58553378 Mon Sep 17 00:00:00 2001 +From: Claire Chang +Date: Mon, 2 Nov 2020 20:07:49 +0800 +Subject: serial: 8250_mtk: Fix uart_get_baud_rate warning + +From: Claire Chang + +commit 912ab37c798770f21b182d656937072b58553378 upstream. + +Mediatek 8250 port supports speed higher than uartclk / 16. If the baud +rates in both the new and the old termios setting are higher than +uartclk / 16, the WARN_ON in uart_get_baud_rate() will be triggered. +Passing NULL as the old termios so uart_get_baud_rate() will use +uartclk / 16 - 1 as the new baud rate which will be replaced by the +original baud rate later by tty_termios_encode_baud_rate() in +mtk8250_set_termios(). + +Fixes: 551e553f0d4a ("serial: 8250_mtk: Fix high-speed baud rates clamping") +Signed-off-by: Claire Chang +Link: https://lore.kernel.org/r/20201102120749.374458-1-tientzu@chromium.org +Cc: stable +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/8250/8250_mtk.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/tty/serial/8250/8250_mtk.c ++++ b/drivers/tty/serial/8250/8250_mtk.c +@@ -317,7 +317,7 @@ mtk8250_set_termios(struct uart_port *po + */ + baud = tty_termios_baud_rate(termios); + +- serial8250_do_set_termios(port, termios, old); ++ serial8250_do_set_termios(port, termios, NULL); + + tty_termios_encode_baud_rate(termios, baud, baud); + diff --git a/queue-5.9/serial-txx9-add-missing-platform_driver_unregister-on-error-in-serial_txx9_init.patch b/queue-5.9/serial-txx9-add-missing-platform_driver_unregister-on-error-in-serial_txx9_init.patch new file mode 100644 index 00000000000..57eb1214b7d --- /dev/null +++ b/queue-5.9/serial-txx9-add-missing-platform_driver_unregister-on-error-in-serial_txx9_init.patch @@ -0,0 +1,36 @@ +From 0c5fc92622ed5531ff324b20f014e9e3092f0187 Mon Sep 17 00:00:00 2001 +From: Qinglang Miao +Date: Tue, 3 Nov 2020 16:49:42 +0800 +Subject: serial: txx9: add missing platform_driver_unregister() on error in serial_txx9_init + +From: Qinglang Miao + +commit 0c5fc92622ed5531ff324b20f014e9e3092f0187 upstream. + +Add the missing platform_driver_unregister() before return +from serial_txx9_init in the error handling case when failed +to register serial_txx9_pci_driver with macro ENABLE_SERIAL_TXX9_PCI +defined. + +Fixes: ab4382d27412 ("tty: move drivers/serial/ to drivers/tty/serial/") +Signed-off-by: Qinglang Miao +Link: https://lore.kernel.org/r/20201103084942.109076-1-miaoqinglang@huawei.com +Cc: stable +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/serial_txx9.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/tty/serial/serial_txx9.c ++++ b/drivers/tty/serial/serial_txx9.c +@@ -1280,6 +1280,9 @@ static int __init serial_txx9_init(void) + + #ifdef ENABLE_SERIAL_TXX9_PCI + ret = pci_register_driver(&serial_txx9_pci_driver); ++ if (ret) { ++ platform_driver_unregister(&serial_txx9_plat_driver); ++ } + #endif + if (ret == 0) + goto out; diff --git a/queue-5.9/series b/queue-5.9/series index c35c1e4ba51..6a85f6aa920 100644 --- a/queue-5.9/series +++ b/queue-5.9/series @@ -105,3 +105,16 @@ arm64-smp-move-rcu_cpu_starting-earlier.patch vt-disable-kd_font_op_copy.patch tty-serial-imx-enable-earlycon-by-default-if-imx_serial_console-is-enabled.patch tty-fix-crash-in-release_tty-if-tty-port-is-not-set.patch +fork-fix-copy_process-clone_parent-race-with-the-exiting-real_parent.patch +entry-fix-the-incorrect-ordering-of-lockdep-and-rcu-check.patch +s390-pci-fix-hot-plug-of-pci-function-missing-bus.patch +s390-mm-make-pmd-pud_deref-large-page-aware.patch +s390-pkey-fix-paes-selftest-failure-with-paes-and-pkey-static-build.patch +powerpc-8xx-always-fault-when-_page_accessed-is-not-set.patch +powerpc-40x-always-fault-when-_page_accessed-is-not-set.patch +serial-8250_mtk-fix-uart_get_baud_rate-warning.patch +serial-txx9-add-missing-platform_driver_unregister-on-error-in-serial_txx9_init.patch +usb-serial-cyberjack-fix-write-urb-completion-race.patch +usb-serial-option-add-quectel-ec200t-module-support.patch +usb-serial-option-add-le910cx-compositions-0x1203-0x1230-0x1231.patch +usb-serial-option-add-telit-fn980-composition-0x1055.patch diff --git a/queue-5.9/usb-serial-cyberjack-fix-write-urb-completion-race.patch b/queue-5.9/usb-serial-cyberjack-fix-write-urb-completion-race.patch new file mode 100644 index 00000000000..a061e347ce9 --- /dev/null +++ b/queue-5.9/usb-serial-cyberjack-fix-write-urb-completion-race.patch @@ -0,0 +1,57 @@ +From 985616f0457d9f555fff417d0da56174f70cc14f Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Mon, 26 Oct 2020 09:25:48 +0100 +Subject: USB: serial: cyberjack: fix write-URB completion race + +From: Johan Hovold + +commit 985616f0457d9f555fff417d0da56174f70cc14f upstream. + +The write-URB busy flag was being cleared before the completion handler +was done with the URB, something which could lead to corrupt transfers +due to a racing write request if the URB is resubmitted. + +Fixes: 507ca9bc0476 ("[PATCH] USB: add ability for usb-serial drivers to determine if their write urb is currently being used.") +Cc: stable # 2.6.13 +Reviewed-by: Greg Kroah-Hartman +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/cyberjack.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/drivers/usb/serial/cyberjack.c ++++ b/drivers/usb/serial/cyberjack.c +@@ -357,11 +357,12 @@ static void cyberjack_write_bulk_callbac + struct device *dev = &port->dev; + int status = urb->status; + unsigned long flags; ++ bool resubmitted = false; + +- set_bit(0, &port->write_urbs_free); + if (status) { + dev_dbg(dev, "%s - nonzero write bulk status received: %d\n", + __func__, status); ++ set_bit(0, &port->write_urbs_free); + return; + } + +@@ -394,6 +395,8 @@ static void cyberjack_write_bulk_callbac + goto exit; + } + ++ resubmitted = true; ++ + dev_dbg(dev, "%s - priv->wrsent=%d\n", __func__, priv->wrsent); + dev_dbg(dev, "%s - priv->wrfilled=%d\n", __func__, priv->wrfilled); + +@@ -410,6 +413,8 @@ static void cyberjack_write_bulk_callbac + + exit: + spin_unlock_irqrestore(&priv->lock, flags); ++ if (!resubmitted) ++ set_bit(0, &port->write_urbs_free); + usb_serial_port_softint(port); + } + diff --git a/queue-5.9/usb-serial-option-add-le910cx-compositions-0x1203-0x1230-0x1231.patch b/queue-5.9/usb-serial-option-add-le910cx-compositions-0x1203-0x1230-0x1231.patch new file mode 100644 index 00000000000..9cad0460b41 --- /dev/null +++ b/queue-5.9/usb-serial-option-add-le910cx-compositions-0x1203-0x1230-0x1231.patch @@ -0,0 +1,48 @@ +From 489979b4aab490b6b917c11dc02d81b4b742784a Mon Sep 17 00:00:00 2001 +From: Daniele Palmas +Date: Sat, 31 Oct 2020 23:54:58 +0100 +Subject: USB: serial: option: add LE910Cx compositions 0x1203, 0x1230, 0x1231 + +From: Daniele Palmas + +commit 489979b4aab490b6b917c11dc02d81b4b742784a upstream. + +Add following Telit LE910Cx compositions: + +0x1203: rndis, tty, adb, tty, tty, tty, tty +0x1230: tty, adb, rmnet, audio, tty, tty, tty, tty +0x1231: rndis, tty, adb, audio, tty, tty, tty, tty + +Signed-off-by: Daniele Palmas +Link: https://lore.kernel.org/r/20201031225458.10512-1-dnlplm@gmail.com +[ johan: add comments after entries ] +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/option.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -1203,6 +1203,8 @@ static const struct usb_device_id option + .driver_info = NCTRL(0) }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910), + .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1203, 0xff), /* Telit LE910Cx (RNDIS) */ ++ .driver_info = NCTRL(2) | RSVD(3) }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4), + .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) | RSVD(3) }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920), +@@ -1217,6 +1219,10 @@ static const struct usb_device_id option + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1213, 0xff) }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1214), + .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) | RSVD(3) }, ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1230, 0xff), /* Telit LE910Cx (rmnet) */ ++ .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1231, 0xff), /* Telit LE910Cx (RNDIS) */ ++ .driver_info = NCTRL(2) | RSVD(3) }, + { USB_DEVICE(TELIT_VENDOR_ID, 0x1260), + .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, + { USB_DEVICE(TELIT_VENDOR_ID, 0x1261), diff --git a/queue-5.9/usb-serial-option-add-quectel-ec200t-module-support.patch b/queue-5.9/usb-serial-option-add-quectel-ec200t-module-support.patch new file mode 100644 index 00000000000..d398d0a6184 --- /dev/null +++ b/queue-5.9/usb-serial-option-add-quectel-ec200t-module-support.patch @@ -0,0 +1,39 @@ +From a46b973bced1ba57420752bf38426acd9f6cbfa6 Mon Sep 17 00:00:00 2001 +From: Ziyi Cao +Date: Tue, 20 Oct 2020 00:08:06 +0800 +Subject: USB: serial: option: add Quectel EC200T module support + +From: Ziyi Cao + +commit a46b973bced1ba57420752bf38426acd9f6cbfa6 upstream. + +Add usb product id of the Quectel EC200T module. + +Signed-off-by: Ziyi Cao +Link: https://lore.kernel.org/r/17f8a2a3-ce0f-4be7-8544-8fdf286907d0@www.fastmail.com +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/option.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -250,6 +250,7 @@ static void option_instat_callback(struc + #define QUECTEL_PRODUCT_EP06 0x0306 + #define QUECTEL_PRODUCT_EM12 0x0512 + #define QUECTEL_PRODUCT_RM500Q 0x0800 ++#define QUECTEL_PRODUCT_EC200T 0x6026 + + #define CMOTECH_VENDOR_ID 0x16d8 + #define CMOTECH_PRODUCT_6001 0x6001 +@@ -1117,6 +1118,7 @@ static const struct usb_device_id option + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0) }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x10), + .driver_info = ZLP }, ++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) }, + + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) }, diff --git a/queue-5.9/usb-serial-option-add-telit-fn980-composition-0x1055.patch b/queue-5.9/usb-serial-option-add-telit-fn980-composition-0x1055.patch new file mode 100644 index 00000000000..c7d40874ec4 --- /dev/null +++ b/queue-5.9/usb-serial-option-add-telit-fn980-composition-0x1055.patch @@ -0,0 +1,34 @@ +From db0362eeb22992502764e825c79b922d7467e0eb Mon Sep 17 00:00:00 2001 +From: Daniele Palmas +Date: Tue, 3 Nov 2020 13:44:25 +0100 +Subject: USB: serial: option: add Telit FN980 composition 0x1055 + +From: Daniele Palmas + +commit db0362eeb22992502764e825c79b922d7467e0eb upstream. + +Add the following Telit FN980 composition: + +0x1055: tty, adb, tty, tty, tty, tty + +Signed-off-by: Daniele Palmas +Link: https://lore.kernel.org/r/20201103124425.12940-1-dnlplm@gmail.com +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/option.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -1191,6 +1191,8 @@ static const struct usb_device_id option + .driver_info = NCTRL(0) | RSVD(1) }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1054, 0xff), /* Telit FT980-KS */ + .driver_info = NCTRL(2) | RSVD(3) }, ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1055, 0xff), /* Telit FN980 (PCIe) */ ++ .driver_info = NCTRL(0) | RSVD(1) }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910), + .driver_info = NCTRL(0) | RSVD(1) | RSVD(3) }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),