From 6480a2153f2913e98588879e7f20de28c11b32ae Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 18 Apr 2021 19:19:14 -0400 Subject: [PATCH] Fixes for 5.10 Signed-off-by: Sasha Levin --- ...-fix-conversion-for_each_membock-to-.patch | 84 ++++++++++++++++ ...footbridge-fix-pci-interrupt-mapping.patch | 98 +++++++++++++++++++ .../arm-omap2-fix-uninitialized-sr_inst.patch | 35 +++++++ ...p2-fix-warning-for-omap_init_time_of.patch | 35 +++++++ ...ner-fix-sd-card-cd-gpio-for-sopine-s.patch | 61 ++++++++++++ ...ner-h6-beelink-gs1-remove-ext.-32-kh.patch | 52 ++++++++++ ...permission-flag-for-mixed-signed-bou.patch | 38 +++++++ queue-5.10/series | 7 ++ 8 files changed, 410 insertions(+) create mode 100644 queue-5.10/arm-9069-1-nommu-fix-conversion-for_each_membock-to-.patch create mode 100644 queue-5.10/arm-footbridge-fix-pci-interrupt-mapping.patch create mode 100644 queue-5.10/arm-omap2-fix-uninitialized-sr_inst.patch create mode 100644 queue-5.10/arm-omap2-fix-warning-for-omap_init_time_of.patch create mode 100644 queue-5.10/arm64-dts-allwinner-fix-sd-card-cd-gpio-for-sopine-s.patch create mode 100644 queue-5.10/arm64-dts-allwinner-h6-beelink-gs1-remove-ext.-32-kh.patch create mode 100644 queue-5.10/bpf-use-correct-permission-flag-for-mixed-signed-bou.patch diff --git a/queue-5.10/arm-9069-1-nommu-fix-conversion-for_each_membock-to-.patch b/queue-5.10/arm-9069-1-nommu-fix-conversion-for_each_membock-to-.patch new file mode 100644 index 00000000000..2707a8f1e91 --- /dev/null +++ b/queue-5.10/arm-9069-1-nommu-fix-conversion-for_each_membock-to-.patch @@ -0,0 +1,84 @@ +From cf3bbccb6b41a56baed531c4edb3159155480783 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 11 Mar 2021 13:32:16 +0100 +Subject: ARM: 9069/1: NOMMU: Fix conversion for_each_membock() to + for_each_mem_range() + +From: Vladimir Murzin + +[ Upstream commit 45c2f70cba3a7eff34574103b2e2b901a5f771aa ] + +for_each_mem_range() uses a loop variable, yet looking into code it is +not just iteration counter but more complex entity which encodes +information about memblock. Thus condition i == 0 looks fragile. +Indeed, it broke boot of R-class platforms since it never took i == 0 +path (due to i was set to 1). Fix that with restoring original flag +check. + +Fixes: b10d6bca8720 ("arch, drivers: replace for_each_membock() with for_each_mem_range()") +Signed-off-by: Vladimir Murzin +Acked-by: Mike Rapoport +Signed-off-by: Russell King +Signed-off-by: Sasha Levin +--- + arch/arm/mm/pmsa-v7.c | 4 +++- + arch/arm/mm/pmsa-v8.c | 4 +++- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/mm/pmsa-v7.c b/arch/arm/mm/pmsa-v7.c +index 88950e41a3a9..59d916ccdf25 100644 +--- a/arch/arm/mm/pmsa-v7.c ++++ b/arch/arm/mm/pmsa-v7.c +@@ -235,6 +235,7 @@ void __init pmsav7_adjust_lowmem_bounds(void) + phys_addr_t mem_end; + phys_addr_t reg_start, reg_end; + unsigned int mem_max_regions; ++ bool first = true; + int num; + u64 i; + +@@ -263,7 +264,7 @@ void __init pmsav7_adjust_lowmem_bounds(void) + #endif + + for_each_mem_range(i, ®_start, ®_end) { +- if (i == 0) { ++ if (first) { + phys_addr_t phys_offset = PHYS_OFFSET; + + /* +@@ -275,6 +276,7 @@ void __init pmsav7_adjust_lowmem_bounds(void) + mem_start = reg_start; + mem_end = reg_end; + specified_mem_size = mem_end - mem_start; ++ first = false; + } else { + /* + * memblock auto merges contiguous blocks, remove +diff --git a/arch/arm/mm/pmsa-v8.c b/arch/arm/mm/pmsa-v8.c +index 2de019f7503e..8359748a19a1 100644 +--- a/arch/arm/mm/pmsa-v8.c ++++ b/arch/arm/mm/pmsa-v8.c +@@ -95,10 +95,11 @@ void __init pmsav8_adjust_lowmem_bounds(void) + { + phys_addr_t mem_end; + phys_addr_t reg_start, reg_end; ++ bool first = true; + u64 i; + + for_each_mem_range(i, ®_start, ®_end) { +- if (i == 0) { ++ if (first) { + phys_addr_t phys_offset = PHYS_OFFSET; + + /* +@@ -107,6 +108,7 @@ void __init pmsav8_adjust_lowmem_bounds(void) + if (reg_start != phys_offset) + panic("First memory bank must be contiguous from PHYS_OFFSET"); + mem_end = reg_end; ++ first = false; + } else { + /* + * memblock auto merges contiguous blocks, remove +-- +2.30.2 + diff --git a/queue-5.10/arm-footbridge-fix-pci-interrupt-mapping.patch b/queue-5.10/arm-footbridge-fix-pci-interrupt-mapping.patch new file mode 100644 index 00000000000..31677503fca --- /dev/null +++ b/queue-5.10/arm-footbridge-fix-pci-interrupt-mapping.patch @@ -0,0 +1,98 @@ +From 9af5df8970dde931c0d5faf338bda0f503cf0b41 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 25 Mar 2021 10:26:21 +0000 +Subject: ARM: footbridge: fix PCI interrupt mapping + +From: Russell King + +[ Upstream commit 30e3b4f256b4e366a61658c294f6a21b8626dda7 ] + +Since commit 30fdfb929e82 ("PCI: Add a call to pci_assign_irq() in +pci_device_probe()"), the PCI code will call the IRQ mapping function +whenever a PCI driver is probed. If these are marked as __init, this +causes an oops if a PCI driver is loaded or bound after the kernel has +initialised. + +Fixes: 30fdfb929e82 ("PCI: Add a call to pci_assign_irq() in pci_device_probe()") +Signed-off-by: Russell King +Signed-off-by: Sasha Levin +--- + arch/arm/mach-footbridge/cats-pci.c | 4 ++-- + arch/arm/mach-footbridge/ebsa285-pci.c | 4 ++-- + arch/arm/mach-footbridge/netwinder-pci.c | 2 +- + arch/arm/mach-footbridge/personal-pci.c | 5 ++--- + 4 files changed, 7 insertions(+), 8 deletions(-) + +diff --git a/arch/arm/mach-footbridge/cats-pci.c b/arch/arm/mach-footbridge/cats-pci.c +index 0b2fd7e2e9b4..90b1e9be430e 100644 +--- a/arch/arm/mach-footbridge/cats-pci.c ++++ b/arch/arm/mach-footbridge/cats-pci.c +@@ -15,14 +15,14 @@ + #include + + /* cats host-specific stuff */ +-static int irqmap_cats[] __initdata = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 }; ++static int irqmap_cats[] = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 }; + + static u8 cats_no_swizzle(struct pci_dev *dev, u8 *pin) + { + return 0; + } + +-static int __init cats_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++static int cats_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) + { + if (dev->irq >= 255) + return -1; /* not a valid interrupt. */ +diff --git a/arch/arm/mach-footbridge/ebsa285-pci.c b/arch/arm/mach-footbridge/ebsa285-pci.c +index 6f28aaa9ca79..c3f280d08fa7 100644 +--- a/arch/arm/mach-footbridge/ebsa285-pci.c ++++ b/arch/arm/mach-footbridge/ebsa285-pci.c +@@ -14,9 +14,9 @@ + #include + #include + +-static int irqmap_ebsa285[] __initdata = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI }; ++static int irqmap_ebsa285[] = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI }; + +-static int __init ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++static int ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) + { + if (dev->vendor == PCI_VENDOR_ID_CONTAQ && + dev->device == PCI_DEVICE_ID_CONTAQ_82C693) +diff --git a/arch/arm/mach-footbridge/netwinder-pci.c b/arch/arm/mach-footbridge/netwinder-pci.c +index 9473aa0305e5..e8304392074b 100644 +--- a/arch/arm/mach-footbridge/netwinder-pci.c ++++ b/arch/arm/mach-footbridge/netwinder-pci.c +@@ -18,7 +18,7 @@ + * We now use the slot ID instead of the device identifiers to select + * which interrupt is routed where. + */ +-static int __init netwinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++static int netwinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) + { + switch (slot) { + case 0: /* host bridge */ +diff --git a/arch/arm/mach-footbridge/personal-pci.c b/arch/arm/mach-footbridge/personal-pci.c +index 4391e433a4b2..9d19aa98a663 100644 +--- a/arch/arm/mach-footbridge/personal-pci.c ++++ b/arch/arm/mach-footbridge/personal-pci.c +@@ -14,13 +14,12 @@ + #include + #include + +-static int irqmap_personal_server[] __initdata = { ++static int irqmap_personal_server[] = { + IRQ_IN0, IRQ_IN1, IRQ_IN2, IRQ_IN3, 0, 0, 0, + IRQ_DOORBELLHOST, IRQ_DMA1, IRQ_DMA2, IRQ_PCI + }; + +-static int __init personal_server_map_irq(const struct pci_dev *dev, u8 slot, +- u8 pin) ++static int personal_server_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) + { + unsigned char line; + +-- +2.30.2 + diff --git a/queue-5.10/arm-omap2-fix-uninitialized-sr_inst.patch b/queue-5.10/arm-omap2-fix-uninitialized-sr_inst.patch new file mode 100644 index 00000000000..380c5c199af --- /dev/null +++ b/queue-5.10/arm-omap2-fix-uninitialized-sr_inst.patch @@ -0,0 +1,35 @@ +From 0eca38293c5ebe5853bd0c3295cb84e56361a388 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Mar 2021 09:27:41 +0300 +Subject: ARM: OMAP2+: Fix uninitialized sr_inst + +From: Tony Lindgren + +[ Upstream commit fc85dc42a38405099f97aa2af709fe9504a82508 ] + +Fix uninitialized sr_inst. + +Fixes: fbfa463be8dc ("ARM: OMAP2+: Fix smartreflex init regression after dropping legacy data") +Reported-by: kernel test robot +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +--- + arch/arm/mach-omap2/sr_device.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c +index 17b66f0d0dee..605925684b0a 100644 +--- a/arch/arm/mach-omap2/sr_device.c ++++ b/arch/arm/mach-omap2/sr_device.c +@@ -188,7 +188,7 @@ static const char * const dra7_sr_instances[] = { + + int __init omap_devinit_smartreflex(void) + { +- const char * const *sr_inst; ++ const char * const *sr_inst = NULL; + int i, nr_sr = 0; + + if (soc_is_omap44xx()) { +-- +2.30.2 + diff --git a/queue-5.10/arm-omap2-fix-warning-for-omap_init_time_of.patch b/queue-5.10/arm-omap2-fix-warning-for-omap_init_time_of.patch new file mode 100644 index 00000000000..9efc1c39d05 --- /dev/null +++ b/queue-5.10/arm-omap2-fix-warning-for-omap_init_time_of.patch @@ -0,0 +1,35 @@ +From 9e48821801050650bf312d786076cf79b4d4ddab Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 24 Mar 2021 12:23:58 +0200 +Subject: ARM: OMAP2+: Fix warning for omap_init_time_of() + +From: Tony Lindgren + +[ Upstream commit a3efe3f6d0eb64363f74af4b0e8ba6d19415cef2 ] + +Fix warning: no previous prototype for 'omap_init_time_of'. + +Fixes: e69b4e1a7577 ("ARM: OMAP2+: Add omap_init_time_of()") +Reported-by: kernel test robot +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +--- + arch/arm/mach-omap2/board-generic.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c +index 7290f033fd2d..1610c567a6a3 100644 +--- a/arch/arm/mach-omap2/board-generic.c ++++ b/arch/arm/mach-omap2/board-generic.c +@@ -33,7 +33,7 @@ static void __init __maybe_unused omap_generic_init(void) + } + + /* Clocks are needed early, see drivers/clocksource for the rest */ +-void __init __maybe_unused omap_init_time_of(void) ++static void __init __maybe_unused omap_init_time_of(void) + { + omap_clk_init(); + timer_probe(); +-- +2.30.2 + diff --git a/queue-5.10/arm64-dts-allwinner-fix-sd-card-cd-gpio-for-sopine-s.patch b/queue-5.10/arm64-dts-allwinner-fix-sd-card-cd-gpio-for-sopine-s.patch new file mode 100644 index 00000000000..48a13491181 --- /dev/null +++ b/queue-5.10/arm64-dts-allwinner-fix-sd-card-cd-gpio-for-sopine-s.patch @@ -0,0 +1,61 @@ +From ccdb4df644bd8b394fd2a753ee087976b8a2c972 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 16 Mar 2021 14:42:19 +0000 +Subject: arm64: dts: allwinner: Fix SD card CD GPIO for SOPine systems + +From: Andre Przywara + +[ Upstream commit 3dd4ce4185df6798dcdcc3669bddb35899d7d5e1 ] + +Commit 941432d00768 ("arm64: dts: allwinner: Drop non-removable from +SoPine/LTS SD card") enabled the card detect GPIO for the SOPine module, +along the way with the Pine64-LTS, which share the same base .dtsi. + +However while both boards indeed have a working CD GPIO on PF6, the +polarity is different: the SOPine modules uses a "push-pull" socket, +which has an active-high switch, while the Pine64-LTS use the more +traditional push-push socket and the common active-low switch. + +Fix the polarity in the sopine.dtsi, and overwrite it in the LTS +board .dts, to make the SD card work again on systems using SOPine +modules. + +Fixes: 941432d00768 ("arm64: dts: allwinner: Drop non-removable from SoPine/LTS SD card") +Reported-by: Ashley +Signed-off-by: Andre Przywara +Signed-off-by: Maxime Ripard +Link: https://lore.kernel.org/r/20210316144219.5973-1-andre.przywara@arm.com +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts | 4 ++++ + arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts +index 302e24be0a31..a1f621b388fe 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts +@@ -8,3 +8,7 @@ + compatible = "pine64,pine64-lts", "allwinner,sun50i-r18", + "allwinner,sun50i-a64"; + }; ++ ++&mmc0 { ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 push-push switch */ ++}; +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi +index 3402cec87035..df62044ff7a7 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi ++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi +@@ -34,7 +34,7 @@ + vmmc-supply = <®_dcdc1>; + disable-wp; + bus-width = <4>; +- cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 push-pull switch */ + status = "okay"; + }; + +-- +2.30.2 + diff --git a/queue-5.10/arm64-dts-allwinner-h6-beelink-gs1-remove-ext.-32-kh.patch b/queue-5.10/arm64-dts-allwinner-h6-beelink-gs1-remove-ext.-32-kh.patch new file mode 100644 index 00000000000..29f3b71cf2e --- /dev/null +++ b/queue-5.10/arm64-dts-allwinner-h6-beelink-gs1-remove-ext.-32-kh.patch @@ -0,0 +1,52 @@ +From af53bdafb9c5c9e94e0098385da8c005c2f0f0ee Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 30 Mar 2021 20:42:18 +0200 +Subject: arm64: dts: allwinner: h6: beelink-gs1: Remove ext. 32 kHz osc + reference +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Jernej Skrabec + +[ Upstream commit 7a2f6e69e9c1060a7a09c1f8322ccb8d942b3078 ] + +Although every Beelink GS1 seems to have external 32768 Hz oscillator, +it works only on one from four tested. There are more reports of RTC +issues elsewhere, like Armbian forum. + +One Beelink GS1 owner read RTC osc status register on Android which +shipped with the box. Reported value indicated problems with external +oscillator. + +In order to fix RTC and related issues (HDMI-CEC and suspend/resume with +Crust) on all boards, switch to internal oscillator. + +Fixes: 32507b868119 ("arm64: dts: allwinner: h6: Move ext. oscillator to board DTs") +Signed-off-by: Jernej Skrabec +Tested-by: Clément Péron +Signed-off-by: Maxime Ripard +Link: https://lore.kernel.org/r/20210330184218.279738-1-jernej.skrabec@siol.net +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts +index 7c9dbde645b5..e8163c572dab 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts +@@ -289,10 +289,6 @@ + vcc-pm-supply = <®_aldo1>; + }; + +-&rtc { +- clocks = <&ext_osc32k>; +-}; +- + &spdif { + status = "okay"; + }; +-- +2.30.2 + diff --git a/queue-5.10/bpf-use-correct-permission-flag-for-mixed-signed-bou.patch b/queue-5.10/bpf-use-correct-permission-flag-for-mixed-signed-bou.patch new file mode 100644 index 00000000000..62a0793dc44 --- /dev/null +++ b/queue-5.10/bpf-use-correct-permission-flag-for-mixed-signed-bou.patch @@ -0,0 +1,38 @@ +From 5b91d80ca04facfe6f7d6172957122af66a1917c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 23 Mar 2021 08:32:59 +0100 +Subject: bpf: Use correct permission flag for mixed signed bounds arithmetic + +From: Daniel Borkmann + +[ Upstream commit 9601148392520e2e134936e76788fc2a6371e7be ] + +We forbid adding unknown scalars with mixed signed bounds due to the +spectre v1 masking mitigation. Hence this also needs bypass_spec_v1 +flag instead of allow_ptr_leaks. + +Fixes: 2c78ee898d8f ("bpf: Implement CAP_BPF") +Signed-off-by: Daniel Borkmann +Reviewed-by: John Fastabend +Acked-by: Alexei Starovoitov +Signed-off-by: Sasha Levin +--- + kernel/bpf/verifier.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c +index 12cd2997f982..2eaefd9c4152 100644 +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -5522,7 +5522,7 @@ static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, + dst, reg_type_str[ptr_reg->type]); + return -EACCES; + case PTR_TO_MAP_VALUE: +- if (!env->allow_ptr_leaks && !known && (smin_val < 0) != (smax_val < 0)) { ++ if (!env->env->bypass_spec_v1 && !known && (smin_val < 0) != (smax_val < 0)) { + verbose(env, "R%d has unknown scalar with mixed signed bounds, pointer arithmetic with it prohibited for !root\n", + off_reg == dst_reg ? dst : src); + return -EACCES; +-- +2.30.2 + diff --git a/queue-5.10/series b/queue-5.10/series index 122f967a773..539d05f1924 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -83,3 +83,10 @@ ch_ktls-fix-device-connection-close.patch ch_ktls-tcb-close-causes-tls-connection-failure.patch ch_ktls-do-not-send-snd_una-update-to-tcb-in-middle.patch gro-ensure-frag0-meets-ip-header-alignment.patch +arm-omap2-fix-warning-for-omap_init_time_of.patch +arm-9069-1-nommu-fix-conversion-for_each_membock-to-.patch +arm-footbridge-fix-pci-interrupt-mapping.patch +arm-omap2-fix-uninitialized-sr_inst.patch +arm64-dts-allwinner-fix-sd-card-cd-gpio-for-sopine-s.patch +arm64-dts-allwinner-h6-beelink-gs1-remove-ext.-32-kh.patch +bpf-use-correct-permission-flag-for-mixed-signed-bou.patch -- 2.47.3