<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/tty, branch v4.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.0</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-03-26T22:13:14Z</updated>
<entry>
<title>tty: serial: fsl_lpuart: clear receive flag on FIFO flush</title>
<updated>2015-03-26T22:13:14Z</updated>
<author>
<name>Stefan Agner</name>
<email>stefan@agner.ch</email>
</author>
<published>2015-03-13T13:51:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8e4934c6d6c659e22b1b746af4196683e77ce6ca'/>
<id>urn:sha1:8e4934c6d6c659e22b1b746af4196683e77ce6ca</id>
<content type='text'>
When the receiver was enabled during startup, a character could
have been in the FIFO when the UART get initially used. The
driver configures the (receive) watermark level, and flushes the
FIFO. However, the receive flag (RDRF) could still be set at that
stage (as mentioned in the register description of UARTx_RWFIFO).
This leads to an interrupt which won't be handled properly in
interrupt mode: The receive interrupt function lpuart_rxint checks
the FIFO count, which is 0 at that point (due to the flush
during initialization). The problem does not manifest when using
DMA to receive characters.

Fix this situation by explicitly read the status register, which
leads to clearing of the RDRF flag. Due to the flush just after
the status flag read, a explicit data read is not to required.

Signed-off-by: Stefan Agner &lt;stefan@agner.ch&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: serial: fsl_lpuart: specify transmit FIFO size</title>
<updated>2015-03-26T22:13:14Z</updated>
<author>
<name>Stefan Agner</name>
<email>stefan@agner.ch</email>
</author>
<published>2015-03-13T13:51:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4e8f245937091b2c9eebf3d4909c9ceda4f0a78e'/>
<id>urn:sha1:4e8f245937091b2c9eebf3d4909c9ceda4f0a78e</id>
<content type='text'>
Specify transmit FIFO size which might be different depending on
LPUART instance. This makes sure uart_wait_until_sent in serial
core getting called, which in turn waits and checks if the FIFO
is really empty on shutdown by using the tx_empty callback.
Without the call of this callback, the last several characters
might not yet be transmitted when closing the serial port. This
can be reproduced by simply using echo and redirect the output to
a ttyLP device.

Signed-off-by: Stefan Agner &lt;stefan@agner.ch&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: samsung: Clear operation mode on UART shutdown</title>
<updated>2015-03-26T22:13:14Z</updated>
<author>
<name>Javier Martinez Canillas</name>
<email>javier.martinez@collabora.co.uk</email>
</author>
<published>2015-03-13T11:38:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e91d863d1aaeda0349aed42dfbd75c98e042a2c9'/>
<id>urn:sha1:e91d863d1aaeda0349aed42dfbd75c98e042a2c9</id>
<content type='text'>
Exynos serial ports operate either in a DMA-based or interrupt-based
modes. In DMA-based mode, the UART generates a transfer data request
and a Transmission (Tx) interrupt in interrupt-based mode.

