From f3c0aafdb417bb48b110adc9a2b6ee3f673a983c Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 25 Apr 2021 21:03:59 -0400 Subject: [PATCH] Fixes for 5.11 Signed-off-by: Sasha Levin --- ...-dts-fix-swapped-mmc-order-for-omap3.patch | 42 +++++ ...store-local-irqflag-if-kprobes-is-ca.patch | 51 ++++++ ...vium-liquidio-fix-duplicate-argument.patch | 40 +++++ ...onfig-symbol-name-to-fix-e1000-build.patch | 58 +++++++ ...20-fix-runtime-pm-imbalance-on-error.patch | 49 ++++++ ...-dpdma-fix-descriptor-issuing-on-vid.patch | 82 +++++++++ ...-dpdma-fix-race-condition-in-done-ir.patch | 44 +++++ ...or-return-code-in-alps_input_configu.patch | 35 ++++ ...support-for-2021-asus-n-key-keyboard.patch | 50 ++++++ ...2-fix-support-for-multiple-gpiochips.patch | 77 +++++++++ queue-5.11/hid-google-add-don-usb-id.patch | 47 ++++++ ...gn-boolean-values-to-a-bool-variable.patch | 38 +++++ ...4-fix-discontig.c-section-mismatches.patch | 73 ++++++++ ...e-duplicate-definition-of-ia64_mf-on.patch | 59 +++++++ ...fix-ordering-in-queued_write_lock_sl.patch | 85 ++++++++++ .../m68k-fix-flatmem-memory-model-setup.patch | 40 +++++ ...-skb-is-large-enough-for-ipv4-ipv6-h.patch | 52 ++++++ ...x-potential-null-pointer-dereference.patch | 52 ++++++ ...fix-error-return-code-in-maps__clone.patch | 57 +++++++ ...ncore-remove-uncore-extra-pci-dev-hs.patch | 159 ++++++++++++++++++ ...-broadwell-xeon-stepping-in-isolatio.patch | 50 ++++++ ...90-entry-save-the-caller-of-psw_idle.patch | 62 +++++++ queue-5.11/series | 24 +++ ...ni-shield-geni_icc_get-for-acpi-boot.patch | 42 +++++ ...k-for-hotplug-status-existence-befor.patch | 66 ++++++++ 25 files changed, 1434 insertions(+) create mode 100644 queue-5.11/arm-dts-fix-swapped-mmc-order-for-omap3.patch create mode 100644 queue-5.11/arm64-kprobes-restore-local-irqflag-if-kprobes-is-ca.patch create mode 100644 queue-5.11/cavium-liquidio-fix-duplicate-argument.patch create mode 100644 queue-5.11/csky-change-a-kconfig-symbol-name-to-fix-e1000-build.patch create mode 100644 queue-5.11/dmaengine-tegra20-fix-runtime-pm-imbalance-on-error.patch create mode 100644 queue-5.11/dmaengine-xilinx-dpdma-fix-descriptor-issuing-on-vid.patch create mode 100644 queue-5.11/dmaengine-xilinx-dpdma-fix-race-condition-in-done-ir.patch create mode 100644 queue-5.11/hid-alps-fix-error-return-code-in-alps_input_configu.patch create mode 100644 queue-5.11/hid-asus-add-support-for-2021-asus-n-key-keyboard.patch create mode 100644 queue-5.11/hid-cp2112-fix-support-for-multiple-gpiochips.patch create mode 100644 queue-5.11/hid-google-add-don-usb-id.patch create mode 100644 queue-5.11/hid-wacom-assign-boolean-values-to-a-bool-variable.patch create mode 100644 queue-5.11/ia64-fix-discontig.c-section-mismatches.patch create mode 100644 queue-5.11/ia64-tools-remove-duplicate-definition-of-ia64_mf-on.patch create mode 100644 queue-5.11/locking-qrwlock-fix-ordering-in-queued_write_lock_sl.patch create mode 100644 queue-5.11/m68k-fix-flatmem-memory-model-setup.patch create mode 100644 queue-5.11/net-geneve-check-skb-is-large-enough-for-ipv4-ipv6-h.patch create mode 100644 queue-5.11/perf-auxtrace-fix-potential-null-pointer-dereference.patch create mode 100644 queue-5.11/perf-map-fix-error-return-code-in-maps__clone.patch create mode 100644 queue-5.11/perf-x86-intel-uncore-remove-uncore-extra-pci-dev-hs.patch create mode 100644 queue-5.11/perf-x86-kvm-fix-broadwell-xeon-stepping-in-isolatio.patch create mode 100644 queue-5.11/s390-entry-save-the-caller-of-psw_idle.patch create mode 100644 queue-5.11/soc-qcom-geni-shield-geni_icc_get-for-acpi-boot.patch create mode 100644 queue-5.11/xen-netback-check-for-hotplug-status-existence-befor.patch diff --git a/queue-5.11/arm-dts-fix-swapped-mmc-order-for-omap3.patch b/queue-5.11/arm-dts-fix-swapped-mmc-order-for-omap3.patch new file mode 100644 index 00000000000..6bff913714a --- /dev/null +++ b/queue-5.11/arm-dts-fix-swapped-mmc-order-for-omap3.patch @@ -0,0 +1,42 @@ +From 12b44d15f120df107098f3fc59ae63e9957012fc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 24 Mar 2021 15:10:32 +0200 +Subject: ARM: dts: Fix swapped mmc order for omap3 + +From: Tony Lindgren + +[ Upstream commit a1ebdb3741993f853865d1bd8f77881916ad53a7 ] + +Also some omap3 devices like n900 seem to have eMMC and micro-sd swapped +around with commit 21b2cec61c04 ("mmc: Set PROBE_PREFER_ASYNCHRONOUS for +drivers that existed in v4.4"). + +Let's fix the issue with aliases as discussed on the mailing lists. While +the mmc aliases should be board specific, let's first fix the issue with +minimal changes. + +Cc: Aaro Koskinen +Cc: Peter Ujfalusi +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/omap3.dtsi | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi +index 9dcae1f2bc99..c5b9da0d7e6c 100644 +--- a/arch/arm/boot/dts/omap3.dtsi ++++ b/arch/arm/boot/dts/omap3.dtsi +@@ -24,6 +24,9 @@ + i2c0 = &i2c1; + i2c1 = &i2c2; + i2c2 = &i2c3; ++ mmc0 = &mmc1; ++ mmc1 = &mmc2; ++ mmc2 = &mmc3; + serial0 = &uart1; + serial1 = &uart2; + serial2 = &uart3; +-- +2.30.2 + diff --git a/queue-5.11/arm64-kprobes-restore-local-irqflag-if-kprobes-is-ca.patch b/queue-5.11/arm64-kprobes-restore-local-irqflag-if-kprobes-is-ca.patch new file mode 100644 index 00000000000..44744c84e9c --- /dev/null +++ b/queue-5.11/arm64-kprobes-restore-local-irqflag-if-kprobes-is-ca.patch @@ -0,0 +1,51 @@ +From 611d928fbd8c8766ae5c766f465ca50da520071c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 12 Apr 2021 17:41:01 +0800 +Subject: arm64: kprobes: Restore local irqflag if kprobes is cancelled + +From: Jisheng Zhang + +[ Upstream commit 738fa58ee1328481d1d7889e7c430b3401c571b9 ] + +If instruction being single stepped caused a page fault, the kprobes +is cancelled to let the page fault handler continue as a normal page +fault. But the local irqflags are disabled so cpu will restore pstate +with DAIF masked. After pagefault is serviced, the kprobes is +triggerred again, we overwrite the saved_irqflag by calling +kprobes_save_local_irqflag(). NOTE, DAIF is masked in this new saved +irqflag. After kprobes is serviced, the cpu pstate is retored with +DAIF masked. + +This patch is inspired by one patch for riscv from Liao Chang. + +Signed-off-by: Jisheng Zhang +Acked-by: Masami Hiramatsu +Link: https://lore.kernel.org/r/20210412174101.6bfb0594@xhacker.debian +Signed-off-by: Will Deacon +Signed-off-by: Sasha Levin +--- + arch/arm64/kernel/probes/kprobes.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c +index 66aac2881ba8..85645b2b0c7a 100644 +--- a/arch/arm64/kernel/probes/kprobes.c ++++ b/arch/arm64/kernel/probes/kprobes.c +@@ -267,10 +267,12 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr) + if (!instruction_pointer(regs)) + BUG(); + +- if (kcb->kprobe_status == KPROBE_REENTER) ++ if (kcb->kprobe_status == KPROBE_REENTER) { + restore_previous_kprobe(kcb); +- else ++ } else { ++ kprobes_restore_local_irqflag(kcb, regs); + reset_current_kprobe(); ++ } + + break; + case KPROBE_HIT_ACTIVE: +-- +2.30.2 + diff --git a/queue-5.11/cavium-liquidio-fix-duplicate-argument.patch b/queue-5.11/cavium-liquidio-fix-duplicate-argument.patch new file mode 100644 index 00000000000..590077ed121 --- /dev/null +++ b/queue-5.11/cavium-liquidio-fix-duplicate-argument.patch @@ -0,0 +1,40 @@ +From c56e1e8d941362d2a55e756e7626e63ca88f9ffa Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 14 Apr 2021 19:31:48 +0800 +Subject: cavium/liquidio: Fix duplicate argument + +From: Wan Jiabing + +[ Upstream commit 416dcc5ce9d2a810477171c62ffa061a98f87367 ] + +Fix the following coccicheck warning: + +./drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h:413:6-28: +duplicated argument to & or | + +The CN6XXX_INTR_M1UPB0_ERR here is duplicate. +Here should be CN6XXX_INTR_M1UNB0_ERR. + +Signed-off-by: Wan Jiabing +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h b/drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h +index b248966837b4..7aad40b2aa73 100644 +--- a/drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h ++++ b/drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h +@@ -412,7 +412,7 @@ + | CN6XXX_INTR_M0UNWI_ERR \ + | CN6XXX_INTR_M1UPB0_ERR \ + | CN6XXX_INTR_M1UPWI_ERR \ +- | CN6XXX_INTR_M1UPB0_ERR \ ++ | CN6XXX_INTR_M1UNB0_ERR \ + | CN6XXX_INTR_M1UNWI_ERR \ + | CN6XXX_INTR_INSTR_DB_OF_ERR \ + | CN6XXX_INTR_SLIST_DB_OF_ERR \ +-- +2.30.2 + diff --git a/queue-5.11/csky-change-a-kconfig-symbol-name-to-fix-e1000-build.patch b/queue-5.11/csky-change-a-kconfig-symbol-name-to-fix-e1000-build.patch new file mode 100644 index 00000000000..d7c4e412ba4 --- /dev/null +++ b/queue-5.11/csky-change-a-kconfig-symbol-name-to-fix-e1000-build.patch @@ -0,0 +1,58 @@ +From ced5e24efb99adb512552b294ab1ba173c0c6b2c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 16 Apr 2021 15:46:03 -0700 +Subject: csky: change a Kconfig symbol name to fix e1000 build error + +From: Randy Dunlap + +[ Upstream commit d199161653d612b8fb96ac51bfd5b2d2782ecef3 ] + +e1000's #define of CONFIG_RAM_BASE conflicts with a Kconfig symbol in +arch/csky/Kconfig. + +The symbol in e1000 has been around longer, so change arch/csky/ to use +DRAM_BASE instead of RAM_BASE to remove the conflict. (although e1000 +is also a 2-line change) + +Link: https://lkml.kernel.org/r/20210411055335.7111-1-rdunlap@infradead.org +Signed-off-by: Randy Dunlap +Reported-by: kernel test robot +Acked-by: Guo Ren +Cc: Jesse Brandeburg +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + arch/csky/Kconfig | 2 +- + arch/csky/include/asm/page.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig +index 89dd2fcf38fa..3b16d081b4d7 100644 +--- a/arch/csky/Kconfig ++++ b/arch/csky/Kconfig +@@ -292,7 +292,7 @@ config FORCE_MAX_ZONEORDER + int "Maximum zone order" + default "11" + +-config RAM_BASE ++config DRAM_BASE + hex "DRAM start addr (the same with memory-section in dts)" + default 0x0 + +diff --git a/arch/csky/include/asm/page.h b/arch/csky/include/asm/page.h +index 9b98bf31d57c..16878240ef9a 100644 +--- a/arch/csky/include/asm/page.h ++++ b/arch/csky/include/asm/page.h +@@ -28,7 +28,7 @@ + #define SSEG_SIZE 0x20000000 + #define LOWMEM_LIMIT (SSEG_SIZE * 2) + +-#define PHYS_OFFSET_OFFSET (CONFIG_RAM_BASE & (SSEG_SIZE - 1)) ++#define PHYS_OFFSET_OFFSET (CONFIG_DRAM_BASE & (SSEG_SIZE - 1)) + + #ifndef __ASSEMBLY__ + +-- +2.30.2 + diff --git a/queue-5.11/dmaengine-tegra20-fix-runtime-pm-imbalance-on-error.patch b/queue-5.11/dmaengine-tegra20-fix-runtime-pm-imbalance-on-error.patch new file mode 100644 index 00000000000..559b73d9486 --- /dev/null +++ b/queue-5.11/dmaengine-tegra20-fix-runtime-pm-imbalance-on-error.patch @@ -0,0 +1,49 @@ +From 827b3bbe32dec16999840db6f801f199ecb390e1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 9 Apr 2021 16:28:05 +0800 +Subject: dmaengine: tegra20: Fix runtime PM imbalance on error + +From: Dinghao Liu + +[ Upstream commit 917a3200b9f467a154999c7572af345f2470aaf4 ] + +pm_runtime_get_sync() will increase the runtime PM counter +even it returns an error. Thus a pairing decrement is needed +to prevent refcount leak. Fix this by replacing this API with +pm_runtime_resume_and_get(), which will not change the runtime +PM counter on error. + +Signed-off-by: Dinghao Liu +Acked-by: Thierry Reding +Link: https://lore.kernel.org/r/20210409082805.23643-1-dinghao.liu@zju.edu.cn +Signed-off-by: Vinod Koul +Signed-off-by: Sasha Levin +--- + drivers/dma/tegra20-apb-dma.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c +index 71827d9b0aa1..b7260749e8ee 100644 +--- a/drivers/dma/tegra20-apb-dma.c ++++ b/drivers/dma/tegra20-apb-dma.c +@@ -723,7 +723,7 @@ static void tegra_dma_issue_pending(struct dma_chan *dc) + goto end; + } + if (!tdc->busy) { +- err = pm_runtime_get_sync(tdc->tdma->dev); ++ err = pm_runtime_resume_and_get(tdc->tdma->dev); + if (err < 0) { + dev_err(tdc2dev(tdc), "Failed to enable DMA\n"); + goto end; +@@ -818,7 +818,7 @@ static void tegra_dma_synchronize(struct dma_chan *dc) + struct tegra_dma_channel *tdc = to_tegra_dma_chan(dc); + int err; + +- err = pm_runtime_get_sync(tdc->tdma->dev); ++ err = pm_runtime_resume_and_get(tdc->tdma->dev); + if (err < 0) { + dev_err(tdc2dev(tdc), "Failed to synchronize DMA: %d\n", err); + return; +-- +2.30.2 + diff --git a/queue-5.11/dmaengine-xilinx-dpdma-fix-descriptor-issuing-on-vid.patch b/queue-5.11/dmaengine-xilinx-dpdma-fix-descriptor-issuing-on-vid.patch new file mode 100644 index 00000000000..7057f89600d --- /dev/null +++ b/queue-5.11/dmaengine-xilinx-dpdma-fix-descriptor-issuing-on-vid.patch @@ -0,0 +1,82 @@ +From 230c2cc4a318b5f6f2c012b4f08ed3736f798adb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 7 Mar 2021 06:06:28 +0200 +Subject: dmaengine: xilinx: dpdma: Fix descriptor issuing on video group + +From: Laurent Pinchart + +[ Upstream commit 1cbd44666216278bbb6a55bcb6b9283702171c77 ] + +When multiple channels are part of a video group, the transfer is +triggered only when all channels in the group are ready. The logic to do +so is incorrect, as it causes the descriptors for all channels but the +last one in a group to not being pushed to the hardware. Fix it. + +Signed-off-by: Laurent Pinchart +Link: https://lore.kernel.org/r/20210307040629.29308-2-laurent.pinchart@ideasonboard.com +Signed-off-by: Vinod Koul +Signed-off-by: Sasha Levin +--- + drivers/dma/xilinx/xilinx_dpdma.c | 28 +++++++++++++++++----------- + 1 file changed, 17 insertions(+), 11 deletions(-) + +diff --git a/drivers/dma/xilinx/xilinx_dpdma.c b/drivers/dma/xilinx/xilinx_dpdma.c +index 55df63dead8d..d504112c609e 100644 +--- a/drivers/dma/xilinx/xilinx_dpdma.c ++++ b/drivers/dma/xilinx/xilinx_dpdma.c +@@ -839,6 +839,7 @@ static void xilinx_dpdma_chan_queue_transfer(struct xilinx_dpdma_chan *chan) + struct xilinx_dpdma_tx_desc *desc; + struct virt_dma_desc *vdesc; + u32 reg, channels; ++ bool first_frame; + + lockdep_assert_held(&chan->lock); + +@@ -852,14 +853,6 @@ static void xilinx_dpdma_chan_queue_transfer(struct xilinx_dpdma_chan *chan) + chan->running = true; + } + +- if (chan->video_group) +- channels = xilinx_dpdma_chan_video_group_ready(chan); +- else +- channels = BIT(chan->id); +- +- if (!channels) +- return; +- + vdesc = vchan_next_desc(&chan->vchan); + if (!vdesc) + return; +@@ -884,13 +877,26 @@ static void xilinx_dpdma_chan_queue_transfer(struct xilinx_dpdma_chan *chan) + FIELD_PREP(XILINX_DPDMA_CH_DESC_START_ADDRE_MASK, + upper_32_bits(sw_desc->dma_addr))); + +- if (chan->first_frame) ++ first_frame = chan->first_frame; ++ chan->first_frame = false; ++ ++ if (chan->video_group) { ++ channels = xilinx_dpdma_chan_video_group_ready(chan); ++ /* ++ * Trigger the transfer only when all channels in the group are ++ * ready. ++ */ ++ if (!channels) ++ return; ++ } else { ++ channels = BIT(chan->id); ++ } ++ ++ if (first_frame) + reg = XILINX_DPDMA_GBL_TRIG_MASK(channels); + else + reg = XILINX_DPDMA_GBL_RETRIG_MASK(channels); + +- chan->first_frame = false; +- + dpdma_write(xdev->reg, XILINX_DPDMA_GBL, reg); + } + +-- +2.30.2 + diff --git a/queue-5.11/dmaengine-xilinx-dpdma-fix-race-condition-in-done-ir.patch b/queue-5.11/dmaengine-xilinx-dpdma-fix-race-condition-in-done-ir.patch new file mode 100644 index 00000000000..a5bb2d79d25 --- /dev/null +++ b/queue-5.11/dmaengine-xilinx-dpdma-fix-race-condition-in-done-ir.patch @@ -0,0 +1,44 @@ +From 0968bb11b2ecfea18c4c167840533af7a3483f4f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 7 Mar 2021 06:06:29 +0200 +Subject: dmaengine: xilinx: dpdma: Fix race condition in done IRQ + +From: Laurent Pinchart + +[ Upstream commit 868833fbffbe51c487df4f95d4de9194264a4b30 ] + +The active descriptor pointer is accessed from different contexts, +including different interrupt handlers, and its access must be protected +by the channel's lock. This wasn't done in the done IRQ handler. Fix it. + +Signed-off-by: Laurent Pinchart +Link: https://lore.kernel.org/r/20210307040629.29308-3-laurent.pinchart@ideasonboard.com +Signed-off-by: Vinod Koul +Signed-off-by: Sasha Levin +--- + drivers/dma/xilinx/xilinx_dpdma.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/dma/xilinx/xilinx_dpdma.c b/drivers/dma/xilinx/xilinx_dpdma.c +index d504112c609e..70b29bd079c9 100644 +--- a/drivers/dma/xilinx/xilinx_dpdma.c ++++ b/drivers/dma/xilinx/xilinx_dpdma.c +@@ -1048,13 +1048,14 @@ static int xilinx_dpdma_chan_stop(struct xilinx_dpdma_chan *chan) + */ + static void xilinx_dpdma_chan_done_irq(struct xilinx_dpdma_chan *chan) + { +- struct xilinx_dpdma_tx_desc *active = chan->desc.active; ++ struct xilinx_dpdma_tx_desc *active; + unsigned long flags; + + spin_lock_irqsave(&chan->lock, flags); + + xilinx_dpdma_debugfs_desc_done_irq(chan); + ++ active = chan->desc.active; + if (active) + vchan_cyclic_callback(&active->vdesc); + else +-- +2.30.2 + diff --git a/queue-5.11/hid-alps-fix-error-return-code-in-alps_input_configu.patch b/queue-5.11/hid-alps-fix-error-return-code-in-alps_input_configu.patch new file mode 100644 index 00000000000..e0410d52080 --- /dev/null +++ b/queue-5.11/hid-alps-fix-error-return-code-in-alps_input_configu.patch @@ -0,0 +1,35 @@ +From fd1719f54d048d3b8facc707c6b75e2167ba5556 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 4 Mar 2021 05:19:57 -0800 +Subject: HID: alps: fix error return code in alps_input_configured() + +From: Jia-Ju Bai + +[ Upstream commit fa8ba6e5dc0e78e409e503ddcfceef5dd96527f4 ] + +When input_register_device() fails, no error return code is assigned. +To fix this bug, ret is assigned with -ENOENT as error return code. + +Reported-by: TOTE Robot +Signed-off-by: Jia-Ju Bai +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/hid-alps.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/hid/hid-alps.c b/drivers/hid/hid-alps.c +index 3feaece13ade..6b665931147d 100644 +--- a/drivers/hid/hid-alps.c ++++ b/drivers/hid/hid-alps.c +@@ -761,6 +761,7 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi) + + if (input_register_device(data->input2)) { + input_free_device(input2); ++ ret = -ENOENT; + goto exit; + } + } +-- +2.30.2 + diff --git a/queue-5.11/hid-asus-add-support-for-2021-asus-n-key-keyboard.patch b/queue-5.11/hid-asus-add-support-for-2021-asus-n-key-keyboard.patch new file mode 100644 index 00000000000..7419b4c0b3c --- /dev/null +++ b/queue-5.11/hid-asus-add-support-for-2021-asus-n-key-keyboard.patch @@ -0,0 +1,50 @@ +From 344a6bf2422c58b4c1a50da54a021756bd17c195 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 19 Feb 2021 10:10:02 +1300 +Subject: HID: asus: Add support for 2021 ASUS N-Key keyboard + +From: Luke D Jones + +[ Upstream commit 9a0b44fbfea1932196a4879b44a37dd182e984c5 ] + +Some new 2021 version of ASUS gamer laptops are using an updated +N-Key keyboard with the PID of 0x19b6. This version is using the +same init sequence and brightness control as the 0x1866 keyboard. + +Signed-off-by: Luke D Jones +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/hid-asus.c | 3 +++ + drivers/hid/hid-ids.h | 1 + + 2 files changed, 4 insertions(+) + +diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c +index 1dfe184ebf5a..2ab22b925941 100644 +--- a/drivers/hid/hid-asus.c ++++ b/drivers/hid/hid-asus.c +@@ -1221,6 +1221,9 @@ static const struct hid_device_id asus_devices[] = { + { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, + USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD), + QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, ++ USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2), ++ QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD }, + { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, + USB_DEVICE_ID_ASUSTEK_T100TA_KEYBOARD), + QUIRK_T100_KEYBOARD | QUIRK_NO_CONSUMER_USAGES }, +diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h +index 570bd0103a86..09d049986516 100644 +--- a/drivers/hid/hid-ids.h ++++ b/drivers/hid/hid-ids.h +@@ -191,6 +191,7 @@ + #define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD2 0x1837 + #define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD3 0x1822 + #define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD 0x1866 ++#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2 0x19b6 + #define USB_DEVICE_ID_ASUSTEK_FX503VD_KEYBOARD 0x1869 + + #define USB_VENDOR_ID_ATEN 0x0557 +-- +2.30.2 + diff --git a/queue-5.11/hid-cp2112-fix-support-for-multiple-gpiochips.patch b/queue-5.11/hid-cp2112-fix-support-for-multiple-gpiochips.patch new file mode 100644 index 00000000000..6e31fff191e --- /dev/null +++ b/queue-5.11/hid-cp2112-fix-support-for-multiple-gpiochips.patch @@ -0,0 +1,77 @@ +From eb47d49f141db423dfb674f3fcdb4226a013e600 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 9 Jan 2021 17:36:58 -0500 +Subject: HID cp2112: fix support for multiple gpiochips + +From: Douglas Gilbert + +[ Upstream commit 2a2b09c867fdac63f430a45051e7bd0c46edc381 ] + +In lk 5.11.0-rc2 connecting a USB based Silicon Labs HID to I2C +bridge evaluation board (CP2112EK) causes this warning: + gpio gpiochip0: (cp2112_gpio): detected irqchip that is shared + with multiple gpiochips: please fix the driver + +Simply copy what other gpio related drivers do to fix this +particular warning: replicate the struct irq_chip object in each +device instance rather than have a static object which makes that +object (incorrectly) shared by each device. + +Signed-off-by: Douglas Gilbert +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/hid-cp2112.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c +index 21e15627a461..477baa30889c 100644 +--- a/drivers/hid/hid-cp2112.c ++++ b/drivers/hid/hid-cp2112.c +@@ -161,6 +161,7 @@ struct cp2112_device { + atomic_t read_avail; + atomic_t xfer_avail; + struct gpio_chip gc; ++ struct irq_chip irq; + u8 *in_out_buffer; + struct mutex lock; + +@@ -1175,16 +1176,6 @@ static int cp2112_gpio_irq_type(struct irq_data *d, unsigned int type) + return 0; + } + +-static struct irq_chip cp2112_gpio_irqchip = { +- .name = "cp2112-gpio", +- .irq_startup = cp2112_gpio_irq_startup, +- .irq_shutdown = cp2112_gpio_irq_shutdown, +- .irq_ack = cp2112_gpio_irq_ack, +- .irq_mask = cp2112_gpio_irq_mask, +- .irq_unmask = cp2112_gpio_irq_unmask, +- .irq_set_type = cp2112_gpio_irq_type, +-}; +- + static int __maybe_unused cp2112_allocate_irq(struct cp2112_device *dev, + int pin) + { +@@ -1339,8 +1330,17 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id) + dev->gc.can_sleep = 1; + dev->gc.parent = &hdev->dev; + ++ dev->irq.name = "cp2112-gpio"; ++ dev->irq.irq_startup = cp2112_gpio_irq_startup; ++ dev->irq.irq_shutdown = cp2112_gpio_irq_shutdown; ++ dev->irq.irq_ack = cp2112_gpio_irq_ack; ++ dev->irq.irq_mask = cp2112_gpio_irq_mask; ++ dev->irq.irq_unmask = cp2112_gpio_irq_unmask; ++ dev->irq.irq_set_type = cp2112_gpio_irq_type; ++ dev->irq.flags = IRQCHIP_MASK_ON_SUSPEND; ++ + girq = &dev->gc.irq; +- girq->chip = &cp2112_gpio_irqchip; ++ girq->chip = &dev->irq; + /* The event comes from the outside so no parent handler */ + girq->parent_handler = NULL; + girq->num_parents = 0; +-- +2.30.2 + diff --git a/queue-5.11/hid-google-add-don-usb-id.patch b/queue-5.11/hid-google-add-don-usb-id.patch new file mode 100644 index 00000000000..8029e3e5efb --- /dev/null +++ b/queue-5.11/hid-google-add-don-usb-id.patch @@ -0,0 +1,47 @@ +From 8f5e8f23d32d7e346747dd18b9bdd4c132919221 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 2 Mar 2021 11:58:01 +0800 +Subject: HID: google: add don USB id + +From: Shou-Chieh Hsu + +[ Upstream commit 36b87cf302a4f13f8b4344bcf98f67405a145e2f ] + +Add 1 additional hammer-like device. + +Signed-off-by: Shou-Chieh Hsu +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/hid-google-hammer.c | 2 ++ + drivers/hid/hid-ids.h | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/drivers/hid/hid-google-hammer.c b/drivers/hid/hid-google-hammer.c +index 85a054f1ce38..2a176f77b32e 100644 +--- a/drivers/hid/hid-google-hammer.c ++++ b/drivers/hid/hid-google-hammer.c +@@ -526,6 +526,8 @@ static void hammer_remove(struct hid_device *hdev) + } + + static const struct hid_device_id hammer_devices[] = { ++ { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, ++ USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_DON) }, + { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, + USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_HAMMER) }, + { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, +diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h +index b60279aaed43..570bd0103a86 100644 +--- a/drivers/hid/hid-ids.h ++++ b/drivers/hid/hid-ids.h +@@ -488,6 +488,7 @@ + #define USB_DEVICE_ID_GOOGLE_MASTERBALL 0x503c + #define USB_DEVICE_ID_GOOGLE_MAGNEMITE 0x503d + #define USB_DEVICE_ID_GOOGLE_MOONBALL 0x5044 ++#define USB_DEVICE_ID_GOOGLE_DON 0x5050 + + #define USB_VENDOR_ID_GOTOP 0x08f2 + #define USB_DEVICE_ID_SUPER_Q2 0x007f +-- +2.30.2 + diff --git a/queue-5.11/hid-wacom-assign-boolean-values-to-a-bool-variable.patch b/queue-5.11/hid-wacom-assign-boolean-values-to-a-bool-variable.patch new file mode 100644 index 00000000000..e0b90f468a5 --- /dev/null +++ b/queue-5.11/hid-wacom-assign-boolean-values-to-a-bool-variable.patch @@ -0,0 +1,38 @@ +From 5ca3b0a87c00baa4f1f35329e676036e937b4b92 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 20 Jan 2021 15:34:30 +0800 +Subject: HID: wacom: Assign boolean values to a bool variable + +From: Jiapeng Zhong + +[ Upstream commit e29c62ffb008829dc8bcc0a2ec438adc25a8255e ] + +Fix the following coccicheck warnings: + +./drivers/hid/wacom_wac.c:2536:2-6: WARNING: Assignment of +0/1 to bool variable. + +Reported-by: Abaci Robot +Signed-off-by: Jiapeng Zhong +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/wacom_wac.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c +index 6cda5935fc09..2d70dc4bea65 100644 +--- a/drivers/hid/wacom_wac.c ++++ b/drivers/hid/wacom_wac.c +@@ -2533,7 +2533,7 @@ static void wacom_wac_finger_slot(struct wacom_wac *wacom_wac, + !wacom_wac->shared->is_touch_on) { + if (!wacom_wac->shared->touch_down) + return; +- prox = 0; ++ prox = false; + } + + wacom_wac->hid_data.num_received++; +-- +2.30.2 + diff --git a/queue-5.11/ia64-fix-discontig.c-section-mismatches.patch b/queue-5.11/ia64-fix-discontig.c-section-mismatches.patch new file mode 100644 index 00000000000..4a1cab3411e --- /dev/null +++ b/queue-5.11/ia64-fix-discontig.c-section-mismatches.patch @@ -0,0 +1,73 @@ +From f4ac0876a283d792ca25f3deb8487b2387155b47 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 16 Apr 2021 15:46:09 -0700 +Subject: ia64: fix discontig.c section mismatches + +From: Randy Dunlap + +[ Upstream commit e2af9da4f867a1a54f1252bf3abc1a5c63951778 ] + +Fix IA64 discontig.c Section mismatch warnings. + +When CONFIG_SPARSEMEM=y and CONFIG_MEMORY_HOTPLUG=y, the functions +computer_pernodesize() and scatter_node_data() should not be marked as +__meminit because they are needed after init, on any memory hotplug +event. Also, early_nr_cpus_node() is called by compute_pernodesize(), +so early_nr_cpus_node() cannot be __meminit either. + + WARNING: modpost: vmlinux.o(.text.unlikely+0x1612): Section mismatch in reference from the function arch_alloc_nodedata() to the function .meminit.text:compute_pernodesize() + The function arch_alloc_nodedata() references the function __meminit compute_pernodesize(). + This is often because arch_alloc_nodedata lacks a __meminit annotation or the annotation of compute_pernodesize is wrong. + + WARNING: modpost: vmlinux.o(.text.unlikely+0x1692): Section mismatch in reference from the function arch_refresh_nodedata() to the function .meminit.text:scatter_node_data() + The function arch_refresh_nodedata() references the function __meminit scatter_node_data(). + This is often because arch_refresh_nodedata lacks a __meminit annotation or the annotation of scatter_node_data is wrong. + + WARNING: modpost: vmlinux.o(.text.unlikely+0x1502): Section mismatch in reference from the function compute_pernodesize() to the function .meminit.text:early_nr_cpus_node() + The function compute_pernodesize() references the function __meminit early_nr_cpus_node(). + This is often because compute_pernodesize lacks a __meminit annotation or the annotation of early_nr_cpus_node is wrong. + +Link: https://lkml.kernel.org/r/20210411001201.3069-1-rdunlap@infradead.org +Signed-off-by: Randy Dunlap +Cc: Mike Rapoport +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + arch/ia64/mm/discontig.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c +index c7311131156e..ba3edb8a04b1 100644 +--- a/arch/ia64/mm/discontig.c ++++ b/arch/ia64/mm/discontig.c +@@ -94,7 +94,7 @@ static int __init build_node_maps(unsigned long start, unsigned long len, + * acpi_boot_init() (which builds the node_to_cpu_mask array) hasn't been + * called yet. Note that node 0 will also count all non-existent cpus. + */ +-static int __meminit early_nr_cpus_node(int node) ++static int early_nr_cpus_node(int node) + { + int cpu, n = 0; + +@@ -109,7 +109,7 @@ static int __meminit early_nr_cpus_node(int node) + * compute_pernodesize - compute size of pernode data + * @node: the node id. + */ +-static unsigned long __meminit compute_pernodesize(int node) ++static unsigned long compute_pernodesize(int node) + { + unsigned long pernodesize = 0, cpus; + +@@ -366,7 +366,7 @@ static void __init reserve_pernode_space(void) + } + } + +-static void __meminit scatter_node_data(void) ++static void scatter_node_data(void) + { + pg_data_t **dst; + int node; +-- +2.30.2 + diff --git a/queue-5.11/ia64-tools-remove-duplicate-definition-of-ia64_mf-on.patch b/queue-5.11/ia64-tools-remove-duplicate-definition-of-ia64_mf-on.patch new file mode 100644 index 00000000000..80e70ae3fa7 --- /dev/null +++ b/queue-5.11/ia64-tools-remove-duplicate-definition-of-ia64_mf-on.patch @@ -0,0 +1,59 @@ +From ea77b9215c3f470b58407b8d2338ac493ea9613a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 16 Apr 2021 15:46:15 -0700 +Subject: ia64: tools: remove duplicate definition of ia64_mf() on ia64 + +From: John Paul Adrian Glaubitz + +[ Upstream commit f4bf09dc3aaa4b07cd15630f2023f68cb2668809 ] + +The ia64_mf() macro defined in tools/arch/ia64/include/asm/barrier.h is +already defined in on ia64 which causes libbpf +failing to build: + + CC /usr/src/linux/tools/bpf/bpftool//libbpf/staticobjs/libbpf.o + In file included from /usr/src/linux/tools/include/asm/barrier.h:24, + from /usr/src/linux/tools/include/linux/ring_buffer.h:4, + from libbpf.c:37: + /usr/src/linux/tools/include/asm/../../arch/ia64/include/asm/barrier.h:43: error: "ia64_mf" redefined [-Werror] + 43 | #define ia64_mf() asm volatile ("mf" ::: "memory") + | + In file included from /usr/include/ia64-linux-gnu/asm/intrinsics.h:20, + from /usr/include/ia64-linux-gnu/asm/swab.h:11, + from /usr/include/linux/swab.h:8, + from /usr/include/linux/byteorder/little_endian.h:13, + from /usr/include/ia64-linux-gnu/asm/byteorder.h:5, + from /usr/src/linux/tools/include/uapi/linux/perf_event.h:20, + from libbpf.c:36: + /usr/include/ia64-linux-gnu/asm/gcc_intrin.h:382: note: this is the location of the previous definition + 382 | #define ia64_mf() __asm__ volatile ("mf" ::: "memory") + | + cc1: all warnings being treated as errors + +Thus, remove the definition from tools/arch/ia64/include/asm/barrier.h. + +Signed-off-by: John Paul Adrian Glaubitz +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + tools/arch/ia64/include/asm/barrier.h | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/tools/arch/ia64/include/asm/barrier.h b/tools/arch/ia64/include/asm/barrier.h +index 4d471d9511a5..6fffe5682713 100644 +--- a/tools/arch/ia64/include/asm/barrier.h ++++ b/tools/arch/ia64/include/asm/barrier.h +@@ -39,9 +39,6 @@ + * sequential memory pages only. + */ + +-/* XXX From arch/ia64/include/uapi/asm/gcc_intrin.h */ +-#define ia64_mf() asm volatile ("mf" ::: "memory") +- + #define mb() ia64_mf() + #define rmb() mb() + #define wmb() mb() +-- +2.30.2 + diff --git a/queue-5.11/locking-qrwlock-fix-ordering-in-queued_write_lock_sl.patch b/queue-5.11/locking-qrwlock-fix-ordering-in-queued_write_lock_sl.patch new file mode 100644 index 00000000000..22c17652fab --- /dev/null +++ b/queue-5.11/locking-qrwlock-fix-ordering-in-queued_write_lock_sl.patch @@ -0,0 +1,85 @@ +From b697b00a53c4cb3e2d32ca117167e23915e7552c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 15 Apr 2021 17:27:11 +0000 +Subject: locking/qrwlock: Fix ordering in queued_write_lock_slowpath() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ali Saidi + +[ Upstream commit 84a24bf8c52e66b7ac89ada5e3cfbe72d65c1896 ] + +While this code is executed with the wait_lock held, a reader can +acquire the lock without holding wait_lock. The writer side loops +checking the value with the atomic_cond_read_acquire(), but only truly +acquires the lock when the compare-and-exchange is completed +successfully which isn’t ordered. This exposes the window between the +acquire and the cmpxchg to an A-B-A problem which allows reads +following the lock acquisition to observe values speculatively before +the write lock is truly acquired. + +We've seen a problem in epoll where the reader does a xchg while +holding the read lock, but the writer can see a value change out from +under it. + + Writer | Reader + -------------------------------------------------------------------------------- + ep_scan_ready_list() | + |- write_lock_irq() | + |- queued_write_lock_slowpath() | + |- atomic_cond_read_acquire() | + | read_lock_irqsave(&ep->lock, flags); + --> (observes value before unlock) | chain_epi_lockless() + | | epi->next = xchg(&ep->ovflist, epi); + | | read_unlock_irqrestore(&ep->lock, flags); + | | + | atomic_cmpxchg_relaxed() | + |-- READ_ONCE(ep->ovflist); | + +A core can order the read of the ovflist ahead of the +atomic_cmpxchg_relaxed(). Switching the cmpxchg to use acquire +semantics addresses this issue at which point the atomic_cond_read can +be switched to use relaxed semantics. + +Fixes: b519b56e378ee ("locking/qrwlock: Use atomic_cond_read_acquire() when spinning in qrwlock") +Signed-off-by: Ali Saidi +[peterz: use try_cmpxchg()] +Signed-off-by: Peter Zijlstra (Intel) +Reviewed-by: Steve Capper +Acked-by: Will Deacon +Acked-by: Waiman Long +Tested-by: Steve Capper +Signed-off-by: Sasha Levin +--- + kernel/locking/qrwlock.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/kernel/locking/qrwlock.c b/kernel/locking/qrwlock.c +index fe9ca92faa2a..909b0bf22a1e 100644 +--- a/kernel/locking/qrwlock.c ++++ b/kernel/locking/qrwlock.c +@@ -61,6 +61,8 @@ EXPORT_SYMBOL(queued_read_lock_slowpath); + */ + void queued_write_lock_slowpath(struct qrwlock *lock) + { ++ int cnts; ++ + /* Put the writer into the wait queue */ + arch_spin_lock(&lock->wait_lock); + +@@ -74,9 +76,8 @@ void queued_write_lock_slowpath(struct qrwlock *lock) + + /* When no more readers or writers, set the locked flag */ + do { +- atomic_cond_read_acquire(&lock->cnts, VAL == _QW_WAITING); +- } while (atomic_cmpxchg_relaxed(&lock->cnts, _QW_WAITING, +- _QW_LOCKED) != _QW_WAITING); ++ cnts = atomic_cond_read_relaxed(&lock->cnts, VAL == _QW_WAITING); ++ } while (!atomic_try_cmpxchg_acquire(&lock->cnts, &cnts, _QW_LOCKED)); + unlock: + arch_spin_unlock(&lock->wait_lock); + } +-- +2.30.2 + diff --git a/queue-5.11/m68k-fix-flatmem-memory-model-setup.patch b/queue-5.11/m68k-fix-flatmem-memory-model-setup.patch new file mode 100644 index 00000000000..5e7beba6eec --- /dev/null +++ b/queue-5.11/m68k-fix-flatmem-memory-model-setup.patch @@ -0,0 +1,40 @@ +From 207db0839fb6bd8932d1f0a07b31d8674f34c1bf Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 28 Feb 2021 20:08:28 +0100 +Subject: m68k: fix flatmem memory model setup + +From: Angelo Dureghello + +[ Upstream commit d2bd44c4c05d043fb65cfdf26c54e6d8b94a4b41 ] + +Detected a broken boot on mcf54415, likely introduced from + +commit 4bfc848e0981 +("m68k/mm: enable use of generic memory_model.h for !DISCONTIGMEM") + +Fix ARCH_PFN_OFFSET to be a pfn. + +Signed-off-by: Angelo Dureghello +Acked-by: Mike Rapoport +Signed-off-by: Greg Ungerer +Signed-off-by: Sasha Levin +--- + arch/m68k/include/asm/page_mm.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/m68k/include/asm/page_mm.h b/arch/m68k/include/asm/page_mm.h +index 7f5912af2a52..21b1071e0a34 100644 +--- a/arch/m68k/include/asm/page_mm.h ++++ b/arch/m68k/include/asm/page_mm.h +@@ -167,7 +167,7 @@ static inline __attribute_const__ int __virt_to_node_shift(void) + ((__p) - pgdat->node_mem_map) + pgdat->node_start_pfn; \ + }) + #else +-#define ARCH_PFN_OFFSET (m68k_memory[0].addr) ++#define ARCH_PFN_OFFSET (m68k_memory[0].addr >> PAGE_SHIFT) + #include + #endif + +-- +2.30.2 + diff --git a/queue-5.11/net-geneve-check-skb-is-large-enough-for-ipv4-ipv6-h.patch b/queue-5.11/net-geneve-check-skb-is-large-enough-for-ipv4-ipv6-h.patch new file mode 100644 index 00000000000..0995ffaeff1 --- /dev/null +++ b/queue-5.11/net-geneve-check-skb-is-large-enough-for-ipv4-ipv6-h.patch @@ -0,0 +1,52 @@ +From 5686bec9392b153cb0ebf7847945de13bfe64bcd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 11 Apr 2021 12:28:24 +0100 +Subject: net: geneve: check skb is large enough for IPv4/IPv6 header + +From: Phillip Potter + +[ Upstream commit 6628ddfec7580882f11fdc5c194a8ea781fdadfa ] + +Check within geneve_xmit_skb/geneve6_xmit_skb that sk_buff structure +is large enough to include IPv4 or IPv6 header, and reject if not. The +geneve_xmit_skb portion and overall idea was contributed by Eric Dumazet. +Fixes a KMSAN-found uninit-value bug reported by syzbot at: +https://syzkaller.appspot.com/bug?id=abe95dc3e3e9667fc23b8d81f29ecad95c6f106f + +Suggested-by: Eric Dumazet +Reported-by: syzbot+2e406a9ac75bb71d4b7a@syzkaller.appspotmail.com +Signed-off-by: Phillip Potter +Signed-off-by: Eric Dumazet +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/geneve.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c +index f35b0b83fe85..040edc6fc560 100644 +--- a/drivers/net/geneve.c ++++ b/drivers/net/geneve.c +@@ -891,6 +891,9 @@ static int geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev, + __be16 sport; + int err; + ++ if (!pskb_network_may_pull(skb, sizeof(struct iphdr))) ++ return -EINVAL; ++ + sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true); + rt = geneve_get_v4_rt(skb, dev, gs4, &fl4, info, + geneve->cfg.info.key.tp_dst, sport); +@@ -985,6 +988,9 @@ static int geneve6_xmit_skb(struct sk_buff *skb, struct net_device *dev, + __be16 sport; + int err; + ++ if (!pskb_network_may_pull(skb, sizeof(struct ipv6hdr))) ++ return -EINVAL; ++ + sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true); + dst = geneve_get_v6_dst(skb, dev, gs6, &fl6, info, + geneve->cfg.info.key.tp_dst, sport); +-- +2.30.2 + diff --git a/queue-5.11/perf-auxtrace-fix-potential-null-pointer-dereference.patch b/queue-5.11/perf-auxtrace-fix-potential-null-pointer-dereference.patch new file mode 100644 index 00000000000..ff4aefa6d99 --- /dev/null +++ b/queue-5.11/perf-auxtrace-fix-potential-null-pointer-dereference.patch @@ -0,0 +1,52 @@ +From b70e922fad65e307fadeae581e0f6fef6c22c3a5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 20 Apr 2021 23:15:53 +0800 +Subject: perf auxtrace: Fix potential NULL pointer dereference + +From: Leo Yan + +[ Upstream commit b14585d9f18dc617e975815570fe836be656b1da ] + +In the function auxtrace_parse_snapshot_options(), the callback pointer +"itr->parse_snapshot_options" can be NULL if it has not been set during +the AUX record initialization. This can cause tool crashing if the +callback pointer "itr->parse_snapshot_options" is dereferenced without +performing NULL check. + +Add a NULL check for the pointer "itr->parse_snapshot_options" before +invoke the callback. + +Fixes: d20031bb63dd6dde ("perf tools: Add AUX area tracing Snapshot Mode") +Signed-off-by: Leo Yan +Acked-by: Adrian Hunter +Cc: Adrian Hunter +Cc: Alexander Shishkin +Cc: Andi Kleen +Cc: Jiri Olsa +Cc: Mark Rutland +Cc: Namhyung Kim +Cc: Peter Zijlstra +Cc: Tiezhu Yang +Link: http://lore.kernel.org/lkml/20210420151554.2031768-1-leo.yan@linaro.org +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Sasha Levin +--- + tools/perf/util/auxtrace.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c +index 2723082f3817..e7a071a15470 100644 +--- a/tools/perf/util/auxtrace.c ++++ b/tools/perf/util/auxtrace.c +@@ -634,7 +634,7 @@ int auxtrace_parse_snapshot_options(struct auxtrace_record *itr, + break; + } + +- if (itr) ++ if (itr && itr->parse_snapshot_options) + return itr->parse_snapshot_options(itr, opts, str); + + pr_err("No AUX area tracing to snapshot\n"); +-- +2.30.2 + diff --git a/queue-5.11/perf-map-fix-error-return-code-in-maps__clone.patch b/queue-5.11/perf-map-fix-error-return-code-in-maps__clone.patch new file mode 100644 index 00000000000..76571d098b1 --- /dev/null +++ b/queue-5.11/perf-map-fix-error-return-code-in-maps__clone.patch @@ -0,0 +1,57 @@ +From 4721613afa37f42cafb81c530ffacdd69262d9a3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 15 Apr 2021 17:27:44 +0800 +Subject: perf map: Fix error return code in maps__clone() + +From: Zhen Lei + +[ Upstream commit c6f87141254d16e281e4b4431af7316895207b8f ] + +Although 'err' has been initialized to -ENOMEM, but it will be reassigned +by the "err = unwind__prepare_access(...)" statement in the for loop. So +that, the value of 'err' is unknown when map__clone() failed. + +Fixes: 6c502584438bda63 ("perf unwind: Call unwind__prepare_access for forked thread") +Reported-by: Hulk Robot +Signed-off-by: Zhen Lei +Cc: Alexander Shishkin +Cc: Jiri Olsa +Cc: Mark Rutland +Cc: Namhyung Kim +Cc: Peter Zijlstra +Cc: zhen lei +Link: http://lore.kernel.org/lkml/20210415092744.3793-1-thunder.leizhen@huawei.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Sasha Levin +--- + tools/perf/util/map.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c +index e2537d5acab0..f4d44f75ba15 100644 +--- a/tools/perf/util/map.c ++++ b/tools/perf/util/map.c +@@ -836,15 +836,18 @@ out: + int maps__clone(struct thread *thread, struct maps *parent) + { + struct maps *maps = thread->maps; +- int err = -ENOMEM; ++ int err; + struct map *map; + + down_read(&parent->lock); + + maps__for_each_entry(parent, map) { + struct map *new = map__clone(map); +- if (new == NULL) ++ ++ if (new == NULL) { ++ err = -ENOMEM; + goto out_unlock; ++ } + + err = unwind__prepare_access(maps, new, NULL); + if (err) +-- +2.30.2 + diff --git a/queue-5.11/perf-x86-intel-uncore-remove-uncore-extra-pci-dev-hs.patch b/queue-5.11/perf-x86-intel-uncore-remove-uncore-extra-pci-dev-hs.patch new file mode 100644 index 00000000000..a86a5922e27 --- /dev/null +++ b/queue-5.11/perf-x86-intel-uncore-remove-uncore-extra-pci-dev-hs.patch @@ -0,0 +1,159 @@ +From f92221deb55d9ef8626baecd6541b020397c1b02 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 15 Apr 2021 14:22:43 -0700 +Subject: perf/x86/intel/uncore: Remove uncore extra PCI dev HSWEP_PCI_PCU_3 + +From: Kan Liang + +[ Upstream commit 9d480158ee86ad606d3a8baaf81e6b71acbfd7d5 ] + +There may be a kernel panic on the Haswell server and the Broadwell +server, if the snbep_pci2phy_map_init() return error. + +The uncore_extra_pci_dev[HSWEP_PCI_PCU_3] is used in the cpu_init() to +detect the existence of the SBOX, which is a MSR type of PMON unit. +The uncore_extra_pci_dev is allocated in the uncore_pci_init(). If the +snbep_pci2phy_map_init() returns error, perf doesn't initialize the +PCI type of the PMON units, so the uncore_extra_pci_dev will not be +allocated. But perf may continue initializing the MSR type of PMON +units. A null dereference kernel panic will be triggered. + +The sockets in a Haswell server or a Broadwell server are identical. +Only need to detect the existence of the SBOX once. +Current perf probes all available PCU devices and stores them into the +uncore_extra_pci_dev. It's unnecessary. +Use the pci_get_device() to replace the uncore_extra_pci_dev. Only +detect the existence of the SBOX on the first available PCU device once. + +Factor out hswep_has_limit_sbox(), since the Haswell server and the +Broadwell server uses the same way to detect the existence of the SBOX. + +Add some macros to replace the magic number. + +Fixes: 5306c31c5733 ("perf/x86/uncore/hsw-ep: Handle systems with only two SBOXes") +Reported-by: Steve Wahl +Signed-off-by: Kan Liang +Signed-off-by: Peter Zijlstra (Intel) +Tested-by: Steve Wahl +Link: https://lkml.kernel.org/r/1618521764-100923-1-git-send-email-kan.liang@linux.intel.com +Signed-off-by: Sasha Levin +--- + arch/x86/events/intel/uncore_snbep.c | 61 ++++++++++++---------------- + 1 file changed, 26 insertions(+), 35 deletions(-) + +diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c +index 7bdb1821215d..3112186a4f4b 100644 +--- a/arch/x86/events/intel/uncore_snbep.c ++++ b/arch/x86/events/intel/uncore_snbep.c +@@ -1159,7 +1159,6 @@ enum { + SNBEP_PCI_QPI_PORT0_FILTER, + SNBEP_PCI_QPI_PORT1_FILTER, + BDX_PCI_QPI_PORT2_FILTER, +- HSWEP_PCI_PCU_3, + }; + + static int snbep_qpi_hw_config(struct intel_uncore_box *box, struct perf_event *event) +@@ -2816,22 +2815,33 @@ static struct intel_uncore_type *hswep_msr_uncores[] = { + NULL, + }; + +-void hswep_uncore_cpu_init(void) ++#define HSWEP_PCU_DID 0x2fc0 ++#define HSWEP_PCU_CAPID4_OFFET 0x94 ++#define hswep_get_chop(_cap) (((_cap) >> 6) & 0x3) ++ ++static bool hswep_has_limit_sbox(unsigned int device) + { +- int pkg = boot_cpu_data.logical_proc_id; ++ struct pci_dev *dev = pci_get_device(PCI_VENDOR_ID_INTEL, device, NULL); ++ u32 capid4; ++ ++ if (!dev) ++ return false; ++ ++ pci_read_config_dword(dev, HSWEP_PCU_CAPID4_OFFET, &capid4); ++ if (!hswep_get_chop(capid4)) ++ return true; + ++ return false; ++} ++ ++void hswep_uncore_cpu_init(void) ++{ + if (hswep_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores) + hswep_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores; + + /* Detect 6-8 core systems with only two SBOXes */ +- if (uncore_extra_pci_dev[pkg].dev[HSWEP_PCI_PCU_3]) { +- u32 capid4; +- +- pci_read_config_dword(uncore_extra_pci_dev[pkg].dev[HSWEP_PCI_PCU_3], +- 0x94, &capid4); +- if (((capid4 >> 6) & 0x3) == 0) +- hswep_uncore_sbox.num_boxes = 2; +- } ++ if (hswep_has_limit_sbox(HSWEP_PCU_DID)) ++ hswep_uncore_sbox.num_boxes = 2; + + uncore_msr_uncores = hswep_msr_uncores; + } +@@ -3094,11 +3104,6 @@ static const struct pci_device_id hswep_uncore_pci_ids[] = { + .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV, + SNBEP_PCI_QPI_PORT1_FILTER), + }, +- { /* PCU.3 (for Capability registers) */ +- PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x2fc0), +- .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV, +- HSWEP_PCI_PCU_3), +- }, + { /* end: all zeroes */ } + }; + +@@ -3190,27 +3195,18 @@ static struct event_constraint bdx_uncore_pcu_constraints[] = { + EVENT_CONSTRAINT_END + }; + ++#define BDX_PCU_DID 0x6fc0 ++ + void bdx_uncore_cpu_init(void) + { +- int pkg = topology_phys_to_logical_pkg(boot_cpu_data.phys_proc_id); +- + if (bdx_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores) + bdx_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores; + uncore_msr_uncores = bdx_msr_uncores; + +- /* BDX-DE doesn't have SBOX */ +- if (boot_cpu_data.x86_model == 86) { +- uncore_msr_uncores[BDX_MSR_UNCORE_SBOX] = NULL; + /* Detect systems with no SBOXes */ +- } else if (uncore_extra_pci_dev[pkg].dev[HSWEP_PCI_PCU_3]) { +- struct pci_dev *pdev; +- u32 capid4; +- +- pdev = uncore_extra_pci_dev[pkg].dev[HSWEP_PCI_PCU_3]; +- pci_read_config_dword(pdev, 0x94, &capid4); +- if (((capid4 >> 6) & 0x3) == 0) +- bdx_msr_uncores[BDX_MSR_UNCORE_SBOX] = NULL; +- } ++ if ((boot_cpu_data.x86_model == 86) || hswep_has_limit_sbox(BDX_PCU_DID)) ++ uncore_msr_uncores[BDX_MSR_UNCORE_SBOX] = NULL; ++ + hswep_uncore_pcu.constraints = bdx_uncore_pcu_constraints; + } + +@@ -3431,11 +3427,6 @@ static const struct pci_device_id bdx_uncore_pci_ids[] = { + .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV, + BDX_PCI_QPI_PORT2_FILTER), + }, +- { /* PCU.3 (for Capability registers) */ +- PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6fc0), +- .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV, +- HSWEP_PCI_PCU_3), +- }, + { /* end: all zeroes */ } + }; + +-- +2.30.2 + diff --git a/queue-5.11/perf-x86-kvm-fix-broadwell-xeon-stepping-in-isolatio.patch b/queue-5.11/perf-x86-kvm-fix-broadwell-xeon-stepping-in-isolatio.patch new file mode 100644 index 00000000000..110ccdffc0e --- /dev/null +++ b/queue-5.11/perf-x86-kvm-fix-broadwell-xeon-stepping-in-isolatio.patch @@ -0,0 +1,50 @@ +From 320b04a3d7292be2fbfe9865089c9a84261bee92 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 21 Apr 2021 17:18:34 -0700 +Subject: perf/x86/kvm: Fix Broadwell Xeon stepping in isolation_ucodes[] + +From: Jim Mattson + +[ Upstream commit 4b2f1e59229b9da319d358828cdfa4ddbc140769 ] + +The only stepping of Broadwell Xeon parts is stepping 1. Fix the +relevant isolation_ucodes[] entry, which previously enumerated +stepping 2. + +Although the original commit was characterized as an optimization, it +is also a workaround for a correctness issue. + +If a PMI arrives between kvm's call to perf_guest_get_msrs() and the +subsequent VM-entry, a stale value for the IA32_PEBS_ENABLE MSR may be +restored at the next VM-exit. This is because, unbeknownst to kvm, PMI +throttling may clear bits in the IA32_PEBS_ENABLE MSR. CPUs with "PEBS +isolation" don't suffer from this issue, because perf_guest_get_msrs() +doesn't report the IA32_PEBS_ENABLE value. + +Fixes: 9b545c04abd4f ("perf/x86/kvm: Avoid unnecessary work in guest filtering") +Signed-off-by: Jim Mattson +Signed-off-by: Peter Zijlstra (Intel) +Reviewed-by: Peter Shier +Acked-by: Andi Kleen +Link: https://lkml.kernel.org/r/20210422001834.1748319-1-jmattson@google.com +Signed-off-by: Sasha Levin +--- + arch/x86/events/intel/core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c +index bfd42e0853ed..6c88f245b33a 100644 +--- a/arch/x86/events/intel/core.c ++++ b/arch/x86/events/intel/core.c +@@ -4400,7 +4400,7 @@ static const struct x86_cpu_desc isolation_ucodes[] = { + INTEL_CPU_DESC(INTEL_FAM6_BROADWELL_D, 3, 0x07000009), + INTEL_CPU_DESC(INTEL_FAM6_BROADWELL_D, 4, 0x0f000009), + INTEL_CPU_DESC(INTEL_FAM6_BROADWELL_D, 5, 0x0e000002), +- INTEL_CPU_DESC(INTEL_FAM6_BROADWELL_X, 2, 0x0b000014), ++ INTEL_CPU_DESC(INTEL_FAM6_BROADWELL_X, 1, 0x0b000014), + INTEL_CPU_DESC(INTEL_FAM6_SKYLAKE_X, 3, 0x00000021), + INTEL_CPU_DESC(INTEL_FAM6_SKYLAKE_X, 4, 0x00000000), + INTEL_CPU_DESC(INTEL_FAM6_SKYLAKE_X, 5, 0x00000000), +-- +2.30.2 + diff --git a/queue-5.11/s390-entry-save-the-caller-of-psw_idle.patch b/queue-5.11/s390-entry-save-the-caller-of-psw_idle.patch new file mode 100644 index 00000000000..ec4ec1f2358 --- /dev/null +++ b/queue-5.11/s390-entry-save-the-caller-of-psw_idle.patch @@ -0,0 +1,62 @@ +From 6049a46758ea00255284527ddeb7860eceb2700f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 9 Apr 2021 00:15:21 +0200 +Subject: s390/entry: save the caller of psw_idle + +From: Vasily Gorbik + +[ Upstream commit a994eddb947ea9ebb7b14d9a1267001699f0a136 ] + +Currently psw_idle does not allocate a stack frame and does not +save its r14 and r15 into the save area. Even though this is valid from +call ABI point of view, because psw_idle does not make any calls +explicitly, in reality psw_idle is an entry point for controlled +transition into serving interrupts. So, in practice, psw_idle stack +frame is analyzed during stack unwinding. Depending on build options +that r14 slot in the save area of psw_idle might either contain a value +saved by previous sibling call or complete garbage. + + [task 0000038000003c28] do_ext_irq+0xd6/0x160 + [task 0000038000003c78] ext_int_handler+0xba/0xe8 + [task *0000038000003dd8] psw_idle_exit+0x0/0x8 <-- pt_regs + ([task 0000038000003dd8] 0x0) + [task 0000038000003e10] default_idle_call+0x42/0x148 + [task 0000038000003e30] do_idle+0xce/0x160 + [task 0000038000003e70] cpu_startup_entry+0x36/0x40 + [task 0000038000003ea0] arch_call_rest_init+0x76/0x80 + +So, to make a stacktrace nicer and actually point for the real caller of +psw_idle in this frequently occurring case, make psw_idle save its r14. + + [task 0000038000003c28] do_ext_irq+0xd6/0x160 + [task 0000038000003c78] ext_int_handler+0xba/0xe8 + [task *0000038000003dd8] psw_idle_exit+0x0/0x6 <-- pt_regs + ([task 0000038000003dd8] arch_cpu_idle+0x3c/0xd0) + [task 0000038000003e10] default_idle_call+0x42/0x148 + [task 0000038000003e30] do_idle+0xce/0x160 + [task 0000038000003e70] cpu_startup_entry+0x36/0x40 + [task 0000038000003ea0] arch_call_rest_init+0x76/0x80 + +Reviewed-by: Sven Schnelle +Signed-off-by: Vasily Gorbik +Signed-off-by: Heiko Carstens +Signed-off-by: Sasha Levin +--- + arch/s390/kernel/entry.S | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S +index f1ba197b10c0..f0a215cf010c 100644 +--- a/arch/s390/kernel/entry.S ++++ b/arch/s390/kernel/entry.S +@@ -976,6 +976,7 @@ ENDPROC(ext_int_handler) + * Load idle PSW. + */ + ENTRY(psw_idle) ++ stg %r14,(__SF_GPRS+8*8)(%r15) + stg %r3,__SF_EMPTY(%r15) + larl %r1,.Lpsw_idle_exit + stg %r1,__SF_EMPTY+8(%r15) +-- +2.30.2 + diff --git a/queue-5.11/series b/queue-5.11/series index 45558a85d37..c6657f663d0 100644 --- a/queue-5.11/series +++ b/queue-5.11/series @@ -14,3 +14,27 @@ arm64-dts-allwinner-revert-sd-card-cd-gpio-for-pine6.patch bpf-allow-variable-offset-stack-access.patch bpf-refactor-and-streamline-bounds-check-into-helper.patch bpf-tighten-speculative-pointer-arithmetic-mask.patch +locking-qrwlock-fix-ordering-in-queued_write_lock_sl.patch +perf-x86-intel-uncore-remove-uncore-extra-pci-dev-hs.patch +perf-x86-kvm-fix-broadwell-xeon-stepping-in-isolatio.patch +perf-auxtrace-fix-potential-null-pointer-dereference.patch +perf-map-fix-error-return-code-in-maps__clone.patch +hid-google-add-don-usb-id.patch +hid-asus-add-support-for-2021-asus-n-key-keyboard.patch +hid-alps-fix-error-return-code-in-alps_input_configu.patch +hid-cp2112-fix-support-for-multiple-gpiochips.patch +hid-wacom-assign-boolean-values-to-a-bool-variable.patch +soc-qcom-geni-shield-geni_icc_get-for-acpi-boot.patch +dmaengine-xilinx-dpdma-fix-descriptor-issuing-on-vid.patch +dmaengine-xilinx-dpdma-fix-race-condition-in-done-ir.patch +arm-dts-fix-swapped-mmc-order-for-omap3.patch +m68k-fix-flatmem-memory-model-setup.patch +net-geneve-check-skb-is-large-enough-for-ipv4-ipv6-h.patch +dmaengine-tegra20-fix-runtime-pm-imbalance-on-error.patch +s390-entry-save-the-caller-of-psw_idle.patch +arm64-kprobes-restore-local-irqflag-if-kprobes-is-ca.patch +xen-netback-check-for-hotplug-status-existence-befor.patch +cavium-liquidio-fix-duplicate-argument.patch +csky-change-a-kconfig-symbol-name-to-fix-e1000-build.patch +ia64-fix-discontig.c-section-mismatches.patch +ia64-tools-remove-duplicate-definition-of-ia64_mf-on.patch diff --git a/queue-5.11/soc-qcom-geni-shield-geni_icc_get-for-acpi-boot.patch b/queue-5.11/soc-qcom-geni-shield-geni_icc_get-for-acpi-boot.patch new file mode 100644 index 00000000000..a4649eab91b --- /dev/null +++ b/queue-5.11/soc-qcom-geni-shield-geni_icc_get-for-acpi-boot.patch @@ -0,0 +1,42 @@ +From b1ca84eed71f4b020307bf0fc54e28c157955dac Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 14 Jan 2021 19:29:28 +0800 +Subject: soc: qcom: geni: shield geni_icc_get() for ACPI boot + +From: Shawn Guo + +[ Upstream commit 0c9fdcdba68208270ae85d39600ea97da1718344 ] + +Currently, GENI devices like i2c-qcom-geni fails to probe in ACPI boot, +if interconnect support is enabled. That's because interconnect driver +only supports DT right now. As interconnect is not necessarily required +for basic function of GENI devices, let's shield geni_icc_get() call, +and then all other ICC calls become nop due to NULL icc_path, so that +GENI devices keep working for ACPI boot. + +Reviewed-by: Bjorn Andersson +Signed-off-by: Shawn Guo +Link: https://lore.kernel.org/r/20210114112928.11368-1-shawn.guo@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + drivers/soc/qcom/qcom-geni-se.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/soc/qcom/qcom-geni-se.c b/drivers/soc/qcom/qcom-geni-se.c +index 1fd29f93ff6d..5bdfb1565c14 100644 +--- a/drivers/soc/qcom/qcom-geni-se.c ++++ b/drivers/soc/qcom/qcom-geni-se.c +@@ -756,6 +756,9 @@ int geni_icc_get(struct geni_se *se, const char *icc_ddr) + int i, err; + const char *icc_names[] = {"qup-core", "qup-config", icc_ddr}; + ++ if (has_acpi_companion(se->dev)) ++ return 0; ++ + for (i = 0; i < ARRAY_SIZE(se->icc_paths); i++) { + if (!icc_names[i]) + continue; +-- +2.30.2 + diff --git a/queue-5.11/xen-netback-check-for-hotplug-status-existence-befor.patch b/queue-5.11/xen-netback-check-for-hotplug-status-existence-befor.patch new file mode 100644 index 00000000000..9d2ff3dc292 --- /dev/null +++ b/queue-5.11/xen-netback-check-for-hotplug-status-existence-befor.patch @@ -0,0 +1,66 @@ +From e63c261542639273a86c49a96fba41c4c3668293 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 13 Apr 2021 16:25:12 +0100 +Subject: xen-netback: Check for hotplug-status existence before watching + +From: Michael Brown + +[ Upstream commit 2afeec08ab5c86ae21952151f726bfe184f6b23d ] + +The logic in connect() is currently written with the assumption that +xenbus_watch_pathfmt() will return an error for a node that does not +exist. This assumption is incorrect: xenstore does allow a watch to +be registered for a nonexistent node (and will send notifications +should the node be subsequently created). + +As of commit 1f2565780 ("xen-netback: remove 'hotplug-status' once it +has served its purpose"), this leads to a failure when a domU +transitions into XenbusStateConnected more than once. On the first +domU transition into Connected state, the "hotplug-status" node will +be deleted by the hotplug_status_changed() callback in dom0. On the +second or subsequent domU transition into Connected state, the +hotplug_status_changed() callback will therefore never be invoked, and +so the backend will remain stuck in InitWait. + +This failure prevents scenarios such as reloading the xen-netfront +module within a domU, or booting a domU via iPXE. There is +unfortunately no way for the domU to work around this dom0 bug. + +Fix by explicitly checking for existence of the "hotplug-status" node, +thereby creating the behaviour that was previously assumed to exist. + +Signed-off-by: Michael Brown +Reviewed-by: Paul Durrant +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/xen-netback/xenbus.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c +index 6f10e0998f1c..94d19158efc1 100644 +--- a/drivers/net/xen-netback/xenbus.c ++++ b/drivers/net/xen-netback/xenbus.c +@@ -824,11 +824,15 @@ static void connect(struct backend_info *be) + xenvif_carrier_on(be->vif); + + unregister_hotplug_status_watch(be); +- err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch, NULL, +- hotplug_status_changed, +- "%s/%s", dev->nodename, "hotplug-status"); +- if (!err) ++ if (xenbus_exists(XBT_NIL, dev->nodename, "hotplug-status")) { ++ err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch, ++ NULL, hotplug_status_changed, ++ "%s/%s", dev->nodename, ++ "hotplug-status"); ++ if (err) ++ goto err; + be->have_hotplug_status_watch = 1; ++ } + + netif_tx_wake_all_queues(be->vif->dev); + +-- +2.30.2 + -- 2.47.3