<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/tty/serial/sh-sci.c, branch v5.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=v5.0</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2019-01-30T08:35:46Z</updated>
<entry>
<title>serial: sh-sci: Do not free irqs that have already been freed</title>
<updated>2019-01-30T08:35:46Z</updated>
<author>
<name>Chris Brandt</name>
<email>chris.brandt@renesas.com</email>
</author>
<published>2019-01-28T18:25:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4d95987a32db53f3beca76f8c4c8309ef6a5f192'/>
<id>urn:sha1:4d95987a32db53f3beca76f8c4c8309ef6a5f192</id>
<content type='text'>
Since IRQs might be muxed on some parts, we need to pay attention when we
are freeing them.
Otherwise we get the ugly WARNING "Trying to free already-free IRQ 20".

Fixes: 628c534ae735 ("serial: sh-sci: Improve support for separate TEI and DRI interrupts")
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Chris Brandt &lt;chris.brandt@renesas.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: sh-sci: Resume PIO in sci_rx_interrupt() on DMA failure</title>
<updated>2018-12-17T14:04:11Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2018-12-13T18:44:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=71ab1c0336c71ace5725740f200beca9667a339f'/>
<id>urn:sha1:71ab1c0336c71ace5725740f200beca9667a339f</id>
<content type='text'>
On (H)SCIF, sci_submit_rx() is called in the receive interrupt handler.
Hence if DMA submission fails, the interrupt handler should resume
handling reception using PIO, else no more data is received.

Make sci_submit_rx() return an error indicator, so the receive interrupt
handler can act appropriately.

Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Reviewed-by: Simon Horman &lt;horms+renesas@verge.net.au&gt;
Acked-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: sh-sci: Fix crash in rx_timer_fn() on PIO fallback</title>
<updated>2018-12-17T14:04:11Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2018-12-13T18:44:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2e948218b7c1262a3830823d6620eb227e3d4e3a'/>
<id>urn:sha1:2e948218b7c1262a3830823d6620eb227e3d4e3a</id>
<content type='text'>
When falling back to PIO, active_rx must be set to a different value
than cookie_rx[i], else sci_dma_rx_find_active() will incorrectly find a
match, leading to a NULL pointer dereference in rx_timer_fn() later.

Use zero instead, which is the same value as after driver
initialization.

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 locking in sci_submit_rx()</title>
<updated>2018-12-17T14:04:11Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2018-12-13T18:44:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dd1f2250da95e87cb3e612858f94b14f99445a7c'/>
<id>urn:sha1:dd1f2250da95e87cb3e612858f94b14f99445a7c</id>
<content type='text'>
Some callers of sci_submit_rx() hold the port spinlock, others don't.
During fallback to PIO, the driver needs to obtain the port spinlock.
If the lock was already held, spinlock recursion is detected, causing a
deadlock: BUG: spinlock recursion on CPU#0.

Fix this by adding a flag parameter to sci_submit_rx() for the caller to
indicate the port spinlock is already held, so spinlock recursion can be
avoided.

Move the spin_lock_irqsave() up, so all DMA disable steps are protected,
which is safe as the recently introduced dmaengine_terminate_async() can
be called in atomic context.

Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Reviewed-by: Simon Horman &lt;horms+renesas@verge.net.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge 4.20-rc2 into tty-next</title>
<updated>2018-11-12T02:48:25Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2018-11-12T02:48:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c17a1ca14cbba5585df67544711b6d04bcc8e240'/>
<id>urn:sha1:c17a1ca14cbba5585df67544711b6d04bcc8e240</id>
<content type='text'>
We want the tty/serial fixes in here as well.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'tty-4.20-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty</title>
<updated>2018-11-10T19:32:14Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2018-11-10T19:32:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e255aee5b66ce4af025e6f77122114c01303b861'/>
<id>urn:sha1:e255aee5b66ce4af025e6f77122114c01303b861</id>
<content type='text'>
Pull tty/serial fixes from Greg KH:
 "Here are some small tty fixes for 4.20-rc2

  One of these missed the original 4.19-final release, I missed that I
  hadn't done a pull request for it as it was in linux-next and my
  branch for a long time, that's my fault.

  The others are small, fixing some reported issues and finally fixing
  the termios mess for alpha so that glibc has a chance to implement
  some missing functionality that has been pending for many years now.

  All of these have been in linux-next with no reported issues"

