<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/tty/serial/sh-sci.c, branch v4.14</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.14</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.14'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2017-08-28T18:51:20Z</updated>
<entry>
<title>serial: sh-sci: use of_property_read_bool()</title>
<updated>2017-08-28T18:51:20Z</updated>
<author>
<name>Sergei Shtylyov</name>
<email>sergei.shtylyov@cogentembedded.com</email>
</author>
<published>2017-08-13T19:11:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=43c61286839761a5275c889364fc2588a756f197'/>
<id>urn:sha1:43c61286839761a5275c889364fc2588a756f197</id>
<content type='text'>
Use more compact of_property_read_bool() call for a boolean property
instead  of of_find_property() call in sci_parse_dt().

Signed-off-by: Sergei Shtylyov &lt;sergei.shtylyov@cogentembedded.com&gt;
Reviewed-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: sh-sci: Uninitialized variables in sysfs files</title>
<updated>2017-07-17T11:19:19Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2017-07-17T08:34:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4ab3c51e0540ba8464fe34d84cc35821bb77ae92'/>
<id>urn:sha1:4ab3c51e0540ba8464fe34d84cc35821bb77ae92</id>
<content type='text'>
The kstrtol() function returns -ERANGE as well as -EINVAL so these tests
are not enough.  It's not a super serious bug, but my static checker
correctly complains that the "r" variable might be used uninitialized.

Fixes: 5d23188a473d ("serial: sh-sci: make RX FIFO parameters tunable via sysfs")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&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: sh-sci: Update warning message in sci_request_dma_chan()</title>
<updated>2017-05-24T13:15:56Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2017-05-22T13:15:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9b7becf103e2689d7f005895130ccf89a153fef1'/>
<id>urn:sha1:9b7becf103e2689d7f005895130ccf89a153fef1</id>
<content type='text'>
The commit below changed a function call from
dma_request_slave_channel_compat() to dma_request_slave_channel(), but
forgot to update the printed failure message.

Fixes: 219fb0c1436e4893 ("serial: sh-sci: Remove the platform data dma slave rx/tx channel IDs")
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: sh-sci: Move uart_register_driver call to device probe</title>
<updated>2017-05-18T14:19:16Z</updated>
<author>
<name>Sjoerd Simons</name>
<email>sjoerd.simons@collabora.co.uk</email>
</author>
<published>2017-04-20T12:13:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=352b92664549e9dcdded742424a96aac9a0dbb40'/>
<id>urn:sha1:352b92664549e9dcdded742424a96aac9a0dbb40</id>
<content type='text'>
uart_register_driver call binds the driver to a specific device
node through tty_register_driver call. This should typically
happen during device probe call.

In a multiplatform scenario, it is possible that multiple serial
drivers are part of the kernel. Currently the driver registration fails
if multiple serial drivers with overlapping major/minor numbers are
included.

Signed-off-by: Sjoerd Simons &lt;sjoerd.simons@collabora.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: sh-sci: Fix race condition causing garbage during shutdown</title>
<updated>2017-05-18T14:19:16Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2017-04-25T18:15:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1cf4a7efdc71cab84c42cfea7200608711ea954f'/>
<id>urn:sha1:1cf4a7efdc71cab84c42cfea7200608711ea954f</id>
<content type='text'>
If DMA is enabled and used, a burst of old data may be seen on the
serial console during "poweroff" or "reboot".  uart_flush_buffer()
clears the circular buffer, but sci_port.tx_dma_len is not reset.
This leads to a circular buffer overflow, dumping (UART_XMIT_SIZE -
sci_port.tx_dma_len) bytes.

To fix this, add a .flush_buffer() callback that resets
sci_port.tx_dma_len.

