]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 23 Jun 2019 20:35:17 +0000 (22:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 23 Jun 2019 20:35:17 +0000 (22:35 +0200)
added patches:
arm-imx-cpuidle-imx6sx-restrict-the-sw2iso-increase-to-i.mx6sx.patch
btrfs-fix-race-between-readahead-and-device-replace-removal.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

queue-4.4/arm-imx-cpuidle-imx6sx-restrict-the-sw2iso-increase-to-i.mx6sx.patch [new file with mode: 0644]
queue-4.4/btrfs-fix-race-between-readahead-and-device-replace-removal.patch [new file with mode: 0644]
queue-4.4/btrfs-start-readahead-also-in-seed-devices.patch [new file with mode: 0644]
queue-4.4/can-flexcan-fix-timeout-when-set-small-bitrate.patch [new file with mode: 0644]
queue-4.4/can-purge-socket-error-queue-on-sock-destruct.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/arm-imx-cpuidle-imx6sx-restrict-the-sw2iso-increase-to-i.mx6sx.patch b/queue-4.4/arm-imx-cpuidle-imx6sx-restrict-the-sw2iso-increase-to-i.mx6sx.patch
new file mode 100644 (file)
index 0000000..176e8e6
--- /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
+@@ -14,6 +14,7 @@
+ #include "common.h"
+ #include "cpuidle.h"
++#include "hardware.h"
+ static int imx6sx_idle_finish(unsigned long val)
+ {
+@@ -97,7 +98,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.4/btrfs-fix-race-between-readahead-and-device-replace-removal.patch b/queue-4.4/btrfs-fix-race-between-readahead-and-device-replace-removal.patch
new file mode 100644 (file)
index 0000000..6d13fd6
--- /dev/null
@@ -0,0 +1,81 @@
+From ce7791ffee1e1ee9f97193b817c7dd1fa6746aad Mon Sep 17 00:00:00 2001
+From: Filipe Manana <fdmanana@suse.com>
+Date: Fri, 20 May 2016 01:57:20 +0100
+Subject: Btrfs: fix race between readahead and device replace/removal
+
+From: Filipe Manana <fdmanana@suse.com>
+
+commit ce7791ffee1e1ee9f97193b817c7dd1fa6746aad upstream.
+
+The list of devices is protected by the device_list_mutex and the device
+replace code, in its finishing phase correctly takes that mutex before
+removing the source device from that list. However the readahead code was
+iterating that list without acquiring the respective mutex leading to
+crashes later on due to invalid memory accesses:
+
+[125671.831036] general protection fault: 0000 [#1] PREEMPT SMP
+[125671.832129] Modules linked in: btrfs dm_flakey dm_mod crc32c_generic xor raid6_pq acpi_cpufreq tpm_tis tpm ppdev evdev parport_pc psmouse sg parport
+processor ser
+[125671.834973] CPU: 10 PID: 19603 Comm: kworker/u32:19 Tainted: G        W       4.6.0-rc7-btrfs-next-29+ #1
+[125671.834973] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS by qemu-project.org 04/01/2014
+[125671.834973] Workqueue: btrfs-readahead btrfs_readahead_helper [btrfs]
+[125671.834973] task: ffff8801ac520540 ti: ffff8801ac918000 task.ti: ffff8801ac918000
+[125671.834973] RIP: 0010:[<ffffffff81270479>]  [<ffffffff81270479>] __radix_tree_lookup+0x6a/0x105
+[125671.834973] RSP: 0018:ffff8801ac91bc28  EFLAGS: 00010206
+[125671.834973] RAX: 0000000000000000 RBX: 6b6b6b6b6b6b6b6a RCX: 0000000000000000
+[125671.834973] RDX: 0000000000000000 RSI: 00000000000c1bff RDI: ffff88002ebd62a8
+[125671.834973] RBP: ffff8801ac91bc70 R08: 0000000000000001 R09: 0000000000000000
+[125671.834973] R10: ffff8801ac91bc70 R11: 0000000000000000 R12: ffff88002ebd62a8
+[125671.834973] R13: 0000000000000000 R14: 0000000000000000 R15: 00000000000c1bff
+[125671.834973] FS:  0000000000000000(0000) GS:ffff88023fd40000(0000) knlGS:0000000000000000
+[125671.834973] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+[125671.834973] CR2: 000000000073cae4 CR3: 00000000b7723000 CR4: 00000000000006e0
+[125671.834973] Stack:
+[125671.834973]  0000000000000000 ffff8801422d5600 ffff8802286bbc00 0000000000000000
+[125671.834973]  0000000000000001 ffff8802286bbc00 00000000000c1bff 0000000000000000
+[125671.834973]  ffff88002e639eb8 ffff8801ac91bc80 ffffffff81270541 ffff8801ac91bcb0
+[125671.834973] Call Trace:
+[125671.834973]  [<ffffffff81270541>] radix_tree_lookup+0xd/0xf
+[125671.834973]  [<ffffffffa04ae6a6>] reada_peer_zones_set_lock+0x3e/0x60 [btrfs]
+[125671.834973]  [<ffffffffa04ae8b9>] reada_pick_zone+0x29/0x103 [btrfs]
+[125671.834973]  [<ffffffffa04af42f>] reada_start_machine_worker+0x129/0x2d3 [btrfs]
+[125671.834973]  [<ffffffffa04880be>] btrfs_scrubparity_helper+0x185/0x3aa [btrfs]
+[125671.834973]  [<ffffffffa0488341>] btrfs_readahead_helper+0xe/0x10 [btrfs]
+[125671.834973]  [<ffffffff81069691>] process_one_work+0x271/0x4e9
+[125671.834973]  [<ffffffff81069dda>] worker_thread+0x1eb/0x2c9
+[125671.834973]  [<ffffffff81069bef>] ? rescuer_thread+0x2b3/0x2b3
+[125671.834973]  [<ffffffff8106f403>] kthread+0xd4/0xdc
+[125671.834973]  [<ffffffff8149e242>] ret_from_fork+0x22/0x40
+[125671.834973]  [<ffffffff8106f32f>] ? kthread_stop+0x286/0x286
+
+So fix this by taking the device_list_mutex in the readahead code. We
+can't use here the lighter approach of using a rcu_read_lock() and
+rcu_read_unlock() pair together with a list_for_each_entry_rcu() call
+because we end up doing calls to sleeping functions (kzalloc()) in the
+respective code path.
+
+Signed-off-by: Filipe Manana <fdmanana@suse.com>
+Reviewed-by: Josef Bacik <jbacik@fb.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/btrfs/reada.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/fs/btrfs/reada.c
++++ b/fs/btrfs/reada.c
+@@ -764,12 +764,14 @@ static void __reada_start_machine(struct
+       do {
+               enqueued = 0;
++              mutex_lock(&fs_devices->device_list_mutex);
+               list_for_each_entry(device, &fs_devices->devices, dev_list) {
+                       if (atomic_read(&device->reada_in_flight) <
+                           MAX_IN_FLIGHT)
+                               enqueued += reada_start_machine_dev(fs_info,
+                                                                   device);
+               }
++              mutex_unlock(&fs_devices->device_list_mutex);
+               total += enqueued;
+       } while (enqueued && total < 10000);
diff --git a/queue-4.4/btrfs-start-readahead-also-in-seed-devices.patch b/queue-4.4/btrfs-start-readahead-also-in-seed-devices.patch
new file mode 100644 (file)
index 0000000..cd62246
--- /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
+@@ -762,6 +762,7 @@ static void __reada_start_machine(struct
+       u64 total = 0;
+       int i;
++again:
+       do {
+               enqueued = 0;
+               mutex_lock(&fs_devices->device_list_mutex);
+@@ -774,6 +775,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.4/can-flexcan-fix-timeout-when-set-small-bitrate.patch b/queue-4.4/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.4/can-purge-socket-error-queue-on-sock-destruct.patch b/queue-4.4/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)
index cea4d04f73e480afb1c9aae7f288341c64bbb9c7..afa3def815899a4187d9b6c74705b4d1663ced93 100644 (file)
@@ -3,3 +3,8 @@ gcc-9-silence-address-of-packed-member-warning.patch
 usb-chipidea-udc-workaround-for-endpoint-conflict-issue.patch
 input-uinput-add-compat-ioctl-number-translation-for-ui_-_ff_upload.patch
 apparmor-enforce-nullbyte-at-end-of-tag-string.patch
+btrfs-fix-race-between-readahead-and-device-replace-removal.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
+arm-imx-cpuidle-imx6sx-restrict-the-sw2iso-increase-to-i.mx6sx.patch