From: Greg Kroah-Hartman Date: Sun, 8 May 2016 13:05:02 +0000 (+0200) Subject: 4.5-stable patches X-Git-Tag: v3.14.69~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4541c2c3b1554af9dd77812b868e3ad59651eb92;p=thirdparty%2Fkernel%2Fstable-queue.git 4.5-stable patches added patches: drivers-hv-vmbus-fix-signaling-logic-in-hv_need_to_signal_on_read.patch nvmem-mxs-ocotp-fix-buffer-overflow-in-read.patch revert-usb-pm-allow-usb-devices-to-remain-runtime-suspended-when-sleeping.patch usb-serial-cp210x-add-id-for-link-ecu.patch usb-serial-cp210x-add-straizona-focusers-device-ids.patch --- diff --git a/queue-4.5/drivers-hv-vmbus-fix-signaling-logic-in-hv_need_to_signal_on_read.patch b/queue-4.5/drivers-hv-vmbus-fix-signaling-logic-in-hv_need_to_signal_on_read.patch new file mode 100644 index 00000000000..a625ce25c49 --- /dev/null +++ b/queue-4.5/drivers-hv-vmbus-fix-signaling-logic-in-hv_need_to_signal_on_read.patch @@ -0,0 +1,85 @@ +From 1db488d12894f1936360779d6ab2aede3dd7f06a Mon Sep 17 00:00:00 2001 +From: "K. Y. Srinivasan" +Date: Sat, 2 Apr 2016 16:17:38 -0700 +Subject: Drivers: hv: vmbus: Fix signaling logic in hv_need_to_signal_on_read() + +From: K. Y. Srinivasan + +commit 1db488d12894f1936360779d6ab2aede3dd7f06a upstream. + +On the consumer side, we have interrupt driven flow management of the +producer. It is sufficient to base the signaling decision on the +amount of space that is available to write after the read is complete. +The current code samples the previous available space and uses this +in making the signaling decision. This state can be stale and is +unnecessary. Since the state can be stale, we end up not signaling +the host (when we should) and this can result in a hang. Fix this +problem by removing the unnecessary check. I would like to thank +Arseney Romanenko for pointing out this issue. + +Also, issue a full memory barrier before making the signaling descision +to correctly deal with potential reordering of the write (read index) +followed by the read of pending_sz. + +Signed-off-by: K. Y. Srinivasan +Tested-by: Dexuan Cui +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hv/ring_buffer.c | 26 ++++++++++++++++++++------ + 1 file changed, 20 insertions(+), 6 deletions(-) + +--- a/drivers/hv/ring_buffer.c ++++ b/drivers/hv/ring_buffer.c +@@ -103,15 +103,29 @@ static bool hv_need_to_signal(u32 old_wr + * there is room for the producer to send the pending packet. + */ + +-static bool hv_need_to_signal_on_read(u32 prev_write_sz, +- struct hv_ring_buffer_info *rbi) ++static bool hv_need_to_signal_on_read(struct hv_ring_buffer_info *rbi) + { + u32 cur_write_sz; + u32 r_size; +- u32 write_loc = rbi->ring_buffer->write_index; ++ u32 write_loc; + u32 read_loc = rbi->ring_buffer->read_index; +- u32 pending_sz = rbi->ring_buffer->pending_send_sz; ++ u32 pending_sz; + ++ /* ++ * Issue a full memory barrier before making the signaling decision. ++ * Here is the reason for having this barrier: ++ * If the reading of the pend_sz (in this function) ++ * were to be reordered and read before we commit the new read ++ * index (in the calling function) we could ++ * have a problem. If the host were to set the pending_sz after we ++ * have sampled pending_sz and go to sleep before we commit the ++ * read index, we could miss sending the interrupt. Issue a full ++ * memory barrier to address this. ++ */ ++ mb(); ++ ++ pending_sz = rbi->ring_buffer->pending_send_sz; ++ write_loc = rbi->ring_buffer->write_index; + /* If the other end is not blocked on write don't bother. */ + if (pending_sz == 0) + return false; +@@ -120,7 +134,7 @@ static bool hv_need_to_signal_on_read(u3 + cur_write_sz = write_loc >= read_loc ? r_size - (write_loc - read_loc) : + read_loc - write_loc; + +- if ((prev_write_sz < pending_sz) && (cur_write_sz >= pending_sz)) ++ if (cur_write_sz >= pending_sz) + return true; + + return false; +@@ -458,7 +472,7 @@ int hv_ringbuffer_read(struct hv_ring_bu + /* Update the read index */ + hv_set_next_read_location(inring_info, next_read_location); + +- *signal = hv_need_to_signal_on_read(bytes_avail_towrite, inring_info); ++ *signal = hv_need_to_signal_on_read(inring_info); + + out_unlock: + spin_unlock_irqrestore(&inring_info->ring_lock, flags); diff --git a/queue-4.5/nvmem-mxs-ocotp-fix-buffer-overflow-in-read.patch b/queue-4.5/nvmem-mxs-ocotp-fix-buffer-overflow-in-read.patch new file mode 100644 index 00000000000..a3367e6f2ed --- /dev/null +++ b/queue-4.5/nvmem-mxs-ocotp-fix-buffer-overflow-in-read.patch @@ -0,0 +1,44 @@ +From d1306eb675ad7a9a760b6b8e8e189824b8db89e7 Mon Sep 17 00:00:00 2001 +From: Stanislav Meduna +Date: Mon, 2 May 2016 16:05:11 +0100 +Subject: nvmem: mxs-ocotp: fix buffer overflow in read + +From: Stanislav Meduna + +commit d1306eb675ad7a9a760b6b8e8e189824b8db89e7 upstream. + +This patch fixes the issue where the mxs_ocotp_read is reading +the ocotp in reg_size steps but decrements the remaining size +by 1. The number of iterations is thus four times higher, +overwriting the area behind the output buffer. + +Fixes: c01e9a11ab6f ("nvmem: add driver for ocotp in i.MX23 and i.MX28") +Tested-by: Stefan Wahren +Signed-off-by: Stanislav Meduna +Signed-off-by: Srinivas Kandagatla +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/nvmem/mxs-ocotp.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/nvmem/mxs-ocotp.c ++++ b/drivers/nvmem/mxs-ocotp.c +@@ -94,7 +94,7 @@ static int mxs_ocotp_read(void *context, + if (ret) + goto close_banks; + +- while (val_size) { ++ while (val_size >= reg_size) { + if ((offset < OCOTP_DATA_OFFSET) || (offset % 16)) { + /* fill up non-data register */ + *buf = 0; +@@ -103,7 +103,7 @@ static int mxs_ocotp_read(void *context, + } + + buf++; +- val_size--; ++ val_size -= reg_size; + offset += reg_size; + } + diff --git a/queue-4.5/revert-usb-pm-allow-usb-devices-to-remain-runtime-suspended-when-sleeping.patch b/queue-4.5/revert-usb-pm-allow-usb-devices-to-remain-runtime-suspended-when-sleeping.patch new file mode 100644 index 00000000000..ac5c532cfb4 --- /dev/null +++ b/queue-4.5/revert-usb-pm-allow-usb-devices-to-remain-runtime-suspended-when-sleeping.patch @@ -0,0 +1,69 @@ +From 9be427efc764464fbcbc1ca3f0d34f575cb0f037 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Mon, 2 May 2016 15:35:57 +0200 +Subject: Revert "USB / PM: Allow USB devices to remain runtime-suspended when sleeping" + +From: Johan Hovold + +commit 9be427efc764464fbcbc1ca3f0d34f575cb0f037 upstream. + +This reverts commit e3345db85068ddb937fc0ba40dfc39c293dad977, which +broke system resume for a large class of devices. + +Devices that after having been reset during resume need to be rebound +due to a missing reset_resume callback, are now left in a suspended +state. This specifically broke resume of common USB-serial devices, +which are now unusable after system suspend (until disconnected and +reconnected) when USB persist is enabled. + +During resume, usb_resume_interface will set the needs_binding flag for +such interfaces, but unlike system resume, run-time resume does not +honour it. + +Signed-off-by: Johan Hovold +Acked-by: Alan Stern +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/core/port.c | 6 ------ + drivers/usb/core/usb.c | 8 +------- + 2 files changed, 1 insertion(+), 13 deletions(-) + +--- a/drivers/usb/core/port.c ++++ b/drivers/usb/core/port.c +@@ -249,18 +249,12 @@ static int usb_port_runtime_suspend(stru + + return retval; + } +- +-static int usb_port_prepare(struct device *dev) +-{ +- return 1; +-} + #endif + + static const struct dev_pm_ops usb_port_pm_ops = { + #ifdef CONFIG_PM + .runtime_suspend = usb_port_runtime_suspend, + .runtime_resume = usb_port_runtime_resume, +- .prepare = usb_port_prepare, + #endif + }; + +--- a/drivers/usb/core/usb.c ++++ b/drivers/usb/core/usb.c +@@ -311,13 +311,7 @@ static int usb_dev_uevent(struct device + + static int usb_dev_prepare(struct device *dev) + { +- struct usb_device *udev = to_usb_device(dev); +- +- /* Return 0 if the current wakeup setting is wrong, otherwise 1 */ +- if (udev->do_remote_wakeup != device_may_wakeup(dev)) +- return 0; +- +- return 1; ++ return 0; /* Implement eventually? */ + } + + static void usb_dev_complete(struct device *dev) diff --git a/queue-4.5/series b/queue-4.5/series index 418c2b46122..75163b5c225 100644 --- a/queue-4.5/series +++ b/queue-4.5/series @@ -68,3 +68,8 @@ acpica-dispatcher-update-thread-id-for-recursive-method-calls.patch powerpc-fix-bad-inline-asm-constraint-in-create_zero_mask.patch libahci-save-port-map-for-forced-port-map.patch ata-ahci-platform-add-ports-implemented-dt-bindings.patch +usb-serial-cp210x-add-id-for-link-ecu.patch +usb-serial-cp210x-add-straizona-focusers-device-ids.patch +revert-usb-pm-allow-usb-devices-to-remain-runtime-suspended-when-sleeping.patch +nvmem-mxs-ocotp-fix-buffer-overflow-in-read.patch +drivers-hv-vmbus-fix-signaling-logic-in-hv_need_to_signal_on_read.patch diff --git a/queue-4.5/usb-serial-cp210x-add-id-for-link-ecu.patch b/queue-4.5/usb-serial-cp210x-add-id-for-link-ecu.patch new file mode 100644 index 00000000000..7b483b48601 --- /dev/null +++ b/queue-4.5/usb-serial-cp210x-add-id-for-link-ecu.patch @@ -0,0 +1,32 @@ +From 1d377f4d690637a0121eac8701f84a0aa1e69a69 Mon Sep 17 00:00:00 2001 +From: Mike Manning +Date: Mon, 18 Apr 2016 12:13:23 +0000 +Subject: USB: serial: cp210x: add ID for Link ECU + +From: Mike Manning + +commit 1d377f4d690637a0121eac8701f84a0aa1e69a69 upstream. + +The Link ECU is an aftermarket ECU computer for vehicles that provides +full tuning abilities as well as datalogging and displaying capabilities +via the USB to Serial adapter built into the device. + +Signed-off-by: Mike Manning +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/cp210x.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/serial/cp210x.c ++++ b/drivers/usb/serial/cp210x.c +@@ -141,6 +141,8 @@ static const struct usb_device_id id_tab + { USB_DEVICE(0x10C4, 0xF004) }, /* Elan Digital Systems USBcount50 */ + { USB_DEVICE(0x10C5, 0xEA61) }, /* Silicon Labs MobiData GPRS USB Modem */ + { USB_DEVICE(0x10CE, 0xEA6A) }, /* Silicon Labs MobiData GPRS USB Modem 100EU */ ++ { USB_DEVICE(0x12B8, 0xEC60) }, /* Link G4 ECU */ ++ { USB_DEVICE(0x12B8, 0xEC62) }, /* Link G4+ ECU */ + { USB_DEVICE(0x13AD, 0x9999) }, /* Baltech card reader */ + { USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */ + { USB_DEVICE(0x166A, 0x0201) }, /* Clipsal 5500PACA C-Bus Pascal Automation Controller */ diff --git a/queue-4.5/usb-serial-cp210x-add-straizona-focusers-device-ids.patch b/queue-4.5/usb-serial-cp210x-add-straizona-focusers-device-ids.patch new file mode 100644 index 00000000000..1701512a0eb --- /dev/null +++ b/queue-4.5/usb-serial-cp210x-add-straizona-focusers-device-ids.patch @@ -0,0 +1,37 @@ +From 613ac23a46e10d4d4339febdd534fafadd68e059 Mon Sep 17 00:00:00 2001 +From: Jasem Mutlaq +Date: Tue, 19 Apr 2016 10:38:27 +0300 +Subject: USB: serial: cp210x: add Straizona Focusers device ids + +From: Jasem Mutlaq + +commit 613ac23a46e10d4d4339febdd534fafadd68e059 upstream. + +Adding VID:PID for Straizona Focusers to cp210x driver. + +Signed-off-by: Jasem Mutlaq +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/cp210x.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/serial/cp210x.c ++++ b/drivers/usb/serial/cp210x.c +@@ -109,6 +109,7 @@ static const struct usb_device_id id_tab + { USB_DEVICE(0x10C4, 0x826B) }, /* Cygnal Integrated Products, Inc., Fasttrax GPS demonstration module */ + { USB_DEVICE(0x10C4, 0x8281) }, /* Nanotec Plug & Drive */ + { USB_DEVICE(0x10C4, 0x8293) }, /* Telegesis ETRX2USB */ ++ { USB_DEVICE(0x10C4, 0x82F4) }, /* Starizona MicroTouch */ + { USB_DEVICE(0x10C4, 0x82F9) }, /* Procyon AVS */ + { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ + { USB_DEVICE(0x10C4, 0x8382) }, /* Cygnal Integrated Products, Inc. */ +@@ -118,6 +119,7 @@ static const struct usb_device_id id_tab + { USB_DEVICE(0x10C4, 0x8418) }, /* IRZ Automation Teleport SG-10 GSM/GPRS Modem */ + { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */ + { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */ ++ { USB_DEVICE(0x10C4, 0x84B6) }, /* Starizona Hyperion */ + { USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */ + { USB_DEVICE(0x10C4, 0x85EB) }, /* AC-Services CIS-IBUS */ + { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */