From 703c71e06284a96aaf5722f9137194d67e3ea9f8 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 25 Apr 2021 21:04:02 -0400 Subject: [PATCH] Fixes for 4.9 Signed-off-by: Sasha Levin --- ...-dts-fix-swapped-mmc-order-for-omap3.patch | 42 +++++++++++ ...vium-liquidio-fix-duplicate-argument.patch | 40 ++++++++++ ...or-return-code-in-alps_input_configu.patch | 35 +++++++++ ...4-fix-discontig.c-section-mismatches.patch | 73 +++++++++++++++++++ ...e-duplicate-definition-of-ia64_mf-on.patch | 59 +++++++++++++++ ...90-entry-save-the-caller-of-psw_idle.patch | 62 ++++++++++++++++ queue-4.9/series | 7 ++ ...k-for-hotplug-status-existence-befor.patch | 66 +++++++++++++++++ 8 files changed, 384 insertions(+) create mode 100644 queue-4.9/arm-dts-fix-swapped-mmc-order-for-omap3.patch create mode 100644 queue-4.9/cavium-liquidio-fix-duplicate-argument.patch create mode 100644 queue-4.9/hid-alps-fix-error-return-code-in-alps_input_configu.patch create mode 100644 queue-4.9/ia64-fix-discontig.c-section-mismatches.patch create mode 100644 queue-4.9/ia64-tools-remove-duplicate-definition-of-ia64_mf-on.patch create mode 100644 queue-4.9/s390-entry-save-the-caller-of-psw_idle.patch create mode 100644 queue-4.9/xen-netback-check-for-hotplug-status-existence-befor.patch diff --git a/queue-4.9/arm-dts-fix-swapped-mmc-order-for-omap3.patch b/queue-4.9/arm-dts-fix-swapped-mmc-order-for-omap3.patch new file mode 100644 index 00000000000..e26e93319e1 --- /dev/null +++ b/queue-4.9/arm-dts-fix-swapped-mmc-order-for-omap3.patch @@ -0,0 +1,42 @@ +From 44411f3166897612b18105ffd02eb7165f6cf558 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 2008648b8c9f..0a7600d06fb5 100644 +--- a/arch/arm/boot/dts/omap3.dtsi ++++ b/arch/arm/boot/dts/omap3.dtsi +@@ -23,6 +23,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-4.9/cavium-liquidio-fix-duplicate-argument.patch b/queue-4.9/cavium-liquidio-fix-duplicate-argument.patch new file mode 100644 index 00000000000..667ed819566 --- /dev/null +++ b/queue-4.9/cavium-liquidio-fix-duplicate-argument.patch @@ -0,0 +1,40 @@ +From 32c3d306b4d1dcc4e831882b82dc39449ac1b2c1 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 5e3aff242ad3..3ab84d18ad3a 100644 +--- a/drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h ++++ b/drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h +@@ -417,7 +417,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-4.9/hid-alps-fix-error-return-code-in-alps_input_configu.patch b/queue-4.9/hid-alps-fix-error-return-code-in-alps_input_configu.patch new file mode 100644 index 00000000000..ee0941cd36b --- /dev/null +++ b/queue-4.9/hid-alps-fix-error-return-code-in-alps_input_configu.patch @@ -0,0 +1,35 @@ +From cb90d1585d00d3d7fc318bdbcde77cc1e83e2bb8 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 ed9c0ea5b026..1bc6ad0339d2 100644 +--- a/drivers/hid/hid-alps.c ++++ b/drivers/hid/hid-alps.c +@@ -429,6 +429,7 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi) + ret = input_register_device(data->input2); + if (ret) { + input_free_device(input2); ++ ret = -ENOENT; + goto exit; + } + } +-- +2.30.2 + diff --git a/queue-4.9/ia64-fix-discontig.c-section-mismatches.patch b/queue-4.9/ia64-fix-discontig.c-section-mismatches.patch new file mode 100644 index 00000000000..f81f3f773e9 --- /dev/null +++ b/queue-4.9/ia64-fix-discontig.c-section-mismatches.patch @@ -0,0 +1,73 @@ +From 596211957141b0f30f47a66c721a65ff0cd75cea 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 878626805369..3b0c892953ab 100644 +--- a/arch/ia64/mm/discontig.c ++++ b/arch/ia64/mm/discontig.c +@@ -99,7 +99,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; + +@@ -114,7 +114,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; + +@@ -411,7 +411,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-4.9/ia64-tools-remove-duplicate-definition-of-ia64_mf-on.patch b/queue-4.9/ia64-tools-remove-duplicate-definition-of-ia64_mf-on.patch new file mode 100644 index 00000000000..31142a9021c --- /dev/null +++ b/queue-4.9/ia64-tools-remove-duplicate-definition-of-ia64_mf-on.patch @@ -0,0 +1,59 @@ +From bd83f12a3bb05b097e9be1673ae80dfb81e50fce 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 e4422b4b634e..94ae4a333a35 100644 +--- a/tools/arch/ia64/include/asm/barrier.h ++++ b/tools/arch/ia64/include/asm/barrier.h +@@ -38,9 +38,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-4.9/s390-entry-save-the-caller-of-psw_idle.patch b/queue-4.9/s390-entry-save-the-caller-of-psw_idle.patch new file mode 100644 index 00000000000..1418a17b439 --- /dev/null +++ b/queue-4.9/s390-entry-save-the-caller-of-psw_idle.patch @@ -0,0 +1,62 @@ +From 89c557cc991aa55df3691e85132414e82e14c2a6 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 771cfd2e1e6d..708b8ee604d0 100644 +--- a/arch/s390/kernel/entry.S ++++ b/arch/s390/kernel/entry.S +@@ -902,6 +902,7 @@ ENTRY(ext_int_handler) + * Load idle PSW. The second "half" of this function is in .Lcleanup_idle. + */ + ENTRY(psw_idle) ++ stg %r14,(__SF_GPRS+8*8)(%r15) + stg %r3,__SF_EMPTY(%r15) + larl %r1,.Lpsw_idle_lpsw+4 + stg %r1,__SF_EMPTY+8(%r15) +-- +2.30.2 + diff --git a/queue-4.9/series b/queue-4.9/series index 50a1b091682..ca48a95d652 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -27,3 +27,10 @@ usbip-vudc-synchronize-sysfs-code-paths.patch usbip-synchronize-event-handler-with-sysfs-code-paths.patch net-hso-fix-null-ptr-deref-during-tty-device-unregistration.patch ext4-correct-error-label-in-ext4_rename.patch +hid-alps-fix-error-return-code-in-alps_input_configu.patch +arm-dts-fix-swapped-mmc-order-for-omap3.patch +s390-entry-save-the-caller-of-psw_idle.patch +xen-netback-check-for-hotplug-status-existence-befor.patch +cavium-liquidio-fix-duplicate-argument.patch +ia64-fix-discontig.c-section-mismatches.patch +ia64-tools-remove-duplicate-definition-of-ia64_mf-on.patch diff --git a/queue-4.9/xen-netback-check-for-hotplug-status-existence-befor.patch b/queue-4.9/xen-netback-check-for-hotplug-status-existence-befor.patch new file mode 100644 index 00000000000..f18df770c8b --- /dev/null +++ b/queue-4.9/xen-netback-check-for-hotplug-status-existence-befor.patch @@ -0,0 +1,66 @@ +From de30be6d50d5c2616fe8d2411c47ca8e6e8df9c6 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 78788402edd8..e6646c8a7bdb 100644 +--- a/drivers/net/xen-netback/xenbus.c ++++ b/drivers/net/xen-netback/xenbus.c +@@ -1040,11 +1040,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