From 4c73b1e02b8099d8ed7ba24cafe7e5241019f3b5 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 13 Dec 2020 18:22:40 -0500 Subject: [PATCH] Fixes for 4.19 Signed-off-by: Sasha Levin --- ...ing-don-t-assume-non-current-task-is.patch | 96 +++++++++++++++ ...ip-assign-a-fixed-index-to-mmc-devic.patch | 43 +++++++ ...ts-unconditionally-save-restore-the-.patch | 99 ++++++++++++++++ ...kernel-panic-in-case-of-assert-durin.patch | 42 +++++++ ...ifi-pcie-limit-memory-read-spin-time.patch | 94 +++++++++++++++ ...r-wmi-add-automatic-keyboard-backgro.patch | 38 ++++++ ...el-vbtn-support-for-tablet-mode-on-h.patch | 42 +++++++ ...nkpad_acpi-add-bat1-is-primary-batte.patch | 47 ++++++++ ...nkpad_acpi-do-not-report-sw_tablet_m.patch | 66 +++++++++++ ...c-drop-me200-addition-to-build-flags.patch | 51 ++++++++ ...re-clk-scaling-happens-only-when-hba.patch | 57 +++++++++ queue-4.19/series | 12 ++ ...t-the-cpumask-through-cpumask_of-cpu.patch | 110 ++++++++++++++++++ 13 files changed, 797 insertions(+) create mode 100644 queue-4.19/arc-stack-unwinding-don-t-assume-non-current-task-is.patch create mode 100644 queue-4.19/arm64-dts-rockchip-assign-a-fixed-index-to-mmc-devic.patch create mode 100644 queue-4.19/irqchip-gic-v3-its-unconditionally-save-restore-the-.patch create mode 100644 queue-4.19/iwlwifi-mvm-fix-kernel-panic-in-case-of-assert-durin.patch create mode 100644 queue-4.19/iwlwifi-pcie-limit-memory-read-spin-time.patch create mode 100644 queue-4.19/platform-x86-acer-wmi-add-automatic-keyboard-backgro.patch create mode 100644 queue-4.19/platform-x86-intel-vbtn-support-for-tablet-mode-on-h.patch create mode 100644 queue-4.19/platform-x86-thinkpad_acpi-add-bat1-is-primary-batte.patch create mode 100644 queue-4.19/platform-x86-thinkpad_acpi-do-not-report-sw_tablet_m.patch create mode 100644 queue-4.19/powerpc-drop-me200-addition-to-build-flags.patch create mode 100644 queue-4.19/scsi-ufs-make-sure-clk-scaling-happens-only-when-hba.patch create mode 100644 queue-4.19/soc-fsl-dpio-get-the-cpumask-through-cpumask_of-cpu.patch diff --git a/queue-4.19/arc-stack-unwinding-don-t-assume-non-current-task-is.patch b/queue-4.19/arc-stack-unwinding-don-t-assume-non-current-task-is.patch new file mode 100644 index 00000000000..d31e503f144 --- /dev/null +++ b/queue-4.19/arc-stack-unwinding-don-t-assume-non-current-task-is.patch @@ -0,0 +1,96 @@ +From 5a1dff9066374a7c9b9715544dd9ea25454443f4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 6 Nov 2020 16:59:27 -0800 +Subject: ARC: stack unwinding: don't assume non-current task is sleeping + +From: Vineet Gupta + +[ Upstream commit e42404fa10fd11fe72d0a0e149a321d10e577715 ] + +To start stack unwinding (SP, PC and BLINK) are needed. When the +explicit execution context (pt_regs etc) is not available, unwinder +assumes the task is sleeping (in __switch_to()) and fetches SP and BLINK +from kernel mode stack. + +But this assumption is not true, specially in a SMP system, when top +runs on 1 core, there may be active running processes on all cores. + +So when unwinding non courrent tasks, ensure they are NOT running. + +And while at it, handle the self unwinding case explicitly. + +This came out of investigation of a customer reported hang with +rcutorture+top + +Link: https://github.com/foss-for-synopsys-dwc-arc-processors/linux/issues/31 +Signed-off-by: Vineet Gupta +Signed-off-by: Sasha Levin +--- + arch/arc/kernel/stacktrace.c | 23 +++++++++++++++-------- + 1 file changed, 15 insertions(+), 8 deletions(-) + +diff --git a/arch/arc/kernel/stacktrace.c b/arch/arc/kernel/stacktrace.c +index 0fed32b959232..a211e87aa6d93 100644 +--- a/arch/arc/kernel/stacktrace.c ++++ b/arch/arc/kernel/stacktrace.c +@@ -41,15 +41,15 @@ + + #ifdef CONFIG_ARC_DW2_UNWIND + +-static void seed_unwind_frame_info(struct task_struct *tsk, +- struct pt_regs *regs, +- struct unwind_frame_info *frame_info) ++static int ++seed_unwind_frame_info(struct task_struct *tsk, struct pt_regs *regs, ++ struct unwind_frame_info *frame_info) + { + /* + * synchronous unwinding (e.g. dump_stack) + * - uses current values of SP and friends + */ +- if (tsk == NULL && regs == NULL) { ++ if (regs == NULL && (tsk == NULL || tsk == current)) { + unsigned long fp, sp, blink, ret; + frame_info->task = current; + +@@ -68,11 +68,15 @@ static void seed_unwind_frame_info(struct task_struct *tsk, + frame_info->call_frame = 0; + } else if (regs == NULL) { + /* +- * Asynchronous unwinding of sleeping task +- * - Gets SP etc from task's pt_regs (saved bottom of kernel +- * mode stack of task) ++ * Asynchronous unwinding of a likely sleeping task ++ * - first ensure it is actually sleeping ++ * - if so, it will be in __switch_to, kernel mode SP of task ++ * is safe-kept and BLINK at a well known location in there + */ + ++ if (tsk->state == TASK_RUNNING) ++ return -1; ++ + frame_info->task = tsk; + + frame_info->regs.r27 = TSK_K_FP(tsk); +@@ -106,6 +110,8 @@ static void seed_unwind_frame_info(struct task_struct *tsk, + frame_info->regs.r63 = regs->ret; + frame_info->call_frame = 0; + } ++ ++ return 0; + } + + #endif +@@ -119,7 +125,8 @@ arc_unwind_core(struct task_struct *tsk, struct pt_regs *regs, + unsigned int address; + struct unwind_frame_info frame_info; + +- seed_unwind_frame_info(tsk, regs, &frame_info); ++ if (seed_unwind_frame_info(tsk, regs, &frame_info)) ++ return 0; + + while (1) { + address = UNW_PC(&frame_info); +-- +2.27.0 + diff --git a/queue-4.19/arm64-dts-rockchip-assign-a-fixed-index-to-mmc-devic.patch b/queue-4.19/arm64-dts-rockchip-assign-a-fixed-index-to-mmc-devic.patch new file mode 100644 index 00000000000..12890946970 --- /dev/null +++ b/queue-4.19/arm64-dts-rockchip-assign-a-fixed-index-to-mmc-devic.patch @@ -0,0 +1,43 @@ +From 34d57ddbbb551e5d0ea483676efd0100d56a8a89 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 4 Nov 2020 17:23:55 +0100 +Subject: arm64: dts: rockchip: Assign a fixed index to mmc devices on rk3399 + boards. + +From: Markus Reichl + +[ Upstream commit 0011c6d182774fc781fb9e115ebe8baa356029ae ] + +Recently introduced async probe on mmc devices can shuffle block IDs. +Pin them to fixed values to ease booting in environments where UUIDs +are not practical. Use newly introduced aliases for mmcblk devices from [1]. + +[1] +https://patchwork.kernel.org/patch/11747669/ + +Signed-off-by: Markus Reichl +Reviewed-by: Douglas Anderson +Link: https://lore.kernel.org/r/20201104162356.1251-1-m.reichl@fivetechno.de +Signed-off-by: Heiko Stuebner +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/rockchip/rk3399.dtsi | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi +index f14e8c5c41acc..f4ee7c4f83b8b 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi +@@ -29,6 +29,9 @@ + i2c6 = &i2c6; + i2c7 = &i2c7; + i2c8 = &i2c8; ++ mmc0 = &sdio0; ++ mmc1 = &sdmmc; ++ mmc2 = &sdhci; + serial0 = &uart0; + serial1 = &uart1; + serial2 = &uart2; +-- +2.27.0 + diff --git a/queue-4.19/irqchip-gic-v3-its-unconditionally-save-restore-the-.patch b/queue-4.19/irqchip-gic-v3-its-unconditionally-save-restore-the-.patch new file mode 100644 index 00000000000..2afd4c6bf9d --- /dev/null +++ b/queue-4.19/irqchip-gic-v3-its-unconditionally-save-restore-the-.patch @@ -0,0 +1,99 @@ +From 3e1e4a3c16d9973dfda449e82369899b73f97f33 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 7 Nov 2020 10:42:26 +0000 +Subject: irqchip/gic-v3-its: Unconditionally save/restore the ITS state on + suspend + +From: Xu Qiang + +[ Upstream commit 74cde1a53368aed4f2b4b54bf7030437f64a534b ] + +On systems without HW-based collections (i.e. anything except GIC-500), +we rely on firmware to perform the ITS save/restore. This doesn't +really work, as although FW can properly save everything, it cannot +fully restore the state of the command queue (the read-side is reset +to the head of the queue). This results in the ITS consuming previously +processed commands, potentially corrupting the state. + +Instead, let's always save the ITS state on suspend, disabling it in the +process, and restore the full state on resume. This saves us from broken +FW as long as it doesn't enable the ITS by itself (for which we can't do +anything). + +This amounts to simply dropping the ITS_FLAGS_SAVE_SUSPEND_STATE. + +Signed-off-by: Xu Qiang +[maz: added warning on resume, rewrote commit message] +Signed-off-by: Marc Zyngier +Link: https://lore.kernel.org/r/20201107104226.14282-1-xuqiang36@huawei.com +Signed-off-by: Sasha Levin +--- + drivers/irqchip/irq-gic-v3-its.c | 16 +++------------- + 1 file changed, 3 insertions(+), 13 deletions(-) + +diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c +index d5cc32e80f5e2..cd58c123f547e 100644 +--- a/drivers/irqchip/irq-gic-v3-its.c ++++ b/drivers/irqchip/irq-gic-v3-its.c +@@ -49,7 +49,6 @@ + #define ITS_FLAGS_CMDQ_NEEDS_FLUSHING (1ULL << 0) + #define ITS_FLAGS_WORKAROUND_CAVIUM_22375 (1ULL << 1) + #define ITS_FLAGS_WORKAROUND_CAVIUM_23144 (1ULL << 2) +-#define ITS_FLAGS_SAVE_SUSPEND_STATE (1ULL << 3) + + #define RDIST_FLAGS_PROPBASE_NEEDS_FLUSHING (1 << 0) + +@@ -3240,9 +3239,6 @@ static int its_save_disable(void) + list_for_each_entry(its, &its_nodes, entry) { + void __iomem *base; + +- if (!(its->flags & ITS_FLAGS_SAVE_SUSPEND_STATE)) +- continue; +- + base = its->base; + its->ctlr_save = readl_relaxed(base + GITS_CTLR); + err = its_force_quiescent(base); +@@ -3261,9 +3257,6 @@ err: + list_for_each_entry_continue_reverse(its, &its_nodes, entry) { + void __iomem *base; + +- if (!(its->flags & ITS_FLAGS_SAVE_SUSPEND_STATE)) +- continue; +- + base = its->base; + writel_relaxed(its->ctlr_save, base + GITS_CTLR); + } +@@ -3283,9 +3276,6 @@ static void its_restore_enable(void) + void __iomem *base; + int i; + +- if (!(its->flags & ITS_FLAGS_SAVE_SUSPEND_STATE)) +- continue; +- + base = its->base; + + /* +@@ -3293,7 +3283,10 @@ static void its_restore_enable(void) + * don't restore it since writing to CBASER or BASER + * registers is undefined according to the GIC v3 ITS + * Specification. ++ * ++ * Firmware resuming with the ITS enabled is terminally broken. + */ ++ WARN_ON(readl_relaxed(base + GITS_CTLR) & GITS_CTLR_ENABLE); + ret = its_force_quiescent(base); + if (ret) { + pr_err("ITS@%pa: failed to quiesce on resume: %d\n", +@@ -3558,9 +3551,6 @@ static int __init its_probe_one(struct resource *res, + ctlr |= GITS_CTLR_ImDe; + writel_relaxed(ctlr, its->base + GITS_CTLR); + +- if (GITS_TYPER_HCC(typer)) +- its->flags |= ITS_FLAGS_SAVE_SUSPEND_STATE; +- + err = its_init_domain(handle, its); + if (err) + goto out_free_tables; +-- +2.27.0 + diff --git a/queue-4.19/iwlwifi-mvm-fix-kernel-panic-in-case-of-assert-durin.patch b/queue-4.19/iwlwifi-mvm-fix-kernel-panic-in-case-of-assert-durin.patch new file mode 100644 index 00000000000..e7e9542628a --- /dev/null +++ b/queue-4.19/iwlwifi-mvm-fix-kernel-panic-in-case-of-assert-durin.patch @@ -0,0 +1,42 @@ +From c205e503ef3ed4789324be14199fc4ac452361d7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 7 Nov 2020 10:50:11 +0200 +Subject: iwlwifi: mvm: fix kernel panic in case of assert during CSA + +From: Sara Sharon + +[ Upstream commit fe56d05ee6c87f6a1a8c7267affd92c9438249cc ] + +During CSA, we briefly nullify the phy context, in __iwl_mvm_unassign_vif_chanctx. +In case we have a FW assert right after it, it remains NULL though. +We end up running into endless loop due to mac80211 trying repeatedly to +move us to ASSOC state, and we keep returning -EINVAL. Later down the road +we hit a kernel panic. + +Detect and avoid this endless loop. + +Signed-off-by: Sara Sharon +Signed-off-by: Luca Coelho +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/iwlwifi.20201107104557.d64de2c17bff.Iedd0d2afa20a2aacba5259a5cae31cb3a119a4eb@changeid +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +index 525b26e0f65ee..2fad20c845b47 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +@@ -2880,7 +2880,7 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw, + + /* this would be a mac80211 bug ... but don't crash */ + if (WARN_ON_ONCE(!mvmvif->phy_ctxt)) +- return -EINVAL; ++ return test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status) ? 0 : -EINVAL; + + /* + * If we are in a STA removal flow and in DQA mode: +-- +2.27.0 + diff --git a/queue-4.19/iwlwifi-pcie-limit-memory-read-spin-time.patch b/queue-4.19/iwlwifi-pcie-limit-memory-read-spin-time.patch new file mode 100644 index 00000000000..11fde5a6210 --- /dev/null +++ b/queue-4.19/iwlwifi-pcie-limit-memory-read-spin-time.patch @@ -0,0 +1,94 @@ +From 220b630146fca2972f255b3f7e1fd6563621760e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 22 Oct 2020 16:51:03 +0300 +Subject: iwlwifi: pcie: limit memory read spin time + +From: Johannes Berg + +[ Upstream commit 04516706bb99889986ddfa3a769ed50d2dc7ac13 ] + +When we read device memory, we lock a spinlock, write the address we +want to read from the device and then spin in a loop reading the data +in 32-bit quantities from another register. + +As the description makes clear, this is rather inefficient, incurring +a PCIe bus transaction for every read. In a typical device today, we +want to read 786k SMEM if it crashes, leading to 192k register reads. +Occasionally, we've seen the whole loop take over 20 seconds and then +triggering the soft lockup detector. + +Clearly, it is unreasonable to spin here for such extended periods of +time. + +To fix this, break the loop down into an outer and an inner loop, and +break out of the inner loop if more than half a second elapsed. To +avoid too much overhead, check for that only every 128 reads, though +there's no particular reason for that number. Then, unlock and relock +to obtain NIC access again, reprogram the start address and continue. + +This will keep (interrupt) latencies on the CPU down to a reasonable +time. + +Signed-off-by: Johannes Berg +Signed-off-by: Mordechay Goodstein +Signed-off-by: Luca Coelho +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/iwlwifi.20201022165103.45878a7e49aa.I3b9b9c5a10002915072312ce75b68ed5b3dc6e14@changeid +Signed-off-by: Sasha Levin +--- + .../net/wireless/intel/iwlwifi/pcie/trans.c | 36 ++++++++++++++----- + 1 file changed, 27 insertions(+), 9 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +index 24da496151353..f48c7cac122e9 100644 +--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c ++++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +@@ -2121,18 +2121,36 @@ static int iwl_trans_pcie_read_mem(struct iwl_trans *trans, u32 addr, + void *buf, int dwords) + { + unsigned long flags; +- int offs, ret = 0; ++ int offs = 0; + u32 *vals = buf; + +- if (iwl_trans_grab_nic_access(trans, &flags)) { +- iwl_write32(trans, HBUS_TARG_MEM_RADDR, addr); +- for (offs = 0; offs < dwords; offs++) +- vals[offs] = iwl_read32(trans, HBUS_TARG_MEM_RDAT); +- iwl_trans_release_nic_access(trans, &flags); +- } else { +- ret = -EBUSY; ++ while (offs < dwords) { ++ /* limit the time we spin here under lock to 1/2s */ ++ ktime_t timeout = ktime_add_us(ktime_get(), 500 * USEC_PER_MSEC); ++ ++ if (iwl_trans_grab_nic_access(trans, &flags)) { ++ iwl_write32(trans, HBUS_TARG_MEM_RADDR, ++ addr + 4 * offs); ++ ++ while (offs < dwords) { ++ vals[offs] = iwl_read32(trans, ++ HBUS_TARG_MEM_RDAT); ++ offs++; ++ ++ /* calling ktime_get is expensive so ++ * do it once in 128 reads ++ */ ++ if (offs % 128 == 0 && ktime_after(ktime_get(), ++ timeout)) ++ break; ++ } ++ iwl_trans_release_nic_access(trans, &flags); ++ } else { ++ return -EBUSY; ++ } + } +- return ret; ++ ++ return 0; + } + + static int iwl_trans_pcie_write_mem(struct iwl_trans *trans, u32 addr, +-- +2.27.0 + diff --git a/queue-4.19/platform-x86-acer-wmi-add-automatic-keyboard-backgro.patch b/queue-4.19/platform-x86-acer-wmi-add-automatic-keyboard-backgro.patch new file mode 100644 index 00000000000..62a3edd9a0f --- /dev/null +++ b/queue-4.19/platform-x86-acer-wmi-add-automatic-keyboard-backgro.patch @@ -0,0 +1,38 @@ +From 1edf637d098432d2f3593c6dcfaae97d1400b50d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 4 Aug 2020 02:14:23 +0200 +Subject: platform/x86: acer-wmi: add automatic keyboard background light + toggle key as KEY_LIGHTS_TOGGLE + +From: Timo Witte + +[ Upstream commit 9e7a005ad56aa7d6ea5830c5ffcc60bf35de380b ] + +Got a dmesg message on my AMD Renoir based Acer laptop: +"acer_wmi: Unknown key number - 0x84" when toggling keyboard +background light + +Signed-off-by: Timo Witte +Reviewed-by: "Lee, Chun-Yi" +Link: https://lore.kernel.org/r/20200804001423.36778-1-timo.witte@gmail.com +Signed-off-by: Hans de Goede +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/acer-wmi.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c +index fcfeadd1301f4..92400abe35520 100644 +--- a/drivers/platform/x86/acer-wmi.c ++++ b/drivers/platform/x86/acer-wmi.c +@@ -124,6 +124,7 @@ static const struct key_entry acer_wmi_keymap[] __initconst = { + {KE_KEY, 0x64, {KEY_SWITCHVIDEOMODE} }, /* Display Switch */ + {KE_IGNORE, 0x81, {KEY_SLEEP} }, + {KE_KEY, 0x82, {KEY_TOUCHPAD_TOGGLE} }, /* Touch Pad Toggle */ ++ {KE_IGNORE, 0x84, {KEY_KBDILLUMTOGGLE} }, /* Automatic Keyboard background light toggle */ + {KE_KEY, KEY_TOUCHPAD_ON, {KEY_TOUCHPAD_ON} }, + {KE_KEY, KEY_TOUCHPAD_OFF, {KEY_TOUCHPAD_OFF} }, + {KE_IGNORE, 0x83, {KEY_TOUCHPAD_TOGGLE} }, +-- +2.27.0 + diff --git a/queue-4.19/platform-x86-intel-vbtn-support-for-tablet-mode-on-h.patch b/queue-4.19/platform-x86-intel-vbtn-support-for-tablet-mode-on-h.patch new file mode 100644 index 00000000000..e000b7490df --- /dev/null +++ b/queue-4.19/platform-x86-intel-vbtn-support-for-tablet-mode-on-h.patch @@ -0,0 +1,42 @@ +From 2ea4c8734bcef711971ba2372b9e29a3f4773b89 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 24 Nov 2020 15:16:52 +0200 +Subject: platform/x86: intel-vbtn: Support for tablet mode on HP Pavilion 13 + x360 PC + +From: Max Verevkin + +[ Upstream commit 8b205d3e1bf52ab31cdd5c55f87c87a227793d84 ] + +The Pavilion 13 x360 PC has a chassis-type which does not indicate it is +a convertible, while it is actually a convertible. Add it to the +dmi_switches_allow_list. + +Signed-off-by: Max Verevkin +Link: https://lore.kernel.org/r/20201124131652.11165-1-me@maxverevkin.tk +Signed-off-by: Hans de Goede +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/intel-vbtn.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c +index 1e6b4661c7645..3aba207ee1745 100644 +--- a/drivers/platform/x86/intel-vbtn.c ++++ b/drivers/platform/x86/intel-vbtn.c +@@ -197,6 +197,12 @@ static const struct dmi_system_id dmi_switches_allow_list[] = { + DMI_MATCH(DMI_PRODUCT_NAME, "HP Stream x360 Convertible PC 11"), + }, + }, ++ { ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion 13 x360 PC"), ++ }, ++ }, + {} /* Array terminator */ + }; + +-- +2.27.0 + diff --git a/queue-4.19/platform-x86-thinkpad_acpi-add-bat1-is-primary-batte.patch b/queue-4.19/platform-x86-thinkpad_acpi-add-bat1-is-primary-batte.patch new file mode 100644 index 00000000000..e70b50fd1df --- /dev/null +++ b/queue-4.19/platform-x86-thinkpad_acpi-add-bat1-is-primary-batte.patch @@ -0,0 +1,47 @@ +From b00c4c1e3d3b6e3c3e150728a5593ed12e5645dc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 9 Nov 2020 11:35:50 +0100 +Subject: platform/x86: thinkpad_acpi: Add BAT1 is primary battery quirk for + Thinkpad Yoga 11e 4th gen + +From: Hans de Goede + +[ Upstream commit c986a7024916c92a775fc8d853fba3cae1d5fde4 ] + +The Thinkpad Yoga 11e 4th gen with the N3450 / Celeron CPU only has +one battery which is named BAT1 instead of the expected BAT0, add a +quirk for this. This fixes not being able to set the charging tresholds +on this model; and this alsoe fixes the following errors in dmesg: + +ACPI: \_SB_.PCI0.LPCB.EC__.HKEY: BCTG evaluated but flagged as error +thinkpad_acpi: Error probing battery 2 +battery: extension failed to load: ThinkPad Battery Extension +battery: extension unregistered: ThinkPad Battery Extension + +Note that the added quirk is for the "R0K" BIOS versions which are +used on the Thinkpad Yoga 11e 4th gen's with a Celeron CPU, there +is a separate "R0L" BIOS for the i3/i5 based versions. This may also +need the same quirk, but if that really is necessary is unknown. + +Signed-off-by: Hans de Goede +Link: https://lore.kernel.org/r/20201109103550.16265-1-hdegoede@redhat.com +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/thinkpad_acpi.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c +index 79ac62d8ff7ba..a6e69f2495d23 100644 +--- a/drivers/platform/x86/thinkpad_acpi.c ++++ b/drivers/platform/x86/thinkpad_acpi.c +@@ -9697,6 +9697,7 @@ static const struct tpacpi_quirk battery_quirk_table[] __initconst = { + TPACPI_Q_LNV3('R', '0', 'B', true), /* Thinkpad 11e gen 3 */ + TPACPI_Q_LNV3('R', '0', 'C', true), /* Thinkpad 13 */ + TPACPI_Q_LNV3('R', '0', 'J', true), /* Thinkpad 13 gen 2 */ ++ TPACPI_Q_LNV3('R', '0', 'K', true), /* Thinkpad 11e gen 4 celeron BIOS */ + }; + + static int __init tpacpi_battery_init(struct ibm_init_struct *ibm) +-- +2.27.0 + diff --git a/queue-4.19/platform-x86-thinkpad_acpi-do-not-report-sw_tablet_m.patch b/queue-4.19/platform-x86-thinkpad_acpi-do-not-report-sw_tablet_m.patch new file mode 100644 index 00000000000..eb5b49b308f --- /dev/null +++ b/queue-4.19/platform-x86-thinkpad_acpi-do-not-report-sw_tablet_m.patch @@ -0,0 +1,66 @@ +From d9f00bd1c88c19b4b3feef2b60f7252436df6586 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 6 Nov 2020 15:01:30 +0100 +Subject: platform/x86: thinkpad_acpi: Do not report SW_TABLET_MODE on Yoga 11e + +From: Hans de Goede + +[ Upstream commit f2eae1888cf22590c38764b8fa3c989c0283870e ] + +The Yoga 11e series has 2 accelerometers described by a BOSC0200 ACPI node. +This setup relies on a Windows service which reads both accelerometers and +then calculates the angle between the 2 halves to determine laptop / tent / +tablet mode and then reports the calculated mode back to the EC by calling +special ACPI methods on the BOSC0200 node. + +The bmc150 iio driver does not support this (it involves double +calculations requiring sqrt and arccos so this really needs to be done +in userspace), as a result of this on the Yoga 11e the thinkpad_acpi +code always reports SW_TABLET_MODE=0, starting with GNOME 3.38 reporting +SW_TABLET_MODE=0 causes GNOME to: + +1. Not show the onscreen keyboard when a text-input field is focussed + with the touchscreen. +2. Disable accelerometer based auto display-rotation. + +This makes sense when in laptop-mode but not when in tablet-mode. But +since for the Yoga 11e the thinkpad_acpi code always reports +SW_TABLET_MODE=0, GNOME does not know when the device is in tablet-mode. + +Stop reporting the broken (always 0) SW_TABLET_MODE on Yoga 11e models +to fix this. + +Note there are plans for userspace to support 360 degree hinges style +2-in-1s with 2 accelerometers and figure out the mode by itself, see: +https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/issues/216 + +Signed-off-by: Hans de Goede +Link: https://lore.kernel.org/r/20201106140130.46820-1-hdegoede@redhat.com +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/thinkpad_acpi.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c +index 8cc01857bc5c0..79ac62d8ff7ba 100644 +--- a/drivers/platform/x86/thinkpad_acpi.c ++++ b/drivers/platform/x86/thinkpad_acpi.c +@@ -3242,7 +3242,14 @@ static int hotkey_init_tablet_mode(void) + + in_tablet_mode = hotkey_gmms_get_tablet_mode(res, + &has_tablet_mode); +- if (has_tablet_mode) ++ /* ++ * The Yoga 11e series has 2 accelerometers described by a ++ * BOSC0200 ACPI node. This setup relies on a Windows service ++ * which calls special ACPI methods on this node to report ++ * the laptop/tent/tablet mode to the EC. The bmc150 iio driver ++ * does not support this, so skip the hotkey on these models. ++ */ ++ if (has_tablet_mode && !acpi_dev_present("BOSC0200", "1", -1)) + tp_features.hotkey_tablet = TP_HOTKEY_TABLET_USES_GMMS; + type = "GMMS"; + } else if (acpi_evalf(hkey_handle, &res, "MHKG", "qd")) { +-- +2.27.0 + diff --git a/queue-4.19/powerpc-drop-me200-addition-to-build-flags.patch b/queue-4.19/powerpc-drop-me200-addition-to-build-flags.patch new file mode 100644 index 00000000000..22639584343 --- /dev/null +++ b/queue-4.19/powerpc-drop-me200-addition-to-build-flags.patch @@ -0,0 +1,51 @@ +From 138eb9fa29795c4209c2ae4e095ba1aa1abe7d42 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 16 Nov 2020 23:09:13 +1100 +Subject: powerpc: Drop -me200 addition to build flags +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Michael Ellerman + +[ Upstream commit e02152ba2810f7c88cb54e71cda096268dfa9241 ] + +Currently a build with CONFIG_E200=y will fail with: + + Error: invalid switch -me200 + Error: unrecognized option -me200 + +Upstream binutils has never supported an -me200 option. Presumably it +was supported at some point by either a fork or Freescale internal +binutils. + +We can't support code that we can't even build test, so drop the +addition of -me200 to the build flags, so we can at least build with +CONFIG_E200=y. + +Reported-by: Németh Márton +Reported-by: kernel test robot +Signed-off-by: Michael Ellerman +Reviewed-by: Nick Desaulniers +Acked-by: Scott Wood +Link: https://lore.kernel.org/r/20201116120913.165317-1-mpe@ellerman.id.au +Signed-off-by: Sasha Levin +--- + arch/powerpc/Makefile | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile +index 8954108df4570..f51e21ea53492 100644 +--- a/arch/powerpc/Makefile ++++ b/arch/powerpc/Makefile +@@ -251,7 +251,6 @@ endif + + cpu-as-$(CONFIG_4xx) += -Wa,-m405 + cpu-as-$(CONFIG_ALTIVEC) += $(call as-option,-Wa$(comma)-maltivec) +-cpu-as-$(CONFIG_E200) += -Wa,-me200 + cpu-as-$(CONFIG_E500) += -Wa,-me500 + + # When using '-many -mpower4' gas will first try and find a matching power4 +-- +2.27.0 + diff --git a/queue-4.19/scsi-ufs-make-sure-clk-scaling-happens-only-when-hba.patch b/queue-4.19/scsi-ufs-make-sure-clk-scaling-happens-only-when-hba.patch new file mode 100644 index 00000000000..2230fc2f30c --- /dev/null +++ b/queue-4.19/scsi-ufs-make-sure-clk-scaling-happens-only-when-hba.patch @@ -0,0 +1,57 @@ +From d4fc6335c10cf0e2a436ae7ab95af9b8381178b3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 22 Sep 2020 00:09:04 -0700 +Subject: scsi: ufs: Make sure clk scaling happens only when HBA is runtime + ACTIVE + +From: Can Guo + +[ Upstream commit 73cc291c270248567245f084dcdf5078069af6b5 ] + +If someone plays with the UFS clk scaling devfreq governor through sysfs, +ufshcd_devfreq_scale may be called even when HBA is not runtime ACTIVE. +This can lead to unexpected error. We cannot just protect it by calling +pm_runtime_get_sync() because that may cause a race condition since HBA +runtime suspend ops need to suspend clk scaling. To fix this call +pm_runtime_get_noresume() and check HBA's runtime status. Only proceed if +HBA is runtime ACTIVE, otherwise just bail. + +governor_store + devfreq_performance_handler + update_devfreq + devfreq_set_target + ufshcd_devfreq_target + ufshcd_devfreq_scale + +Link: https://lore.kernel.org/r/1600758548-28576-1-git-send-email-cang@codeaurora.org +Reviewed-by: Stanley Chu +Signed-off-by: Can Guo +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/ufs/ufshcd.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c +index 7e4e6e982055e..61b1eae42ea85 100644 +--- a/drivers/scsi/ufs/ufshcd.c ++++ b/drivers/scsi/ufs/ufshcd.c +@@ -1281,8 +1281,15 @@ static int ufshcd_devfreq_target(struct device *dev, + } + spin_unlock_irqrestore(hba->host->host_lock, irq_flags); + ++ pm_runtime_get_noresume(hba->dev); ++ if (!pm_runtime_active(hba->dev)) { ++ pm_runtime_put_noidle(hba->dev); ++ ret = -EAGAIN; ++ goto out; ++ } + start = ktime_get(); + ret = ufshcd_devfreq_scale(hba, scale_up); ++ pm_runtime_put(hba->dev); + + trace_ufshcd_profile_clk_scaling(dev_name(hba->dev), + (scale_up ? "up" : "down"), +-- +2.27.0 + diff --git a/queue-4.19/series b/queue-4.19/series index aebc2263e4a..133bae308d5 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -2,3 +2,15 @@ kbuild-do-not-emit-debug-info-for-assembly-with-llvm_ias-1.patch x86-lib-change-.weak-to-sym_func_start_weak-for-arch-x86-lib-mem-_64.s.patch spi-bcm2835aux-fix-use-after-free-on-unbind.patch spi-bcm2835aux-restore-err-assignment-in-bcm2835aux_spi_probe.patch +iwlwifi-pcie-limit-memory-read-spin-time.patch +arm64-dts-rockchip-assign-a-fixed-index-to-mmc-devic.patch +iwlwifi-mvm-fix-kernel-panic-in-case-of-assert-durin.patch +powerpc-drop-me200-addition-to-build-flags.patch +arc-stack-unwinding-don-t-assume-non-current-task-is.patch +scsi-ufs-make-sure-clk-scaling-happens-only-when-hba.patch +irqchip-gic-v3-its-unconditionally-save-restore-the-.patch +soc-fsl-dpio-get-the-cpumask-through-cpumask_of-cpu.patch +platform-x86-thinkpad_acpi-do-not-report-sw_tablet_m.patch +platform-x86-thinkpad_acpi-add-bat1-is-primary-batte.patch +platform-x86-acer-wmi-add-automatic-keyboard-backgro.patch +platform-x86-intel-vbtn-support-for-tablet-mode-on-h.patch diff --git a/queue-4.19/soc-fsl-dpio-get-the-cpumask-through-cpumask_of-cpu.patch b/queue-4.19/soc-fsl-dpio-get-the-cpumask-through-cpumask_of-cpu.patch new file mode 100644 index 00000000000..b03dae95d90 --- /dev/null +++ b/queue-4.19/soc-fsl-dpio-get-the-cpumask-through-cpumask_of-cpu.patch @@ -0,0 +1,110 @@ +From bba57d4d7f570a1707b37e4276f824320f62b218 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 20 Oct 2020 10:18:32 +0800 +Subject: soc: fsl: dpio: Get the cpumask through cpumask_of(cpu) + +From: Hao Si + +[ Upstream commit 2663b3388551230cbc4606a40fabf3331ceb59e4 ] + +The local variable 'cpumask_t mask' is in the stack memory, and its address +is assigned to 'desc->affinity' in 'irq_set_affinity_hint()'. +But the memory area where this variable is located is at risk of being +modified. + +During LTP testing, the following error was generated: + +Unable to handle kernel paging request at virtual address ffff000012e9b790 +Mem abort info: + ESR = 0x96000007 + Exception class = DABT (current EL), IL = 32 bits + SET = 0, FnV = 0 + EA = 0, S1PTW = 0 +Data abort info: + ISV = 0, ISS = 0x00000007 + CM = 0, WnR = 0 +swapper pgtable: 4k pages, 48-bit VAs, pgdp = 0000000075ac5e07 +[ffff000012e9b790] pgd=00000027dbffe003, pud=00000027dbffd003, +pmd=00000027b6d61003, pte=0000000000000000 +Internal error: Oops: 96000007 [#1] PREEMPT SMP +Modules linked in: xt_conntrack +Process read_all (pid: 20171, stack limit = 0x0000000044ea4095) +CPU: 14 PID: 20171 Comm: read_all Tainted: G B W +Hardware name: NXP Layerscape LX2160ARDB (DT) +pstate: 80000085 (Nzcv daIf -PAN -UAO) +pc : irq_affinity_hint_proc_show+0x54/0xb0 +lr : irq_affinity_hint_proc_show+0x4c/0xb0 +sp : ffff00001138bc10 +x29: ffff00001138bc10 x28: 0000ffffd131d1e0 +x27: 00000000007000c0 x26: ffff8025b9480dc0 +x25: ffff8025b9480da8 x24: 00000000000003ff +x23: ffff8027334f8300 x22: ffff80272e97d000 +x21: ffff80272e97d0b0 x20: ffff8025b9480d80 +x19: ffff000009a49000 x18: 0000000000000000 +x17: 0000000000000000 x16: 0000000000000000 +x15: 0000000000000000 x14: 0000000000000000 +x13: 0000000000000000 x12: 0000000000000040 +x11: 0000000000000000 x10: ffff802735b79b88 +x9 : 0000000000000000 x8 : 0000000000000000 +x7 : ffff000009a49848 x6 : 0000000000000003 +x5 : 0000000000000000 x4 : ffff000008157d6c +x3 : ffff00001138bc10 x2 : ffff000012e9b790 +x1 : 0000000000000000 x0 : 0000000000000000 +Call trace: + irq_affinity_hint_proc_show+0x54/0xb0 + seq_read+0x1b0/0x440 + proc_reg_read+0x80/0xd8 + __vfs_read+0x60/0x178 + vfs_read+0x94/0x150 + ksys_read+0x74/0xf0 + __arm64_sys_read+0x24/0x30 + el0_svc_common.constprop.0+0xd8/0x1a0 + el0_svc_handler+0x34/0x88 + el0_svc+0x10/0x14 +Code: f9001bbf 943e0732 f94066c2 b4000062 (f9400041) +---[ end trace b495bdcb0b3b732b ]--- +Kernel panic - not syncing: Fatal exception +SMP: stopping secondary CPUs +SMP: failed to stop secondary CPUs 0,2-4,6,8,11,13-15 +Kernel Offset: disabled +CPU features: 0x0,21006008 +Memory Limit: none +---[ end Kernel panic - not syncing: Fatal exception ]--- + +Fix it by using 'cpumask_of(cpu)' to get the cpumask. + +Signed-off-by: Hao Si +Signed-off-by: Lin Chen +Signed-off-by: Yi Wang +Signed-off-by: Li Yang +Signed-off-by: Sasha Levin +--- + drivers/soc/fsl/dpio/dpio-driver.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/drivers/soc/fsl/dpio/dpio-driver.c b/drivers/soc/fsl/dpio/dpio-driver.c +index b60b77bfaffae..ea6f8904c01b5 100644 +--- a/drivers/soc/fsl/dpio/dpio-driver.c ++++ b/drivers/soc/fsl/dpio/dpio-driver.c +@@ -53,7 +53,6 @@ static int register_dpio_irq_handlers(struct fsl_mc_device *dpio_dev, int cpu) + struct dpio_priv *priv; + int error; + struct fsl_mc_device_irq *irq; +- cpumask_t mask; + + priv = dev_get_drvdata(&dpio_dev->dev); + +@@ -72,9 +71,7 @@ static int register_dpio_irq_handlers(struct fsl_mc_device *dpio_dev, int cpu) + } + + /* set the affinity hint */ +- cpumask_clear(&mask); +- cpumask_set_cpu(cpu, &mask); +- if (irq_set_affinity_hint(irq->msi_desc->irq, &mask)) ++ if (irq_set_affinity_hint(irq->msi_desc->irq, cpumask_of(cpu))) + dev_err(&dpio_dev->dev, + "irq_set_affinity failed irq %d cpu %d\n", + irq->msi_desc->irq, cpu); +-- +2.27.0 + -- 2.47.3