The Tx IRQ is only unmasked in interrupt-based mode and it was done
in s3c24xx_serial_start_tx(). Commit ba019a3e2ad5 ("serial: samsung:
remove redundant interrupt enabling") removed the IRQ enable on that
function since it is enabled when the mode is set in enable_tx_pio().

The problem is that enable_tx_pio() is only called if the port mode
has not been set before but the mode was not cleared on .shutdown().

So if the UART was shutdown and then started up again, the mode set
will remain and the Tx IRQ won't be unmasked.

This caused a hang on at least Exynos5250, Exynos5420 and Exynos5800
when the system is rebooted or powered off.

Fixes: ba019a3e2ad5 ("serial: samsung: remove redundant interrupt enabling")
Signed-off-by: Javier Martinez Canillas &lt;javier.martinez@collabora.co.uk&gt;
Reviewed-by: Sylwester Nawrocki &lt;s.nawrocki@samsung.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: 8250_dw: Fix deadlock in LCR workaround</title>
<updated>2015-03-11T15:39:52Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2015-03-11T13:19:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7fd6f640f2dd17dac6ddd6702c378cb0bb9cfa11'/>
<id>urn:sha1:7fd6f640f2dd17dac6ddd6702c378cb0bb9cfa11</id>
<content type='text'>
Trying to write console output from within the serial console driver
while the port-&gt;lock is held causes recursive deadlock:

  CPU 0
spin_lock_irqsave(&amp;port-&gt;lock)
printk()
  console_unlock()
    call_console_drivers()
      serial8250_console_write()
        spin_lock_irqsave(&amp;port-&gt;lock)
** DEADLOCK **

The 8250_dw i/o accessors try to write a console error message if the
LCR workaround was unsuccessful. When the port-&gt;lock is already held
(eg., when called from serial8250_set_termios()), this deadlocks.

Make the error message a FIXME until a general solution is devised.

Cc: Tim Kryger &lt;tim.kryger@gmail.com&gt;
Reported-by: Zhang Zhen &lt;zhenzhang.zhang@huawei.com&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'tty-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty</title>
<updated>2015-03-08T19:25:40Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2015-03-08T19:25:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bbbce516bb497404315c1d0a1b13a04038347d3d'/>
<id>urn:sha1:bbbce516bb497404315c1d0a1b13a04038347d3d</id>
<content type='text'>
Pull tty/serial fixes from Greg KH:
 "Here are some tty and serial driver fixes for 4.0-rc3.

  Along with the atime fix that you know about, here are some other
  serial driver bugfixes as well.  Most notable is a wait_until_sent
  bugfix that was traced back to being around since before 2.6.12 that
  Johan has fixed up.

  All have been in linux-next successfully"

* tag 'tty-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  TTY: fix tty_wait_until_sent maximum timeout
  TTY: fix tty_wait_until_sent on 64-bit machines
  USB: serial: fix infinite wait_until_sent timeout
  TTY: bfin_jtag_comm: remove incorrect wait_until_sent operation
  net: irda: fix wait_until_sent poll timeout
  serial: uapi: Declare all userspace-visible io types
  serial: core: Fix iotype userspace breakage
  serial: sprd: Fix missing spin_unlock in sprd_handle_irq()
  console: Fix console name size mismatch
  tty: fix up atime/mtime mess, take four
  serial: 8250_dw: Fix get_mctrl behaviour
  serial:8250:8250_pci: delete unneeded quirk entries
  serial:8250:8250_pci: fix redundant entry report for WCH_CH352_2S
  Change email address for 8250_pci
  serial: 8250: Revert "tty: serial: 8250_core: read only RX if there is something in the FIFO"
  Revert "tty/serial: of_serial: add DT alias ID handling"
</content>
</entry>
<entry>
<title>TTY: fix tty_wait_until_sent maximum timeout</title>
<updated>2015-03-07T02:44:15Z</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2015-03-04T09:39:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c37bc682e30b8027054356214eb8a3aafbda8e37'/>
<id>urn:sha1:c37bc682e30b8027054356214eb8a3aafbda8e37</id>
<content type='text'>
Currently tty_wait_until_sent may take up to twice as long as the
requested timeout while waiting for driver and hardware buffers to
drain.

Fix this by taking the remaining number of jiffies after waiting for
driver buffers to drain into account so that the timeout actually
becomes a maximum timeout as it is documented to be.

Note that this specifically implies tighter timings when closing a port
as a consequence of actually honouring the port closing-wait setting
for drivers relying on tty_wait_until_sent_from_close (e.g. via
tty_port_close_start).

Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Reviewed-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>TTY: fix tty_wait_until_sent on 64-bit machines</title>
<updated>2015-03-07T02:44:14Z</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2015-03-04T09:39:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=79fbf4a550ed6a22e1ae1516113e6c7fa5d56a53'/>
<id>urn:sha1:79fbf4a550ed6a22e1ae1516113e6c7fa5d56a53</id>
<content type='text'>
Fix overflow bug in tty_wait_until_sent on 64-bit machines, where an
infinite timeout (0) would be passed to the underlying tty-driver's
wait_until_sent-operation as a negative timeout (-1), causing it to
return immediately.

This manifests itself for example as tcdrain() returning immediately,
drivers not honouring the drain flags when setting terminal attributes,
or even dropped data on close as a requested infinite closing-wait
timeout would be ignored.

The first symptom  was reported by Asier LLANO who noted that tcdrain()
returned prematurely when using the ftdi_sio usb-serial driver.

Fix this by passing 0 rather than MAX_SCHEDULE_TIMEOUT (LONG_MAX) to the
underlying tty driver.

Note that the serial-core wait_until_sent-implementation is not affected
by this bug due to a lucky chance (comparison to an unsigned maximum
timeout), and neither is the cyclades one that had an explicit check for
negative timeouts, but all other tty drivers appear to be affected.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable &lt;stable@vger.kernel.org&gt;	# v2.6.12
Reported-by: ZIV-Asier Llano Palacios &lt;asier.llano@cgglobal.com&gt;
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Reviewed-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>TTY: bfin_jtag_comm: remove incorrect wait_until_sent operation</title>
<updated>2015-03-07T02:44:14Z</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2015-03-04T09:39:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6b270fd4db08fc13683d616a733d9cacdd3b4afa'/>
<id>urn:sha1:6b270fd4db08fc13683d616a733d9cacdd3b4afa</id>
<content type='text'>
Remove incorrect and redundant wait_until_sent operation, which waits
for the driver buffer rather than any hardware buffers to drain,
something which is already taken care of by the tty layer (and
chars_in_buffer).

Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Reviewed-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: sprd: Fix missing spin_unlock in sprd_handle_irq()</title>
<updated>2015-03-07T02:39:55Z</updated>
<author>
<name>Axel Lin</name>
<email>axel.lin@ingics.com</email>
</author>
<published>2015-02-16T14:39:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c4e6dcfa00dab9b10e75bba835393b81f256310b'/>
<id>urn:sha1:c4e6dcfa00dab9b10e75bba835393b81f256310b</id>
<content type='text'>
Fix return from sprd_handle_irq() with spin_lock held.

Signed-off-by: Axel Lin &lt;axel.lin@ingics.com&gt;
Reviewed-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: fix up atime/mtime mess, take four</title>
<updated>2015-03-07T02:06:51Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2015-02-27T17:40:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f0bf0bd07943bfde8f5ac39a32664810a379c7d3'/>
<id>urn:sha1:f0bf0bd07943bfde8f5ac39a32664810a379c7d3</id>
<content type='text'>
This problem was taken care of three times already in
* b0de59b5733d18b0d1974a060860a8b5c1b36a2e (TTY: do not update
  atime/mtime on read/write),
* 37b7f3c76595e23257f61bd80b223de8658617ee (TTY: fix atime/mtime
  regression), and
* b0b885657b6c8ef63a46bc9299b2a7715d19acde (tty: fix up atime/mtime
  mess, take three)

But it still misses one point. As John Paul correctly points out, we
do not care about setting date. If somebody ever changes wall
time backwards (by mistake for example), tty timestamps are never
updated until the original wall time passes.

So check the absolute difference of times and if it large than "8
seconds or so", always update the time. That means we will update
immediatelly when changing time. Ergo, CAP_SYS_TIME can foul the
check, but it was always that way.

Thanks John for serving me this so nicely debugged.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Reported-by: John Paul Perry &lt;john_paul.perry@alcatel-lucent.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # all, as b0b885657 was backported
Acked-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
