From: Greg Kroah-Hartman Date: Thu, 18 May 2017 07:43:43 +0000 (+0200) Subject: 3.18-stable patches X-Git-Tag: v3.18.54~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cdc48289a3e224aea11ac600524d37f1e4f3621f;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: bluetooth-fix-user-channel-for-32bit-userspace-on-64bit-kernel.patch serial-omap-fix-runtime-pm-handling-on-unbind.patch serial-omap-suspend-device-on-probe-errors.patch --- diff --git a/queue-3.18/bluetooth-fix-user-channel-for-32bit-userspace-on-64bit-kernel.patch b/queue-3.18/bluetooth-fix-user-channel-for-32bit-userspace-on-64bit-kernel.patch new file mode 100644 index 00000000000..fa27bb8b872 --- /dev/null +++ b/queue-3.18/bluetooth-fix-user-channel-for-32bit-userspace-on-64bit-kernel.patch @@ -0,0 +1,35 @@ +From ab89f0bdd63a3721f7cd3f064f39fc4ac7ca14d4 Mon Sep 17 00:00:00 2001 +From: Szymon Janc +Date: Mon, 24 Apr 2017 18:25:04 -0700 +Subject: Bluetooth: Fix user channel for 32bit userspace on 64bit kernel + +From: Szymon Janc + +commit ab89f0bdd63a3721f7cd3f064f39fc4ac7ca14d4 upstream. + +Running 32bit userspace on 64bit kernel results in MSG_CMSG_COMPAT being +defined as 0x80000000. This results in sendmsg failure if used from 32bit +userspace running on 64bit kernel. Fix this by accounting for MSG_CMSG_COMPAT +in flags check in hci_sock_sendmsg. + +Signed-off-by: Szymon Janc +Signed-off-by: Marko Kiiskila +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman + +--- + net/bluetooth/hci_sock.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/net/bluetooth/hci_sock.c ++++ b/net/bluetooth/hci_sock.c +@@ -909,7 +909,8 @@ static int hci_sock_sendmsg(struct kiocb + if (msg->msg_flags & MSG_OOB) + return -EOPNOTSUPP; + +- if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_NOSIGNAL|MSG_ERRQUEUE)) ++ if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_NOSIGNAL|MSG_ERRQUEUE| ++ MSG_CMSG_COMPAT)) + return -EINVAL; + + if (len < 4 || len > HCI_MAX_FRAME_SIZE) diff --git a/queue-3.18/serial-omap-fix-runtime-pm-handling-on-unbind.patch b/queue-3.18/serial-omap-fix-runtime-pm-handling-on-unbind.patch new file mode 100644 index 00000000000..4e38ee6c856 --- /dev/null +++ b/queue-3.18/serial-omap-fix-runtime-pm-handling-on-unbind.patch @@ -0,0 +1,66 @@ +From 099bd73dc17ed77aa8c98323e043613b6e8f54fc Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Mon, 10 Apr 2017 11:21:38 +0200 +Subject: serial: omap: fix runtime-pm handling on unbind + +From: Johan Hovold + +commit 099bd73dc17ed77aa8c98323e043613b6e8f54fc upstream. + +An unbalanced and misplaced synchronous put was used to suspend the +device on driver unbind, something which with a likewise misplaced +pm_runtime_disable leads to external aborts when an open port is being +removed. + +Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa024010 +... +[] (serial_omap_set_mctrl) from [] (uart_update_mctrl+0x50/0x60) +[] (uart_update_mctrl) from [] (uart_shutdown+0xbc/0x138) +[] (uart_shutdown) from [] (uart_hangup+0x94/0x190) +[] (uart_hangup) from [] (__tty_hangup+0x404/0x41c) +[] (__tty_hangup) from [] (tty_vhangup+0x1c/0x20) +[] (tty_vhangup) from [] (uart_remove_one_port+0xec/0x260) +[] (uart_remove_one_port) from [] (serial_omap_remove+0x40/0x60) +[] (serial_omap_remove) from [] (platform_drv_remove+0x34/0x4c) + +Fix this up by resuming the device before deregistering the port and by +suspending and disabling runtime pm only after the port has been +removed. + +Also make sure to disable autosuspend before disabling runtime pm so +that the usage count is balanced and device actually suspended before +returning. + +Note that due to a negative autosuspend delay being set in probe, the +unbalanced put would actually suspend the device on first driver unbind, +while rebinding and again unbinding would result in a negative +power.usage_count. + +Fixes: 7e9c8e7dbf3b ("serial: omap: make sure to suspend device before remove") +Cc: Felipe Balbi +Cc: Santosh Shilimkar +Signed-off-by: Johan Hovold +Acked-by: Tony Lindgren +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/omap-serial.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/tty/serial/omap-serial.c ++++ b/drivers/tty/serial/omap-serial.c +@@ -1756,9 +1756,13 @@ static int serial_omap_remove(struct pla + { + struct uart_omap_port *up = platform_get_drvdata(dev); + ++ pm_runtime_get_sync(up->dev); ++ ++ uart_remove_one_port(&serial_omap_reg, &up->port); ++ ++ pm_runtime_dont_use_autosuspend(up->dev); + pm_runtime_put_sync(up->dev); + pm_runtime_disable(up->dev); +- uart_remove_one_port(&serial_omap_reg, &up->port); + pm_qos_remove_request(&up->pm_qos_request); + device_init_wakeup(&dev->dev, false); + diff --git a/queue-3.18/serial-omap-suspend-device-on-probe-errors.patch b/queue-3.18/serial-omap-suspend-device-on-probe-errors.patch new file mode 100644 index 00000000000..13d84c8fb40 --- /dev/null +++ b/queue-3.18/serial-omap-suspend-device-on-probe-errors.patch @@ -0,0 +1,38 @@ +From 77e6fe7fd2b7cba0bf2f2dc8cde51d7b9a35bf74 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Mon, 10 Apr 2017 11:21:39 +0200 +Subject: serial: omap: suspend device on probe errors + +From: Johan Hovold + +commit 77e6fe7fd2b7cba0bf2f2dc8cde51d7b9a35bf74 upstream. + +Make sure to actually suspend the device before returning after a failed +(or deferred) probe. + +Note that autosuspend must be disabled before runtime pm is disabled in +order to balance the usage count due to a negative autosuspend delay as +well as to make the final put suspend the device synchronously. + +Fixes: 388bc2622680 ("omap-serial: Fix the error handling in the omap_serial probe") +Cc: Shubhrajyoti D +Signed-off-by: Johan Hovold +Acked-by: Tony Lindgren +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/omap-serial.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/tty/serial/omap-serial.c ++++ b/drivers/tty/serial/omap-serial.c +@@ -1743,7 +1743,8 @@ static int serial_omap_probe(struct plat + return 0; + + err_add_port: +- pm_runtime_put(&pdev->dev); ++ pm_runtime_dont_use_autosuspend(&pdev->dev); ++ pm_runtime_put_sync(&pdev->dev); + pm_runtime_disable(&pdev->dev); + err_rs485: + err_port_line: diff --git a/queue-3.18/series b/queue-3.18/series index bfdd0e58717..defa135a7ad 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -24,3 +24,6 @@ cifs-fix-mapping-of-sfm_space-and-sfm_period.patch cifs-add-misssing-sfm-mapping-for-doublequote.patch padata-free-correct-variable.patch md-raid1-avoid-reusing-a-resync-bio-after-error-handling.patch +serial-omap-fix-runtime-pm-handling-on-unbind.patch +serial-omap-suspend-device-on-probe-errors.patch +bluetooth-fix-user-channel-for-32bit-userspace-on-64bit-kernel.patch