* tag 'tty-4.20-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  serial: sh-sci: Fix could not remove dev_attr_rx_fifo_timeout
  arch/alpha, termios: implement BOTHER, IBSHIFT and termios2
  termios, tty/tty_baudrate.c: fix buffer overrun
  vt: fix broken display when running aptitude
  serial: sh-sci: Fix receive on SCIFA/SCIFB variants with DMA
</content>
</entry>
<entry>
<title>serial: sh-sci: Fix could not remove dev_attr_rx_fifo_timeout</title>
<updated>2018-11-09T17:34:50Z</updated>
<author>
<name>Yoshihiro Shimoda</name>
<email>yoshihiro.shimoda.uh@renesas.com</email>
</author>
<published>2018-10-30T06:13:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=641a41dbba217ee5bd26abe6be77f8cead9cd00e'/>
<id>urn:sha1:641a41dbba217ee5bd26abe6be77f8cead9cd00e</id>
<content type='text'>
This patch fixes an issue that the sci_remove() could not remove
dev_attr_rx_fifo_timeout because uart_remove_one_port() set
the port-&gt;port.type to PORT_UNKNOWN.

Reported-by: Hiromitsu Yamasaki &lt;hiromitsu.yamasaki.ym@renesas.com&gt;
Fixes: 5d23188a473d ("serial: sh-sci: make RX FIFO parameters tunable via sysfs")
Cc: &lt;stable@vger.kernel.org&gt; # v4.11+
Signed-off-by: Yoshihiro Shimoda &lt;yoshihiro.shimoda.uh@renesas.com&gt;
Reviewed-by: Ulrich Hecht &lt;uli+renesas@fpond.eu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: sh-sci: Improve type-safety calling sci_receive_chars()</title>
<updated>2018-11-09T12:37:00Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2018-11-07T13:37:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ed8c8e1ecca08eb172463816ab290157b9d6ca0b'/>
<id>urn:sha1:ed8c8e1ecca08eb172463816ab290157b9d6ca0b</id>
<content type='text'>
While ptr and port both point to the uart_port structure, the former is
the untyped pointer cookie passed to interrupt handlers.
Use the correctly typed port variable instead, to improve type-safety.

Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Reviewed-by: Ulrich Hecht &lt;uli+renesas@fpond.eu&gt;
Reviewed-by: Simon Horman &lt;horms+renesas@verge.net.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: sh-sci: Fix receive on SCIFA/SCIFB variants with DMA</title>
<updated>2018-10-15T14:20:24Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2018-10-09T17:41:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=202dc3cc10b4d37e5251431acf8d5040a8876c7d'/>
<id>urn:sha1:202dc3cc10b4d37e5251431acf8d5040a8876c7d</id>
<content type='text'>
On SCIFA and SCIFB serial ports with DMA support (i.e. some ports on
R-Car Gen2 and RZ/G1 SoCs), receive DMA operations are submitted before
the DMA channel pointer is initialized.  Hence this fails, and the
driver tries to fall back to PIO.  However, at this early phase in the
initialization sequence, fallback to PIO does not work, leading to a
serial port that cannot receive any data.

Fix this by calling sci_submit_rx() after initialization of the DMA
channel pointer.

Reported-by: Yoshihiro Shimoda &lt;yoshihiro.shimoda.uh@renesas.com&gt;
Fixes: 2c4ee23530ffc022 ("serial: sh-sci: Postpone DMA release when falling back to PIO")
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Reviewed-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Tested-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: sh-sci: do not warn if DMA transfers are not supported</title>
<updated>2018-10-15T14:14:48Z</updated>
<author>
<name>Ulrich Hecht</name>
<email>uli+renesas@fpond.eu</email>
</author>
<published>2018-10-12T13:47:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c58a3ae58bce99d20fdbc5d97beecf31cc19f3dd'/>
<id>urn:sha1:c58a3ae58bce99d20fdbc5d97beecf31cc19f3dd</id>
<content type='text'>
Not all (H)SCIF devices support DMA, and failure to set it up is not
normally a cause for concern. This patch demotes the associated warning to
debug output.

Inspired by BSP patch "sci: sh-sci: Fix transfer sequence of unsupport DMA
transfer" (6beb1f98d3bd30) by Hiromitsu Yamasaki.

Signed-off-by: Ulrich Hecht &lt;uli+renesas@fpond.eu&gt;
Reviewed-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
