]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Nov 2016 16:51:46 +0000 (17:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Nov 2016 16:51:46 +0000 (17:51 +0100)
added patches:
mei-txe-don-t-clean-an-unprocessed-interrupt-cause.patch
tty-serial-at91-fix-hardware-handshake-on-atmel-platforms.patch
usb-gadget-function-u_ether-don-t-starve-tx-request-queue.patch
usb-increase-ohci-watchdog-delay-to-275-msec.patch
usb-serial-fix-potential-null-dereference-at-probe.patch
usb-serial-ftdi_sio-add-support-for-infineon-triboard-tc2x7.patch
xhci-use-default-usb_resume_timeout-when-resuming-ports.patch

queue-4.4/mei-txe-don-t-clean-an-unprocessed-interrupt-cause.patch [new file with mode: 0644]
queue-4.4/series
queue-4.4/tty-serial-at91-fix-hardware-handshake-on-atmel-platforms.patch [new file with mode: 0644]
queue-4.4/usb-gadget-function-u_ether-don-t-starve-tx-request-queue.patch [new file with mode: 0644]
queue-4.4/usb-increase-ohci-watchdog-delay-to-275-msec.patch [new file with mode: 0644]
queue-4.4/usb-serial-fix-potential-null-dereference-at-probe.patch [new file with mode: 0644]
queue-4.4/usb-serial-ftdi_sio-add-support-for-infineon-triboard-tc2x7.patch [new file with mode: 0644]
queue-4.4/xhci-use-default-usb_resume_timeout-when-resuming-ports.patch [new file with mode: 0644]

diff --git a/queue-4.4/mei-txe-don-t-clean-an-unprocessed-interrupt-cause.patch b/queue-4.4/mei-txe-don-t-clean-an-unprocessed-interrupt-cause.patch
new file mode 100644 (file)
index 0000000..6a10073
--- /dev/null
@@ -0,0 +1,45 @@
+From 43605e293eb13c07acb546c14f407a271837af17 Mon Sep 17 00:00:00 2001
+From: Alexander Usyskin <alexander.usyskin@intel.com>
+Date: Wed, 19 Oct 2016 01:34:48 +0300
+Subject: mei: txe: don't clean an unprocessed interrupt cause.
+
+From: Alexander Usyskin <alexander.usyskin@intel.com>
+
+commit 43605e293eb13c07acb546c14f407a271837af17 upstream.
+
+SEC registers are not accessible when the TXE device is in low power
+state, hence the SEC interrupt cannot be processed if device is not
+awake.
+
+In some rare cases entrance to low power state (aliveness off) and input
+ready bits can be signaled at the same time, resulting in communication
+stall as input ready won't be signaled again after waking up. To resolve
+this IPC_HHIER_SEC bit in HHISR_REG should not be cleaned if the
+interrupt is not processed.
+
+Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
+Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/misc/mei/hw-txe.c |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/misc/mei/hw-txe.c
++++ b/drivers/misc/mei/hw-txe.c
+@@ -972,11 +972,13 @@ static bool mei_txe_check_and_ack_intrs(
+       hisr = mei_txe_br_reg_read(hw, HISR_REG);
+       aliveness = mei_txe_aliveness_get(dev);
+-      if (hhisr & IPC_HHIER_SEC && aliveness)
++      if (hhisr & IPC_HHIER_SEC && aliveness) {
+               ipc_isr = mei_txe_sec_reg_read_silent(hw,
+                               SEC_IPC_HOST_INT_STATUS_REG);
+-      else
++      } else {
+               ipc_isr = 0;
++              hhisr &= ~IPC_HHIER_SEC;
++      }
+       generated = generated ||
+               (hisr & HISR_INT_STS_MSK) ||
index aaa70b9c5849ef5a1af299ca9ec456cab1b813ad..9a3550e868f15ba75d825fb0cca4396aff2cf069 100644 (file)
@@ -18,3 +18,10 @@ android-binder-clear-binder-and-cookie-when-setting-handle-in-flat-binder-struct
 btrfs-fix-races-on-root_log_ctx-lists.patch
 ubifs-abort-readdir-upon-error.patch
 ubifs-fix-regression-in-ubifs_readdir.patch
+mei-txe-don-t-clean-an-unprocessed-interrupt-cause.patch
+usb-gadget-function-u_ether-don-t-starve-tx-request-queue.patch
+usb-serial-fix-potential-null-dereference-at-probe.patch
+usb-serial-ftdi_sio-add-support-for-infineon-triboard-tc2x7.patch
+tty-serial-at91-fix-hardware-handshake-on-atmel-platforms.patch
+xhci-use-default-usb_resume_timeout-when-resuming-ports.patch
+usb-increase-ohci-watchdog-delay-to-275-msec.patch
diff --git a/queue-4.4/tty-serial-at91-fix-hardware-handshake-on-atmel-platforms.patch b/queue-4.4/tty-serial-at91-fix-hardware-handshake-on-atmel-platforms.patch
new file mode 100644 (file)
index 0000000..e777cb3
--- /dev/null
@@ -0,0 +1,125 @@
+From 9bcffe7575b721d7b6d9b3090fe18809d9806e78 Mon Sep 17 00:00:00 2001
+From: Richard Genoud <richard.genoud@gmail.com>
+Date: Thu, 27 Oct 2016 18:04:06 +0200
+Subject: tty/serial: at91: fix hardware handshake on Atmel platforms
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Richard Genoud <richard.genoud@gmail.com>
+
+commit 9bcffe7575b721d7b6d9b3090fe18809d9806e78 upstream.
+
+After commit 1cf6e8fc8341 ("tty/serial: at91: fix RTS line management
+when hardware handshake is enabled"), the hardware handshake wasn't
+functional anymore on Atmel platforms (beside SAMA5D2).
+
+To understand why, one has to understand the flag ATMEL_US_USMODE_HWHS
+first:
+Before commit 1cf6e8fc8341 ("tty/serial: at91: fix RTS line management
+when hardware handshake is enabled"), this flag was never set.
+Thus, the CTS/RTS where only handled by serial_core (and everything
+worked just fine).
+
+This commit introduced the use of the ATMEL_US_USMODE_HWHS flag,
+enabling it for all boards when the user space enables flow control.
+
+When the ATMEL_US_USMODE_HWHS is set, the Atmel USART controller
+handles a part of the flow control job:
+- disable the transmitter when the CTS pin gets high.
+- drive the RTS pin high when the DMA buffer transfer is completed or
+  PDC RX buffer full or RX FIFO is beyond threshold. (depending on the
+  controller version).
+
+NB: This feature is *not* mandatory for the flow control to work.
+(Nevertheless, it's very useful if low latencies are needed.)
+
+Now, the specifics of the ATMEL_US_USMODE_HWHS flag:
+
+- For platforms with DMAC and no FIFOs (sam9x25, sam9x35, sama5D3,
+sama5D4, sam9g15, sam9g25, sam9g35)* this feature simply doesn't work.
+( source: https://lkml.org/lkml/2016/9/7/598 )
+Tested it on sam9g35, the RTS pins always stays up, even when RXEN=1
+or a new DMA transfer descriptor is set.
+=> ATMEL_US_USMODE_HWHS must not be used for those platforms
+
+- For platforms with a PDC (sam926{0,1,3}, sam9g10, sam9g20, sam9g45,
+sam9g46)*, there's another kind of problem. Once the flag
+ATMEL_US_USMODE_HWHS is set, the RTS pin can't be driven anymore via
+RTSEN/RTSDIS in USART Control Register. The RTS pin can only be driven
+by enabling/disabling the receiver or setting RCR=RNCR=0 in the PDC
+(Receive (Next) Counter Register).
+=> Doing this is beyond the scope of this patch and could add other
+bugs, so the original (and working) behaviour should be set for those
+platforms (meaning ATMEL_US_USMODE_HWHS flag should be unset).
+
+- For platforms with a FIFO (sama5d2)*, the RTS pin is driven according
+to the RX FIFO thresholds, and can be also driven by RTSEN/RTSDIS in
+USART Control Register. No problem here.
+(This was the use case of commit 1cf6e8fc8341 ("tty/serial: at91: fix
+RTS line management when hardware handshake is enabled"))
+NB: If the CTS pin declared as a GPIO in the DTS, (for instance
+cts-gpios = <&pioA PIN_PB31 GPIO_ACTIVE_LOW>), the transmitter will be
+disabled.
+=> ATMEL_US_USMODE_HWHS flag can be set for this platform ONLY IF the
+CTS pin is not a GPIO.
+
+So, the only case when ATMEL_US_USMODE_HWHS can be enabled is when
+(atmel_use_fifo(port) &&
+ !mctrl_gpio_to_gpiod(atmel_port->gpios, UART_GPIO_CTS))
+
+Tested on all Atmel USART controller flavours:
+AT91SAM9G35-CM (DMAC flavour), AT91SAM9G20-EK (PDC flavour),
+SAMA5D2xplained (FIFO flavour).
+
+* the list may not be exhaustive
+
+Fixes: 1cf6e8fc8341 ("tty/serial: at91: fix RTS line management when hardware handshake is enabled")
+Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
+Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
+Acked-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
+Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/atmel_serial.c |   26 ++++++++++++++++++++++----
+ 1 file changed, 22 insertions(+), 4 deletions(-)
+
+--- a/drivers/tty/serial/atmel_serial.c
++++ b/drivers/tty/serial/atmel_serial.c
+@@ -2178,11 +2178,29 @@ static void atmel_set_termios(struct uar
+               mode |= ATMEL_US_USMODE_RS485;
+       } else if (termios->c_cflag & CRTSCTS) {
+               /* RS232 with hardware handshake (RTS/CTS) */
+-              if (atmel_use_dma_rx(port) && !atmel_use_fifo(port)) {
+-                      dev_info(port->dev, "not enabling hardware flow control because DMA is used");
+-                      termios->c_cflag &= ~CRTSCTS;
+-              } else {
++              if (atmel_use_fifo(port) &&
++                  !mctrl_gpio_to_gpiod(atmel_port->gpios, UART_GPIO_CTS)) {
++                      /*
++                       * with ATMEL_US_USMODE_HWHS set, the controller will
++                       * be able to drive the RTS pin high/low when the RX
++                       * FIFO is above RXFTHRES/below RXFTHRES2.
++                       * It will also disable the transmitter when the CTS
++                       * pin is high.
++                       * This mode is not activated if CTS pin is a GPIO
++                       * because in this case, the transmitter is always
++                       * disabled (there must be an internal pull-up
++                       * responsible for this behaviour).
++                       * If the RTS pin is a GPIO, the controller won't be
++                       * able to drive it according to the FIFO thresholds,
++                       * but it will be handled by the driver.
++                       */
+                       mode |= ATMEL_US_USMODE_HWHS;
++              } else {
++                      /*
++                       * For platforms without FIFO, the flow control is
++                       * handled by the driver.
++                       */
++                      mode |= ATMEL_US_USMODE_NORMAL;
+               }
+       } else {
+               /* RS232 without hadware handshake */
diff --git a/queue-4.4/usb-gadget-function-u_ether-don-t-starve-tx-request-queue.patch b/queue-4.4/usb-gadget-function-u_ether-don-t-starve-tx-request-queue.patch
new file mode 100644 (file)
index 0000000..9dd2ddc
--- /dev/null
@@ -0,0 +1,43 @@
+From 6c83f77278f17a7679001027e9231291c20f0d8a Mon Sep 17 00:00:00 2001
+From: Felipe Balbi <felipe.balbi@linux.intel.com>
+Date: Tue, 4 Oct 2016 15:14:43 +0300
+Subject: usb: gadget: function: u_ether: don't starve tx request queue
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Felipe Balbi <felipe.balbi@linux.intel.com>
+
+commit 6c83f77278f17a7679001027e9231291c20f0d8a upstream.
+
+If we don't guarantee that we will always get an
+interrupt at least when we're queueing our very last
+request, we could fall into situation where we queue
+every request with 'no_interrupt' set. This will
+cause the link to get stuck.
+
+The behavior above has been triggered with g_ether
+and dwc3.
+
+Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
+Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/gadget/function/u_ether.c |    5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/drivers/usb/gadget/function/u_ether.c
++++ b/drivers/usb/gadget/function/u_ether.c
+@@ -596,8 +596,9 @@ static netdev_tx_t eth_start_xmit(struct
+       /* throttle high/super speed IRQ rate back slightly */
+       if (gadget_is_dualspeed(dev->gadget))
+-              req->no_interrupt = (dev->gadget->speed == USB_SPEED_HIGH ||
+-                                   dev->gadget->speed == USB_SPEED_SUPER)
++              req->no_interrupt = (((dev->gadget->speed == USB_SPEED_HIGH ||
++                                     dev->gadget->speed == USB_SPEED_SUPER)) &&
++                                      !list_empty(&dev->tx_reqs))
+                       ? ((atomic_read(&dev->tx_qlen) % dev->qmult) != 0)
+                       : 0;
diff --git a/queue-4.4/usb-increase-ohci-watchdog-delay-to-275-msec.patch b/queue-4.4/usb-increase-ohci-watchdog-delay-to-275-msec.patch
new file mode 100644 (file)
index 0000000..de33ef5
--- /dev/null
@@ -0,0 +1,33 @@
+From ed6d6f8f42d7302f6f9b6245f34927ec20d26c12 Mon Sep 17 00:00:00 2001
+From: Bryan Paluch <bryanpaluch@gmail.com>
+Date: Mon, 17 Oct 2016 08:54:46 -0400
+Subject: usb: increase ohci watchdog delay to 275 msec
+
+From: Bryan Paluch <bryanpaluch@gmail.com>
+
+commit ed6d6f8f42d7302f6f9b6245f34927ec20d26c12 upstream.
+
+Increase ohci watchout delay to 275 ms. Previous delay was 250 ms
+with 20 ms of slack, after removing slack time some ohci controllers don't
+respond in time. Logs from systems with controllers that have the
+issue would show "HcDoneHead not written back; disabled"
+
+Signed-off-by: Bryan Paluch <bryanpaluch@gmail.com>
+Acked-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/host/ohci-hcd.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/usb/host/ohci-hcd.c
++++ b/drivers/usb/host/ohci-hcd.c
+@@ -72,7 +72,7 @@
+ static const char     hcd_name [] = "ohci_hcd";
+ #define       STATECHANGE_DELAY       msecs_to_jiffies(300)
+-#define       IO_WATCHDOG_DELAY       msecs_to_jiffies(250)
++#define       IO_WATCHDOG_DELAY       msecs_to_jiffies(275)
+ #include "ohci.h"
+ #include "pci-quirks.h"
diff --git a/queue-4.4/usb-serial-fix-potential-null-dereference-at-probe.patch b/queue-4.4/usb-serial-fix-potential-null-dereference-at-probe.patch
new file mode 100644 (file)
index 0000000..ccfc79a
--- /dev/null
@@ -0,0 +1,36 @@
+From 126d26f66d9890a69158812a6caa248c05359daa Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan@kernel.org>
+Date: Fri, 21 Oct 2016 12:56:27 +0200
+Subject: USB: serial: fix potential NULL-dereference at probe
+
+From: Johan Hovold <johan@kernel.org>
+
+commit 126d26f66d9890a69158812a6caa248c05359daa upstream.
+
+Make sure we have at least one port before attempting to register a
+console.
+
+Currently, at least one driver binds to a "dummy" interface and requests
+zero ports for it. Should such an interface also lack endpoints, we get
+a NULL-deref during probe.
+
+Fixes: e5b1e2062e05 ("USB: serial: make minor allocation dynamic")
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/usb-serial.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/usb/serial/usb-serial.c
++++ b/drivers/usb/serial/usb-serial.c
+@@ -1077,7 +1077,8 @@ static int usb_serial_probe(struct usb_i
+       serial->disconnected = 0;
+-      usb_serial_console_init(serial->port[0]->minor);
++      if (num_ports > 0)
++              usb_serial_console_init(serial->port[0]->minor);
+ exit:
+       module_put(type->driver.owner);
+       return 0;
diff --git a/queue-4.4/usb-serial-ftdi_sio-add-support-for-infineon-triboard-tc2x7.patch b/queue-4.4/usb-serial-ftdi_sio-add-support-for-infineon-triboard-tc2x7.patch
new file mode 100644 (file)
index 0000000..e0b6dc7
--- /dev/null
@@ -0,0 +1,48 @@
+From ca006f785fbfd7a5c901900bd3fe2b26e946a1ee Mon Sep 17 00:00:00 2001
+From: Stefan Tauner <stefan.tauner@technikum-wien.at>
+Date: Thu, 6 Oct 2016 18:40:11 +0200
+Subject: USB: serial: ftdi_sio: add support for Infineon TriBoard TC2X7
+
+From: Stefan Tauner <stefan.tauner@technikum-wien.at>
+
+commit ca006f785fbfd7a5c901900bd3fe2b26e946a1ee upstream.
+
+This adds support to ftdi_sio for the Infineon TriBoard TC2X7
+engineering board for first-generation Aurix SoCs with Tricore CPUs.
+Mere addition of the device IDs does the job.
+
+Signed-off-by: Stefan Tauner <stefan.tauner@technikum-wien.at>
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/ftdi_sio.c     |    3 ++-
+ drivers/usb/serial/ftdi_sio_ids.h |    5 +++--
+ 2 files changed, 5 insertions(+), 3 deletions(-)
+
+--- a/drivers/usb/serial/ftdi_sio.c
++++ b/drivers/usb/serial/ftdi_sio.c
+@@ -986,7 +986,8 @@ static const struct usb_device_id id_tab
+       /* ekey Devices */
+       { USB_DEVICE(FTDI_VID, FTDI_EKEY_CONV_USB_PID) },
+       /* Infineon Devices */
+-      { USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_PID, 1) },
++      { USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_TC1798_PID, 1) },
++      { USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_TC2X7_PID, 1) },
+       /* GE Healthcare devices */
+       { USB_DEVICE(GE_HEALTHCARE_VID, GE_HEALTHCARE_NEMO_TRACKER_PID) },
+       /* Active Research (Actisense) devices */
+--- a/drivers/usb/serial/ftdi_sio_ids.h
++++ b/drivers/usb/serial/ftdi_sio_ids.h
+@@ -626,8 +626,9 @@
+ /*
+  * Infineon Technologies
+  */
+-#define INFINEON_VID          0x058b
+-#define INFINEON_TRIBOARD_PID 0x0028 /* DAS JTAG TriBoard TC1798 V1.0 */
++#define INFINEON_VID                  0x058b
++#define INFINEON_TRIBOARD_TC1798_PID  0x0028 /* DAS JTAG TriBoard TC1798 V1.0 */
++#define INFINEON_TRIBOARD_TC2X7_PID   0x0043 /* DAS JTAG TriBoard TC2X7 V1.0 */
+ /*
+  * Acton Research Corp.
diff --git a/queue-4.4/xhci-use-default-usb_resume_timeout-when-resuming-ports.patch b/queue-4.4/xhci-use-default-usb_resume_timeout-when-resuming-ports.patch
new file mode 100644 (file)
index 0000000..3607add
--- /dev/null
@@ -0,0 +1,43 @@
+From 7d3b016a6f5a0fa610dfd02b05654c08fa4ae514 Mon Sep 17 00:00:00 2001
+From: Mathias Nyman <mathias.nyman@linux.intel.com>
+Date: Thu, 20 Oct 2016 18:09:20 +0300
+Subject: xhci: use default USB_RESUME_TIMEOUT when resuming ports.
+
+From: Mathias Nyman <mathias.nyman@linux.intel.com>
+
+commit 7d3b016a6f5a0fa610dfd02b05654c08fa4ae514 upstream.
+
+USB2 host inititated resume, and system suspend bus resume
+need to use the same USB_RESUME_TIMEOUT as elsewhere.
+
+This resolves a device disconnect issue at system resume seen
+on Intel Braswell and Apollolake, but is in no way limited to
+those platforms.
+
+Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/host/xhci-hub.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/usb/host/xhci-hub.c
++++ b/drivers/usb/host/xhci-hub.c
+@@ -1157,7 +1157,7 @@ int xhci_hub_control(struct usb_hcd *hcd
+                               xhci_set_link_state(xhci, port_array, wIndex,
+                                                       XDEV_RESUME);
+                               spin_unlock_irqrestore(&xhci->lock, flags);
+-                              msleep(20);
++                              msleep(USB_RESUME_TIMEOUT);
+                               spin_lock_irqsave(&xhci->lock, flags);
+                               xhci_set_link_state(xhci, port_array, wIndex,
+                                                       XDEV_U0);
+@@ -1401,7 +1401,7 @@ int xhci_bus_resume(struct usb_hcd *hcd)
+       if (need_usb2_u3_exit) {
+               spin_unlock_irqrestore(&xhci->lock, flags);
+-              msleep(20);
++              msleep(USB_RESUME_TIMEOUT);
+               spin_lock_irqsave(&xhci->lock, flags);
+       }