From b143f5bcabdf47f165cc292193cda3daa458a917 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 27 Jan 2019 16:25:01 +0100 Subject: [PATCH] 3.18-stable patches added patches: s390-smp-fix-cpu-hotplug-deadlock-with-cpu-rescan.patch staging-rtl8188eu-add-device-code-for-d-link-dwa-121-rev-b1.patch usb-serial-pl2303-add-new-pid-to-support-pl2303tb.patch usb-serial-simple-add-motorola-tetra-tpg2200-device-id.patch --- ...cpu-hotplug-deadlock-with-cpu-rescan.patch | 84 +++++++++++++++++++ queue-3.18/series | 4 + ...evice-code-for-d-link-dwa-121-rev-b1.patch | 32 +++++++ ...2303-add-new-pid-to-support-pl2303tb.patch | 49 +++++++++++ ...add-motorola-tetra-tpg2200-device-id.patch | 41 +++++++++ 5 files changed, 210 insertions(+) create mode 100644 queue-3.18/s390-smp-fix-cpu-hotplug-deadlock-with-cpu-rescan.patch create mode 100644 queue-3.18/staging-rtl8188eu-add-device-code-for-d-link-dwa-121-rev-b1.patch create mode 100644 queue-3.18/usb-serial-pl2303-add-new-pid-to-support-pl2303tb.patch create mode 100644 queue-3.18/usb-serial-simple-add-motorola-tetra-tpg2200-device-id.patch diff --git a/queue-3.18/s390-smp-fix-cpu-hotplug-deadlock-with-cpu-rescan.patch b/queue-3.18/s390-smp-fix-cpu-hotplug-deadlock-with-cpu-rescan.patch new file mode 100644 index 00000000000..42a76c5adce --- /dev/null +++ b/queue-3.18/s390-smp-fix-cpu-hotplug-deadlock-with-cpu-rescan.patch @@ -0,0 +1,84 @@ +From b7cb707c373094ce4008d4a6ac9b6b366ec52da5 Mon Sep 17 00:00:00 2001 +From: Gerald Schaefer +Date: Wed, 9 Jan 2019 13:00:03 +0100 +Subject: s390/smp: fix CPU hotplug deadlock with CPU rescan + +From: Gerald Schaefer + +commit b7cb707c373094ce4008d4a6ac9b6b366ec52da5 upstream. + +smp_rescan_cpus() is called without the device_hotplug_lock, which can lead +to a dedlock when a new CPU is found and immediately set online by a udev +rule. + +This was observed on an older kernel version, where the cpu_hotplug_begin() +loop was still present, and it resulted in hanging chcpu and systemd-udev +processes. This specific deadlock will not show on current kernels. However, +there may be other possible deadlocks, and since smp_rescan_cpus() can still +trigger a CPU hotplug operation, the device_hotplug_lock should be held. + +For reference, this was the deadlock with the old cpu_hotplug_begin() loop: + + chcpu (rescan) systemd-udevd + + echo 1 > /sys/../rescan + -> smp_rescan_cpus() + -> (*) get_online_cpus() + (increases refcount) + -> smp_add_present_cpu() + (new CPU found) + -> register_cpu() + -> device_add() + -> udev "add" event triggered -----------> udev rule sets CPU online + -> echo 1 > /sys/.../online + -> lock_device_hotplug_sysfs() + (this is missing in rescan path) + -> device_online() + -> (**) device_lock(new CPU dev) + -> cpu_up() + -> cpu_hotplug_begin() + (loops until refcount == 0) + -> deadlock with (*) + -> bus_probe_device() + -> device_attach() + -> device_lock(new CPU dev) + -> deadlock with (**) + +Fix this by taking the device_hotplug_lock in the CPU rescan path. + +Cc: +Signed-off-by: Gerald Schaefer +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman + +--- + arch/s390/kernel/smp.c | 4 ++++ + drivers/s390/char/sclp_config.c | 2 ++ + 2 files changed, 6 insertions(+) + +--- a/arch/s390/kernel/smp.c ++++ b/arch/s390/kernel/smp.c +@@ -1014,7 +1014,11 @@ static ssize_t __ref rescan_store(struct + { + int rc; + ++ rc = lock_device_hotplug_sysfs(); ++ if (rc) ++ return rc; + rc = smp_rescan_cpus(); ++ unlock_device_hotplug(); + return rc ? rc : count; + } + static DEVICE_ATTR(rescan, 0200, NULL, rescan_store); +--- a/drivers/s390/char/sclp_config.c ++++ b/drivers/s390/char/sclp_config.c +@@ -43,7 +43,9 @@ static void sclp_cpu_capability_notify(s + + static void __ref sclp_cpu_change_notify(struct work_struct *work) + { ++ lock_device_hotplug(); + smp_rescan_cpus(); ++ unlock_device_hotplug(); + } + + static void sclp_conf_receiver_fn(struct evbuf_header *evbuf) diff --git a/queue-3.18/series b/queue-3.18/series index f3b12ce7d64..16e21b20bf6 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -1 +1,5 @@ openvswitch-avoid-oob-read-when-parsing-flow-nlattrs.patch +usb-serial-simple-add-motorola-tetra-tpg2200-device-id.patch +usb-serial-pl2303-add-new-pid-to-support-pl2303tb.patch +s390-smp-fix-cpu-hotplug-deadlock-with-cpu-rescan.patch +staging-rtl8188eu-add-device-code-for-d-link-dwa-121-rev-b1.patch diff --git a/queue-3.18/staging-rtl8188eu-add-device-code-for-d-link-dwa-121-rev-b1.patch b/queue-3.18/staging-rtl8188eu-add-device-code-for-d-link-dwa-121-rev-b1.patch new file mode 100644 index 00000000000..867371e5144 --- /dev/null +++ b/queue-3.18/staging-rtl8188eu-add-device-code-for-d-link-dwa-121-rev-b1.patch @@ -0,0 +1,32 @@ +From 5f74a8cbb38d10615ed46bc3e37d9a4c9af8045a Mon Sep 17 00:00:00 2001 +From: Michael Straube +Date: Mon, 7 Jan 2019 18:28:58 +0100 +Subject: staging: rtl8188eu: Add device code for D-Link DWA-121 rev B1 + +From: Michael Straube + +commit 5f74a8cbb38d10615ed46bc3e37d9a4c9af8045a upstream. + +This device was added to the stand-alone driver on github. +Add it to the staging driver as well. + +Link: https://github.com/lwfinger/rtl8188eu/commit/a0619a07cd1e +Signed-off-by: Michael Straube +Acked-by: Larry Finger +Cc: stable +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/rtl8188eu/os_dep/usb_intf.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c ++++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c +@@ -48,6 +48,7 @@ static struct usb_device_id rtw_usb_id_t + {USB_DEVICE(0x2001, 0x330F)}, /* DLink DWA-125 REV D1 */ + {USB_DEVICE(0x2001, 0x3310)}, /* Dlink DWA-123 REV D1 */ + {USB_DEVICE(0x2001, 0x3311)}, /* DLink GO-USB-N150 REV B1 */ ++ {USB_DEVICE(0x2001, 0x331B)}, /* D-Link DWA-121 rev B1 */ + {USB_DEVICE(0x2357, 0x010c)}, /* TP-Link TL-WN722N v2 */ + {USB_DEVICE(0x0df6, 0x0076)}, /* Sitecom N150 v2 */ + {USB_DEVICE(USB_VENDER_ID_REALTEK, 0xffef)}, /* Rosewill RNX-N150NUB */ diff --git a/queue-3.18/usb-serial-pl2303-add-new-pid-to-support-pl2303tb.patch b/queue-3.18/usb-serial-pl2303-add-new-pid-to-support-pl2303tb.patch new file mode 100644 index 00000000000..190a4f088bf --- /dev/null +++ b/queue-3.18/usb-serial-pl2303-add-new-pid-to-support-pl2303tb.patch @@ -0,0 +1,49 @@ +From 4dcf9ddc9ad5ab649abafa98c5a4d54b1a33dabb Mon Sep 17 00:00:00 2001 +From: Charles Yeh +Date: Tue, 15 Jan 2019 23:13:56 +0800 +Subject: USB: serial: pl2303: add new PID to support PL2303TB + +From: Charles Yeh + +commit 4dcf9ddc9ad5ab649abafa98c5a4d54b1a33dabb upstream. + +Add new PID to support PL2303TB (TYPE_HX) + +Signed-off-by: Charles Yeh +Cc: stable +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/pl2303.c | 1 + + drivers/usb/serial/pl2303.h | 2 ++ + 2 files changed, 3 insertions(+) + +--- a/drivers/usb/serial/pl2303.c ++++ b/drivers/usb/serial/pl2303.c +@@ -47,6 +47,7 @@ static const struct usb_device_id id_tab + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_HCR331) }, + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MOTOROLA) }, + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ZTEK) }, ++ { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_TB) }, + { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, + { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, + { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, +--- a/drivers/usb/serial/pl2303.h ++++ b/drivers/usb/serial/pl2303.h +@@ -13,6 +13,7 @@ + + #define PL2303_VENDOR_ID 0x067b + #define PL2303_PRODUCT_ID 0x2303 ++#define PL2303_PRODUCT_ID_TB 0x2304 + #define PL2303_PRODUCT_ID_RSAQ2 0x04bb + #define PL2303_PRODUCT_ID_DCU11 0x1234 + #define PL2303_PRODUCT_ID_PHAROS 0xaaa0 +@@ -25,6 +26,7 @@ + #define PL2303_PRODUCT_ID_MOTOROLA 0x0307 + #define PL2303_PRODUCT_ID_ZTEK 0xe1f1 + ++ + #define ATEN_VENDOR_ID 0x0557 + #define ATEN_VENDOR_ID2 0x0547 + #define ATEN_PRODUCT_ID 0x2008 diff --git a/queue-3.18/usb-serial-simple-add-motorola-tetra-tpg2200-device-id.patch b/queue-3.18/usb-serial-simple-add-motorola-tetra-tpg2200-device-id.patch new file mode 100644 index 00000000000..8cfbd00c5e7 --- /dev/null +++ b/queue-3.18/usb-serial-simple-add-motorola-tetra-tpg2200-device-id.patch @@ -0,0 +1,41 @@ +From b81c2c33eab79dfd3650293b2227ee5c6036585c Mon Sep 17 00:00:00 2001 +From: Max Schulze +Date: Mon, 7 Jan 2019 08:31:49 +0100 +Subject: USB: serial: simple: add Motorola Tetra TPG2200 device id + +From: Max Schulze + +commit b81c2c33eab79dfd3650293b2227ee5c6036585c upstream. + +Add new Motorola Tetra device id for Motorola Solutions TETRA PEI device + +T: Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 4 Spd=480 MxCh= 0 +D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 +P: Vendor=0cad ProdID=9016 Rev=24.16 +S: Manufacturer=Motorola Solutions, Inc. +S: Product=TETRA PEI interface +C: #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=500mA +I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=usb_serial_simple +I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=usb_serial_simple + +Signed-off-by: Max Schulze +Cc: stable +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/usb-serial-simple.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/usb/serial/usb-serial-simple.c ++++ b/drivers/usb/serial/usb-serial-simple.c +@@ -75,7 +75,8 @@ DEVICE(moto_modem, MOTO_IDS); + /* Motorola Tetra driver */ + #define MOTOROLA_TETRA_IDS() \ + { USB_DEVICE(0x0cad, 0x9011) }, /* Motorola Solutions TETRA PEI */ \ +- { USB_DEVICE(0x0cad, 0x9012) } /* MTP6550 */ ++ { USB_DEVICE(0x0cad, 0x9012) }, /* MTP6550 */ \ ++ { USB_DEVICE(0x0cad, 0x9016) } /* TPG2200 */ + DEVICE(motorola_tetra, MOTOROLA_TETRA_IDS); + + /* Novatel Wireless GPS driver */ -- 2.47.2