Inspired by commit 31ca2c63fdc0aee7 ("tty/serial: atmel: fix race
condition (TX+DMA)").

Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: sh-sci: Fix (AUTO)RTS in sci_init_pins()</title>
<updated>2017-03-31T13:29:06Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2017-03-28T09:13:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cfa6eb239154315e6efcdda1d929e024097f927b'/>
<id>urn:sha1:cfa6eb239154315e6efcdda1d929e024097f927b</id>
<content type='text'>
If a UART has dedicated RTS/CTS pins, and hardware control flow is
disabled (or AUTORTS is not yet effective), changing any serial port
configuration deasserts RTS, as .set_termios() calls sci_init_pins().

To fix this, consider the current (AUTO)RTS state when (re)initializing
the pins.  Note that for SCIFA/SCIFB, AUTORTS needs explicit
configuration of the RTS# pin function, while (H)SCIF handles this
automatically.

Fixes: d2b9775d795ec05f ("serial: sh-sci: Correct pin initialization on (H)SCIF")
Fixes: e9d7a45a03991349 ("serial: sh-sci: Add pin initialization for SCIFA/SCIFB")
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: sh-sci: Fix late enablement of AUTORTS</title>
<updated>2017-03-31T13:29:05Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2017-03-28T09:13:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5f76895e4c712b1b5af450cf344389b8c53ac2c2'/>
<id>urn:sha1:5f76895e4c712b1b5af450cf344389b8c53ac2c2</id>
<content type='text'>
When changing hardware control flow for a UART with dedicated RTS/CTS
pins, the new AUTORTS state is not immediately reflected in the
hardware, but only when RTS is raised.  However, the serial core does
not call .set_mctrl() after .set_termios(), hence AUTORTS may only
become effective when the port is closed, and reopened later.
Note that this problem does not happen when manually using stty to
change CRTSCTS, as AUTORTS will work fine on next open.

To fix this, call .set_mctrl() from .set_termios() when dedicated
RTS/CTS pins are present, to refresh the AUTORTS or RTS state.
This is similar to what other drivers supporting AUTORTS do (e.g.
omap-serial).

Reported-by: Baumann, Christoph (C.) &lt;cbaumann@visteon.com&gt;
Fixes: 33f50ffc253854cf ("serial: sh-sci: Fix support for hardware-assisted RTS/CTS")
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: sh-sci: Fix hang in sci_reset()</title>
<updated>2017-03-31T13:29:05Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2017-03-28T09:13:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e37f712f760478a3bce8a68b8d85b5b0bf6642eb'/>
<id>urn:sha1:e37f712f760478a3bce8a68b8d85b5b0bf6642eb</id>
<content type='text'>
When the .set_termios() callback resets the UART, it first waits (busy
loops) until all characters in the transmit FIFO have been transmitted,
to prevent a port configuration change from impacting these characters.

However, if the UART has dedicated RTS/CTS hardware flow control
enabled, these characters may have been stuck in the FIFO due to CTS not
being asserted by the remote side.

  - When a new user opens the port, .set_termios() is called while
    transmission is still disabled, leading to an infinite loop:

	NMI watchdog: BUG: soft lockup - CPU#0 stuck for 22s!

  - When an active user changes port configuration without waiting for
    the draining of the transmit FIFO, this may also block indefinitely,
    until CTS is asserted by the remote side.

This has been observed with SCIFA (on r8a7740/armadillo), and SCIFB and
HSCIF (on r8a7791/koelsch).

To fix this, remove the code that waits for the draining of the transmit
FIFO.

Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: sh-sci: Fix panic when serial console and DMA are enabled</title>
<updated>2017-03-14T02:59:04Z</updated>
<author>
<name>Takatoshi Akiyama</name>
<email>takatoshi.akiyama.kj@ps.hitachi-solutions.com</email>
</author>
<published>2017-02-27T06:56:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3c9101766b502a0163d1d437fada5801cf616be2'/>
<id>urn:sha1:3c9101766b502a0163d1d437fada5801cf616be2</id>
<content type='text'>
This patch fixes an issue that kernel panic happens when DMA is enabled
and we press enter key while the kernel booting on the serial console.

* An interrupt may occur after sci_request_irq().
* DMA transfer area is initialized by setup_timer() in sci_request_dma()
  and used in interrupt.

If an interrupt occurred between sci_request_irq() and setup_timer() in
sci_request_dma(), DMA transfer area has not been initialized yet.
So, this patch changes the order of sci_request_irq() and
sci_request_dma().

Fixes: 73a19e4c0301 ("serial: sh-sci: Add DMA support.")
Signed-off-by: Takatoshi Akiyama &lt;takatoshi.akiyama.kj@ps.hitachi-solutions.com&gt;
[Shimoda changes the commit log]
Signed-off-by: Yoshihiro Shimoda &lt;yoshihiro.shimoda.uh@renesas.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: sh-sci: fix hardware RX trigger level setting</title>
<updated>2017-02-10T14:10:16Z</updated>
<author>
<name>Ulrich Hecht</name>
<email>ulrich.hecht+renesas@gmail.com</email>
</author>
<published>2017-02-08T17:31:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=90afa5255f5c5ae67c869918e4c5f60b8580db70'/>
<id>urn:sha1:90afa5255f5c5ae67c869918e4c5f60b8580db70</id>
<content type='text'>
1. Do not set the RX trigger level for software timeout devices on reset;
there is no timeout by default, and data will rot.
2. Do set the RX trigger level for hardware timeout devices when set
via sysfs attribute.

Fixes SCIFA-type serial consoles.

Signed-off-by: Ulrich Hecht &lt;ulrich.hecht+renesas@gmail.com&gt;
Tested-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
