]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 23 Jun 2019 20:35:19 +0000 (22:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 23 Jun 2019 20:35:19 +0000 (22:35 +0200)
added patches:
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

queue-4.9/arm-imx-cpuidle-imx6sx-restrict-the-sw2iso-increase-to-i.mx6sx.patch [new file with mode: 0644]
queue-4.9/btrfs-start-readahead-also-in-seed-devices.patch [new file with mode: 0644]
queue-4.9/can-flexcan-fix-timeout-when-set-small-bitrate.patch [new file with mode: 0644]
queue-4.9/can-purge-socket-error-queue-on-sock-destruct.patch [new file with mode: 0644]
queue-4.9/powerpc-bpf-use-unsigned-division-instruction-for-64-bit-operations.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/arm-imx-cpuidle-imx6sx-restrict-the-sw2iso-increase-to-i.mx6sx.patch b/queue-4.9/arm-imx-cpuidle-imx6sx-restrict-the-sw2iso-increase-to-i.mx6sx.patch
new file mode 100644 (file)
index 0000000..2960fd2
--- /dev/null
@@ -0,0 +1,55 @@
+From b25af2ff7c07bd19af74e3f64ff82e2880d13d81 Mon Sep 17 00:00:00 2001
+From: Fabio Estevam <festevam@gmail.com>
+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 <festevam@gmail.com>
+
+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 <cniedermaier@dh-electronics.com>
+Signed-off-by: Fabio Estevam <festevam@gmail.com>
+Tested-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
+Tested-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
+Signed-off-by: Shawn Guo <shawnguo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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.9/btrfs-start-readahead-also-in-seed-devices.patch b/queue-4.9/btrfs-start-readahead-also-in-seed-devices.patch
new file mode 100644 (file)
index 0000000..7f35415
--- /dev/null
@@ -0,0 +1,49 @@
+From c4e0540d0ad49c8ceab06cceed1de27c4fe29f6e Mon Sep 17 00:00:00 2001
+From: Naohiro Aota <naohiro.aota@wdc.com>
+Date: Thu, 6 Jun 2019 16:54:44 +0900
+Subject: btrfs: start readahead also in seed devices
+
+From: Naohiro Aota <naohiro.aota@wdc.com>
+
+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 <fdmanana@suse.com>
+Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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);
+@@ -771,6 +772,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.9/can-flexcan-fix-timeout-when-set-small-bitrate.patch b/queue-4.9/can-flexcan-fix-timeout-when-set-small-bitrate.patch
new file mode 100644 (file)
index 0000000..506e945
--- /dev/null
@@ -0,0 +1,55 @@
+From 247e5356a709eb49a0d95ff2a7f07dac05c8252c Mon Sep 17 00:00:00 2001
+From: Joakim Zhang <qiangqing.zhang@nxp.com>
+Date: Thu, 31 Jan 2019 09:37:22 +0000
+Subject: can: flexcan: fix timeout when set small bitrate
+
+From: Joakim Zhang <qiangqing.zhang@nxp.com>
+
+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 <qiangqing.zhang@nxp.com>
+Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
+Cc: linux-stable <stable@vger.kernel.org>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -171,7 +171,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.9/can-purge-socket-error-queue-on-sock-destruct.patch b/queue-4.9/can-purge-socket-error-queue-on-sock-destruct.patch
new file mode 100644 (file)
index 0000000..27cfa58
--- /dev/null
@@ -0,0 +1,33 @@
+From fd704bd5ee749d560e86c4f1fd2ef486d8abf7cf Mon Sep 17 00:00:00 2001
+From: Willem de Bruijn <willemb@google.com>
+Date: Fri, 7 Jun 2019 16:46:07 -0400
+Subject: can: purge socket error queue on sock destruct
+
+From: Willem de Bruijn <willemb@google.com>
+
+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 <willemb@google.com>
+Cc: linux-stable <stable@vger.kernel.org>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/can/af_can.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/net/can/af_can.c
++++ b/net/can/af_can.c
+@@ -113,6 +113,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.9/powerpc-bpf-use-unsigned-division-instruction-for-64-bit-operations.patch b/queue-4.9/powerpc-bpf-use-unsigned-division-instruction-for-64-bit-operations.patch
new file mode 100644 (file)
index 0000000..e32d282
--- /dev/null
@@ -0,0 +1,81 @@
+From 758f2046ea040773ae8ea7f72dd3bbd8fa984501 Mon Sep 17 00:00:00 2001
+From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
+Date: Thu, 13 Jun 2019 00:21:40 +0530
+Subject: powerpc/bpf: use unsigned division instruction for 64-bit operations
+
+From: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
+
+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 <naveen.n.rao@linux.vnet.ibm.com>
+Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -261,6 +261,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
+@@ -419,12 +419,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 */
+@@ -452,7 +452,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],
+@@ -460,7 +460,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;
+                       }
index beb679c86d5c1d6e2f008fed2673a4e92f43a852..eb6e8603b89486916035eadb6307b2fe1e2ec06c 100644 (file)
@@ -5,3 +5,8 @@ usb-chipidea-udc-workaround-for-endpoint-conflict-issue.patch
 ib-hfi1-silence-txreq-allocation-warnings.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