From: Greg Kroah-Hartman Date: Sat, 8 Jul 2017 08:43:35 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v4.9.37~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0b0c535dc0964f96c0edc38eab89b9bc4f51ae72;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: gfs2-fix-glock-rhashtable-rcu-bug.patch usb-serial-option-add-two-longcheer-device-ids.patch usb-serial-qcserial-new-sierra-wireless-em7305-device-id.patch xhci-limit-usb2-port-wake-support-for-amd-promontory-hosts.patch --- diff --git a/queue-4.9/gfs2-fix-glock-rhashtable-rcu-bug.patch b/queue-4.9/gfs2-fix-glock-rhashtable-rcu-bug.patch new file mode 100644 index 00000000000..ccf1d3de03e --- /dev/null +++ b/queue-4.9/gfs2-fix-glock-rhashtable-rcu-bug.patch @@ -0,0 +1,62 @@ +From 961ae1d83d055a4b9ebbfb4cc8ca62ec1a7a3b74 Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher +Date: Fri, 7 Jul 2017 13:22:05 -0500 +Subject: gfs2: Fix glock rhashtable rcu bug + +From: Andreas Gruenbacher + +commit 961ae1d83d055a4b9ebbfb4cc8ca62ec1a7a3b74 upstream. + +Before commit 88ffbf3e03 "GFS2: Use resizable hash table for glocks", +glocks were freed via call_rcu to allow reading the glock hashtable +locklessly using rcu. This was then changed to free glocks immediately, +which made reading the glock hashtable unsafe. Bring back the original +code for freeing glocks via call_rcu. + +Signed-off-by: Andreas Gruenbacher +Signed-off-by: Bob Peterson +Signed-off-by: Greg Kroah-Hartman + +--- + fs/gfs2/glock.c | 11 +++++++++-- + fs/gfs2/incore.h | 1 + + 2 files changed, 10 insertions(+), 2 deletions(-) + +--- a/fs/gfs2/glock.c ++++ b/fs/gfs2/glock.c +@@ -80,9 +80,9 @@ static struct rhashtable_params ht_parms + + static struct rhashtable gl_hash_table; + +-void gfs2_glock_free(struct gfs2_glock *gl) ++static void gfs2_glock_dealloc(struct rcu_head *rcu) + { +- struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; ++ struct gfs2_glock *gl = container_of(rcu, struct gfs2_glock, gl_rcu); + + if (gl->gl_ops->go_flags & GLOF_ASPACE) { + kmem_cache_free(gfs2_glock_aspace_cachep, gl); +@@ -90,6 +90,13 @@ void gfs2_glock_free(struct gfs2_glock * + kfree(gl->gl_lksb.sb_lvbptr); + kmem_cache_free(gfs2_glock_cachep, gl); + } ++} ++ ++void gfs2_glock_free(struct gfs2_glock *gl) ++{ ++ struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; ++ ++ call_rcu(&gl->gl_rcu, gfs2_glock_dealloc); + if (atomic_dec_and_test(&sdp->sd_glock_disposal)) + wake_up(&sdp->sd_glock_wait); + } +--- a/fs/gfs2/incore.h ++++ b/fs/gfs2/incore.h +@@ -370,6 +370,7 @@ struct gfs2_glock { + loff_t end; + } gl_vm; + }; ++ struct rcu_head gl_rcu; + struct rhash_head gl_node; + }; + diff --git a/queue-4.9/series b/queue-4.9/series index 31b9aa93c0f..a7dc4a7d678 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -27,3 +27,7 @@ pinctrl-cherryview-add-terminate-entry-for-dmi_system_id-tables.patch pinctrl-mxs-atomically-switch-mux-and-drive-strength-config.patch pinctrl-sh-pfc-r8a7791-add-missing-hscif1-pinmux-data.patch pinctrl-sh-pfc-update-info-pointer-after-soc-specific-init.patch +usb-serial-option-add-two-longcheer-device-ids.patch +usb-serial-qcserial-new-sierra-wireless-em7305-device-id.patch +xhci-limit-usb2-port-wake-support-for-amd-promontory-hosts.patch +gfs2-fix-glock-rhashtable-rcu-bug.patch diff --git a/queue-4.9/usb-serial-option-add-two-longcheer-device-ids.patch b/queue-4.9/usb-serial-option-add-two-longcheer-device-ids.patch new file mode 100644 index 00000000000..99c8509a51b --- /dev/null +++ b/queue-4.9/usb-serial-option-add-two-longcheer-device-ids.patch @@ -0,0 +1,39 @@ +From 8fb060da715ad10fe956d7c0077b2fb0c12bb9d7 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Mon, 12 Jun 2017 16:30:16 +0200 +Subject: USB: serial: option: add two Longcheer device ids +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Johan Hovold + +commit 8fb060da715ad10fe956d7c0077b2fb0c12bb9d7 upstream. + +Add two Longcheer device-id entries which specifically enables a +Telewell TW-3G HSPA+ branded modem (0x9801). + +Reported-by: Teemu Likonen +Reported-by: Bjørn Mork +Reported-by: Lars Melin +Tested-by: Teemu Likonen +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/option.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -1877,6 +1877,10 @@ static const struct usb_device_id option + .driver_info = (kernel_ulong_t)&four_g_w100_blacklist + }, + { USB_DEVICE_INTERFACE_CLASS(LONGCHEER_VENDOR_ID, SPEEDUP_PRODUCT_SU9800, 0xff) }, ++ { USB_DEVICE_INTERFACE_CLASS(LONGCHEER_VENDOR_ID, 0x9801, 0xff), ++ .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, ++ { USB_DEVICE_INTERFACE_CLASS(LONGCHEER_VENDOR_ID, 0x9803, 0xff), ++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, + { USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) }, + { USB_DEVICE(LONGCHEER_VENDOR_ID, IBALL_3_5G_CONNECT) }, + { USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) }, diff --git a/queue-4.9/usb-serial-qcserial-new-sierra-wireless-em7305-device-id.patch b/queue-4.9/usb-serial-qcserial-new-sierra-wireless-em7305-device-id.patch new file mode 100644 index 00000000000..3aa50e62320 --- /dev/null +++ b/queue-4.9/usb-serial-qcserial-new-sierra-wireless-em7305-device-id.patch @@ -0,0 +1,33 @@ +From 996fab55d864ed604158f71724ff52db1c2454a3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= +Date: Tue, 13 Jun 2017 19:11:42 +0200 +Subject: USB: serial: qcserial: new Sierra Wireless EM7305 device ID +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Bjørn Mork + +commit 996fab55d864ed604158f71724ff52db1c2454a3 upstream. + +A new Sierra Wireless EM7305 device ID used in a Toshiba laptop. + +Reported-by: Petr Kloc +Signed-off-by: Bjørn Mork +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/qcserial.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/serial/qcserial.c ++++ b/drivers/usb/serial/qcserial.c +@@ -158,6 +158,7 @@ static const struct usb_device_id id_tab + {DEVICE_SWI(0x1199, 0x9056)}, /* Sierra Wireless Modem */ + {DEVICE_SWI(0x1199, 0x9060)}, /* Sierra Wireless Modem */ + {DEVICE_SWI(0x1199, 0x9061)}, /* Sierra Wireless Modem */ ++ {DEVICE_SWI(0x1199, 0x9063)}, /* Sierra Wireless EM7305 */ + {DEVICE_SWI(0x1199, 0x9070)}, /* Sierra Wireless MC74xx */ + {DEVICE_SWI(0x1199, 0x9071)}, /* Sierra Wireless MC74xx */ + {DEVICE_SWI(0x1199, 0x9078)}, /* Sierra Wireless EM74xx */ diff --git a/queue-4.9/xhci-limit-usb2-port-wake-support-for-amd-promontory-hosts.patch b/queue-4.9/xhci-limit-usb2-port-wake-support-for-amd-promontory-hosts.patch new file mode 100644 index 00000000000..d94e9458565 --- /dev/null +++ b/queue-4.9/xhci-limit-usb2-port-wake-support-for-amd-promontory-hosts.patch @@ -0,0 +1,79 @@ +From dec08194ffeccfa1cf085906b53d301930eae18f Mon Sep 17 00:00:00 2001 +From: Jiahau Chang +Date: Mon, 19 Jun 2017 13:08:30 +0300 +Subject: xhci: Limit USB2 port wake support for AMD Promontory hosts + +From: Jiahau Chang + +commit dec08194ffeccfa1cf085906b53d301930eae18f upstream. + +For AMD Promontory xHCI host, although you can disable USB 2.0 ports in +BIOS settings, those ports will be enabled anyway after you remove a +device on that port and re-plug it in again. It's a known limitation of +the chip. As a workaround we can clear the PORT_WAKE_BITS. + +This will disable wake on connect, disconnect and overcurrent on +AMD Promontory USB2 ports + +[checkpatch cleanup and commit message reword -Mathias] +Cc: Tsai Nicholas +Signed-off-by: Jiahau Chang +Signed-off-by: Mathias Nyman +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/xhci-hub.c | 3 +++ + drivers/usb/host/xhci-pci.c | 12 ++++++++++++ + drivers/usb/host/xhci.h | 1 + + 3 files changed, 16 insertions(+) + +--- a/drivers/usb/host/xhci-hub.c ++++ b/drivers/usb/host/xhci-hub.c +@@ -1348,6 +1348,9 @@ int xhci_bus_suspend(struct usb_hcd *hcd + t2 |= PORT_WKOC_E | PORT_WKCONN_E; + t2 &= ~PORT_WKDISC_E; + } ++ if ((xhci->quirks & XHCI_U2_DISABLE_WAKE) && ++ (hcd->speed < HCD_USB3)) ++ t2 &= ~PORT_WAKE_BITS; + } else + t2 &= ~PORT_WAKE_BITS; + +--- a/drivers/usb/host/xhci-pci.c ++++ b/drivers/usb/host/xhci-pci.c +@@ -54,6 +54,11 @@ + #define PCI_DEVICE_ID_INTEL_APL_XHCI 0x5aa8 + #define PCI_DEVICE_ID_INTEL_DNV_XHCI 0x19d0 + ++#define PCI_DEVICE_ID_AMD_PROMONTORYA_4 0x43b9 ++#define PCI_DEVICE_ID_AMD_PROMONTORYA_3 0x43ba ++#define PCI_DEVICE_ID_AMD_PROMONTORYA_2 0x43bb ++#define PCI_DEVICE_ID_AMD_PROMONTORYA_1 0x43bc ++ + static const char hcd_name[] = "xhci_hcd"; + + static struct hc_driver __read_mostly xhci_pci_hc_driver; +@@ -135,6 +140,13 @@ static void xhci_pci_quirks(struct devic + if (pdev->vendor == PCI_VENDOR_ID_AMD) + xhci->quirks |= XHCI_TRUST_TX_LENGTH; + ++ if ((pdev->vendor == PCI_VENDOR_ID_AMD) && ++ ((pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_4) || ++ (pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_3) || ++ (pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_2) || ++ (pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_1))) ++ xhci->quirks |= XHCI_U2_DISABLE_WAKE; ++ + if (pdev->vendor == PCI_VENDOR_ID_INTEL) { + xhci->quirks |= XHCI_LPM_SUPPORT; + xhci->quirks |= XHCI_INTEL_HOST; +--- a/drivers/usb/host/xhci.h ++++ b/drivers/usb/host/xhci.h +@@ -1660,6 +1660,7 @@ struct xhci_hcd { + /* For controller with a broken Port Disable implementation */ + #define XHCI_BROKEN_PORT_PED (1 << 25) + #define XHCI_LIMIT_ENDPOINT_INTERVAL_7 (1 << 26) ++#define XHCI_U2_DISABLE_WAKE (1 << 27) + + unsigned int num_active_eps; + unsigned int limit_active_eps;