From 9f727e4c8f179fc9cede868cf97b16bedd831450 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 23 Jun 2019 22:35:20 +0200 Subject: [PATCH] 4.14-stable patches added patches: arm-dts-am57xx-idk-remove-support-for-voltage-switching-for-sd-card.patch arm-imx-cpuidle-imx6sx-restrict-the-sw2iso-increase-to-i.mx6sx.patch btrfs-start-readahead-also-in-seed-devices.patch can-flexcan-fix-timeout-when-set-small-bitrate.patch can-purge-socket-error-queue-on-sock-destruct.patch powerpc-bpf-use-unsigned-division-instruction-for-64-bit-operations.patch --- ...rt-for-voltage-switching-for-sd-card.patch | 41 ++++++++++ ...trict-the-sw2iso-increase-to-i.mx6sx.patch | 55 +++++++++++++ ...start-readahead-also-in-seed-devices.patch | 49 +++++++++++ ...n-fix-timeout-when-set-small-bitrate.patch | 55 +++++++++++++ ...-socket-error-queue-on-sock-destruct.patch | 33 ++++++++ ...on-instruction-for-64-bit-operations.patch | 81 +++++++++++++++++++ queue-4.14/series | 6 ++ 7 files changed, 320 insertions(+) create mode 100644 queue-4.14/arm-dts-am57xx-idk-remove-support-for-voltage-switching-for-sd-card.patch create mode 100644 queue-4.14/arm-imx-cpuidle-imx6sx-restrict-the-sw2iso-increase-to-i.mx6sx.patch create mode 100644 queue-4.14/btrfs-start-readahead-also-in-seed-devices.patch create mode 100644 queue-4.14/can-flexcan-fix-timeout-when-set-small-bitrate.patch create mode 100644 queue-4.14/can-purge-socket-error-queue-on-sock-destruct.patch create mode 100644 queue-4.14/powerpc-bpf-use-unsigned-division-instruction-for-64-bit-operations.patch diff --git a/queue-4.14/arm-dts-am57xx-idk-remove-support-for-voltage-switching-for-sd-card.patch b/queue-4.14/arm-dts-am57xx-idk-remove-support-for-voltage-switching-for-sd-card.patch new file mode 100644 index 0000000000..2706e15b9a --- /dev/null +++ b/queue-4.14/arm-dts-am57xx-idk-remove-support-for-voltage-switching-for-sd-card.patch @@ -0,0 +1,41 @@ +From 88a748419b84187fd1da05637b8e5928b04a1e06 Mon Sep 17 00:00:00 2001 +From: Faiz Abbas +Date: Thu, 2 May 2019 14:17:48 +0530 +Subject: ARM: dts: am57xx-idk: Remove support for voltage switching for SD card + +From: Faiz Abbas + +commit 88a748419b84187fd1da05637b8e5928b04a1e06 upstream. + +If UHS speed modes are enabled, a compatible SD card switches down to +1.8V during enumeration. If after this a software reboot/crash takes +place and on-chip ROM tries to enumerate the SD card, the difference in +IO voltages (host @ 3.3V and card @ 1.8V) may end up damaging the card. + +The fix for this is to have support for power cycling the card in +hardware (with a PORz/soft-reset line causing a power cycle of the +card). Since am571x-, am572x- and am574x-idk don't have this +capability, disable voltage switching for these boards. + +The major effect of this is that the maximum supported speed +mode is now high speed(50 MHz) down from SDR104(200 MHz). + +Cc: +Signed-off-by: Faiz Abbas +Signed-off-by: Tony Lindgren +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/boot/dts/am57xx-idk-common.dtsi | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/boot/dts/am57xx-idk-common.dtsi ++++ b/arch/arm/boot/dts/am57xx-idk-common.dtsi +@@ -405,6 +405,7 @@ + vqmmc-supply = <&ldo1_reg>; + bus-width = <4>; + cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>; /* gpio 219 */ ++ no-1-8-v; + }; + + &mmc2 { diff --git a/queue-4.14/arm-imx-cpuidle-imx6sx-restrict-the-sw2iso-increase-to-i.mx6sx.patch b/queue-4.14/arm-imx-cpuidle-imx6sx-restrict-the-sw2iso-increase-to-i.mx6sx.patch new file mode 100644 index 0000000000..2960fd2ce2 --- /dev/null +++ b/queue-4.14/arm-imx-cpuidle-imx6sx-restrict-the-sw2iso-increase-to-i.mx6sx.patch @@ -0,0 +1,55 @@ +From b25af2ff7c07bd19af74e3f64ff82e2880d13d81 Mon Sep 17 00:00:00 2001 +From: Fabio Estevam +Date: Mon, 13 May 2019 00:15:31 -0300 +Subject: ARM: imx: cpuidle-imx6sx: Restrict the SW2ISO increase to i.MX6SX +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Fabio Estevam + +commit b25af2ff7c07bd19af74e3f64ff82e2880d13d81 upstream. + +Since commit 1e434b703248 ("ARM: imx: update the cpu power up timing +setting on i.mx6sx") some characters loss is noticed on i.MX6ULL UART +as reported by Christoph Niedermaier. + +The intention of such commit was to increase the SW2ISO field for i.MX6SX +only, but since cpuidle-imx6sx is also used on i.MX6UL/i.MX6ULL this caused +unintended side effects on other SoCs. + +Fix this problem by keeping the original SW2ISO value for i.MX6UL/i.MX6ULL +and only increase SW2ISO in the i.MX6SX case. + +Cc: stable@vger.kernel.org +Fixes: 1e434b703248 ("ARM: imx: update the cpu power up timing setting on i.mx6sx") +Reported-by: Christoph Niedermaier +Signed-off-by: Fabio Estevam +Tested-by: Sébastien Szymanski +Tested-by: Christoph Niedermaier +Signed-off-by: Shawn Guo +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mach-imx/cpuidle-imx6sx.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/arch/arm/mach-imx/cpuidle-imx6sx.c ++++ b/arch/arm/mach-imx/cpuidle-imx6sx.c +@@ -15,6 +15,7 @@ + + #include "common.h" + #include "cpuidle.h" ++#include "hardware.h" + + static int imx6sx_idle_finish(unsigned long val) + { +@@ -108,7 +109,7 @@ int __init imx6sx_cpuidle_init(void) + * except for power up sw2iso which need to be + * larger than LDO ramp up time. + */ +- imx_gpc_set_arm_power_up_timing(0xf, 1); ++ imx_gpc_set_arm_power_up_timing(cpu_is_imx6sx() ? 0xf : 0x2, 1); + imx_gpc_set_arm_power_down_timing(1, 1); + + return cpuidle_register(&imx6sx_cpuidle_driver, NULL); diff --git a/queue-4.14/btrfs-start-readahead-also-in-seed-devices.patch b/queue-4.14/btrfs-start-readahead-also-in-seed-devices.patch new file mode 100644 index 0000000000..a4f34a94b7 --- /dev/null +++ b/queue-4.14/btrfs-start-readahead-also-in-seed-devices.patch @@ -0,0 +1,49 @@ +From c4e0540d0ad49c8ceab06cceed1de27c4fe29f6e Mon Sep 17 00:00:00 2001 +From: Naohiro Aota +Date: Thu, 6 Jun 2019 16:54:44 +0900 +Subject: btrfs: start readahead also in seed devices + +From: Naohiro Aota + +commit c4e0540d0ad49c8ceab06cceed1de27c4fe29f6e upstream. + +Currently, btrfs does not consult seed devices to start readahead. As a +result, if readahead zone is added to the seed devices, btrfs_reada_wait() +indefinitely wait for the reada_ctl to finish. + +You can reproduce the hung by modifying btrfs/163 to have larger initial +file size (e.g. xfs_io pwrite 4M instead of current 256K). + +Fixes: 7414a03fbf9e ("btrfs: initial readahead code and prototypes") +Cc: stable@vger.kernel.org # 3.2+: ce7791ffee1e: Btrfs: fix race between readahead and device replace/removal +Cc: stable@vger.kernel.org # 3.2+ +Reviewed-by: Filipe Manana +Signed-off-by: Naohiro Aota +Signed-off-by: David Sterba +Signed-off-by: Greg Kroah-Hartman + +--- + fs/btrfs/reada.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/fs/btrfs/reada.c ++++ b/fs/btrfs/reada.c +@@ -759,6 +759,7 @@ static void __reada_start_machine(struct + u64 total = 0; + int i; + ++again: + do { + enqueued = 0; + mutex_lock(&fs_devices->device_list_mutex); +@@ -770,6 +771,10 @@ static void __reada_start_machine(struct + mutex_unlock(&fs_devices->device_list_mutex); + total += enqueued; + } while (enqueued && total < 10000); ++ if (fs_devices->seed) { ++ fs_devices = fs_devices->seed; ++ goto again; ++ } + + if (enqueued == 0) + return; diff --git a/queue-4.14/can-flexcan-fix-timeout-when-set-small-bitrate.patch b/queue-4.14/can-flexcan-fix-timeout-when-set-small-bitrate.patch new file mode 100644 index 0000000000..f64cf67d13 --- /dev/null +++ b/queue-4.14/can-flexcan-fix-timeout-when-set-small-bitrate.patch @@ -0,0 +1,55 @@ +From 247e5356a709eb49a0d95ff2a7f07dac05c8252c Mon Sep 17 00:00:00 2001 +From: Joakim Zhang +Date: Thu, 31 Jan 2019 09:37:22 +0000 +Subject: can: flexcan: fix timeout when set small bitrate + +From: Joakim Zhang + +commit 247e5356a709eb49a0d95ff2a7f07dac05c8252c upstream. + +Current we can meet timeout issue when setting a small bitrate like +10000 as follows on i.MX6UL EVK board (ipg clock = 66MHZ, per clock = +30MHZ): + +| root@imx6ul7d:~# ip link set can0 up type can bitrate 10000 + +A link change request failed with some changes committed already. +Interface can0 may have been left with an inconsistent configuration, +please check. + +| RTNETLINK answers: Connection timed out + +It is caused by calling of flexcan_chip_unfreeze() timeout. + +Originally the code is using usleep_range(10, 20) for unfreeze +operation, but the patch (8badd65 can: flexcan: avoid calling +usleep_range from interrupt context) changed it into udelay(10) which is +only a half delay of before, there're also some other delay changes. + +After double to FLEXCAN_TIMEOUT_US to 100 can fix the issue. + +Meanwhile, Rasmus Villemoes reported that even with a timeout of 100, +flexcan_probe() fails on the MPC8309, which requires a value of at least +140 to work reliably. 250 works for everyone. + +Signed-off-by: Joakim Zhang +Reviewed-by: Dong Aisheng +Cc: linux-stable +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/can/flexcan.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/can/flexcan.c ++++ b/drivers/net/can/flexcan.c +@@ -177,7 +177,7 @@ + #define FLEXCAN_MB_CNT_LENGTH(x) (((x) & 0xf) << 16) + #define FLEXCAN_MB_CNT_TIMESTAMP(x) ((x) & 0xffff) + +-#define FLEXCAN_TIMEOUT_US (50) ++#define FLEXCAN_TIMEOUT_US (250) + + /* FLEXCAN hardware feature flags + * diff --git a/queue-4.14/can-purge-socket-error-queue-on-sock-destruct.patch b/queue-4.14/can-purge-socket-error-queue-on-sock-destruct.patch new file mode 100644 index 0000000000..7157c30bbe --- /dev/null +++ b/queue-4.14/can-purge-socket-error-queue-on-sock-destruct.patch @@ -0,0 +1,33 @@ +From fd704bd5ee749d560e86c4f1fd2ef486d8abf7cf Mon Sep 17 00:00:00 2001 +From: Willem de Bruijn +Date: Fri, 7 Jun 2019 16:46:07 -0400 +Subject: can: purge socket error queue on sock destruct + +From: Willem de Bruijn + +commit fd704bd5ee749d560e86c4f1fd2ef486d8abf7cf upstream. + +CAN supports software tx timestamps as of the below commit. Purge +any queued timestamp packets on socket destroy. + +Fixes: 51f31cabe3ce ("ip: support for TX timestamps on UDP and RAW sockets") +Reported-by: syzbot+a90604060cb40f5bdd16@syzkaller.appspotmail.com +Signed-off-by: Willem de Bruijn +Cc: linux-stable +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Greg Kroah-Hartman + +--- + net/can/af_can.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/net/can/af_can.c ++++ b/net/can/af_can.c +@@ -105,6 +105,7 @@ EXPORT_SYMBOL(can_ioctl); + static void can_sock_destruct(struct sock *sk) + { + skb_queue_purge(&sk->sk_receive_queue); ++ skb_queue_purge(&sk->sk_error_queue); + } + + static const struct can_proto *can_get_proto(int protocol) diff --git a/queue-4.14/powerpc-bpf-use-unsigned-division-instruction-for-64-bit-operations.patch b/queue-4.14/powerpc-bpf-use-unsigned-division-instruction-for-64-bit-operations.patch new file mode 100644 index 0000000000..cce9d5ec7b --- /dev/null +++ b/queue-4.14/powerpc-bpf-use-unsigned-division-instruction-for-64-bit-operations.patch @@ -0,0 +1,81 @@ +From 758f2046ea040773ae8ea7f72dd3bbd8fa984501 Mon Sep 17 00:00:00 2001 +From: "Naveen N. Rao" +Date: Thu, 13 Jun 2019 00:21:40 +0530 +Subject: powerpc/bpf: use unsigned division instruction for 64-bit operations + +From: Naveen N. Rao + +commit 758f2046ea040773ae8ea7f72dd3bbd8fa984501 upstream. + +BPF_ALU64 div/mod operations are currently using signed division, unlike +BPF_ALU32 operations. Fix the same. DIV64 and MOD64 overflow tests pass +with this fix. + +Fixes: 156d0e290e969c ("powerpc/ebpf/jit: Implement JIT compiler for extended BPF") +Cc: stable@vger.kernel.org # v4.8+ +Signed-off-by: Naveen N. Rao +Signed-off-by: Daniel Borkmann +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/include/asm/ppc-opcode.h | 1 + + arch/powerpc/net/bpf_jit.h | 2 +- + arch/powerpc/net/bpf_jit_comp64.c | 8 ++++---- + 3 files changed, 6 insertions(+), 5 deletions(-) + +--- a/arch/powerpc/include/asm/ppc-opcode.h ++++ b/arch/powerpc/include/asm/ppc-opcode.h +@@ -324,6 +324,7 @@ + #define PPC_INST_MULLI 0x1c000000 + #define PPC_INST_DIVWU 0x7c000396 + #define PPC_INST_DIVD 0x7c0003d2 ++#define PPC_INST_DIVDU 0x7c000392 + #define PPC_INST_RLWINM 0x54000000 + #define PPC_INST_RLWIMI 0x50000000 + #define PPC_INST_RLDICL 0x78000000 +--- a/arch/powerpc/net/bpf_jit.h ++++ b/arch/powerpc/net/bpf_jit.h +@@ -116,7 +116,7 @@ + ___PPC_RA(a) | IMM_L(i)) + #define PPC_DIVWU(d, a, b) EMIT(PPC_INST_DIVWU | ___PPC_RT(d) | \ + ___PPC_RA(a) | ___PPC_RB(b)) +-#define PPC_DIVD(d, a, b) EMIT(PPC_INST_DIVD | ___PPC_RT(d) | \ ++#define PPC_DIVDU(d, a, b) EMIT(PPC_INST_DIVDU | ___PPC_RT(d) | \ + ___PPC_RA(a) | ___PPC_RB(b)) + #define PPC_AND(d, a, b) EMIT(PPC_INST_AND | ___PPC_RA(d) | \ + ___PPC_RS(a) | ___PPC_RB(b)) +--- a/arch/powerpc/net/bpf_jit_comp64.c ++++ b/arch/powerpc/net/bpf_jit_comp64.c +@@ -415,12 +415,12 @@ static int bpf_jit_build_body(struct bpf + PPC_LI(b2p[BPF_REG_0], 0); + PPC_JMP(exit_addr); + if (BPF_OP(code) == BPF_MOD) { +- PPC_DIVD(b2p[TMP_REG_1], dst_reg, src_reg); ++ PPC_DIVDU(b2p[TMP_REG_1], dst_reg, src_reg); + PPC_MULD(b2p[TMP_REG_1], src_reg, + b2p[TMP_REG_1]); + PPC_SUB(dst_reg, dst_reg, b2p[TMP_REG_1]); + } else +- PPC_DIVD(dst_reg, dst_reg, src_reg); ++ PPC_DIVDU(dst_reg, dst_reg, src_reg); + break; + case BPF_ALU | BPF_MOD | BPF_K: /* (u32) dst %= (u32) imm */ + case BPF_ALU | BPF_DIV | BPF_K: /* (u32) dst /= (u32) imm */ +@@ -448,7 +448,7 @@ static int bpf_jit_build_body(struct bpf + break; + case BPF_ALU64: + if (BPF_OP(code) == BPF_MOD) { +- PPC_DIVD(b2p[TMP_REG_2], dst_reg, ++ PPC_DIVDU(b2p[TMP_REG_2], dst_reg, + b2p[TMP_REG_1]); + PPC_MULD(b2p[TMP_REG_1], + b2p[TMP_REG_1], +@@ -456,7 +456,7 @@ static int bpf_jit_build_body(struct bpf + PPC_SUB(dst_reg, dst_reg, + b2p[TMP_REG_1]); + } else +- PPC_DIVD(dst_reg, dst_reg, ++ PPC_DIVDU(dst_reg, dst_reg, + b2p[TMP_REG_1]); + break; + } diff --git a/queue-4.14/series b/queue-4.14/series index 502fdfe184..775fd312eb 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -9,3 +9,9 @@ ib-hfi1-silence-txreq-allocation-warnings.patch input-synaptics-enable-smbus-on-thinkpad-e480-and-e580.patch input-uinput-add-compat-ioctl-number-translation-for-ui_-_ff_upload.patch apparmor-enforce-nullbyte-at-end-of-tag-string.patch +btrfs-start-readahead-also-in-seed-devices.patch +can-flexcan-fix-timeout-when-set-small-bitrate.patch +can-purge-socket-error-queue-on-sock-destruct.patch +powerpc-bpf-use-unsigned-division-instruction-for-64-bit-operations.patch +arm-imx-cpuidle-imx6sx-restrict-the-sw2iso-increase-to-i.mx6sx.patch +arm-dts-am57xx-idk-remove-support-for-voltage-switching-for-sd-card.patch -- 2.39.2