<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/tty/serial/sh-sci.c, branch v4.4</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.4</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-12-13T05:42:31Z</updated>
<entry>
<title>serial: sh-sci: Fix length of scatterlist</title>
<updated>2015-12-13T05:42:31Z</updated>
<author>
<name>Yoshihiro Shimoda</name>
<email>yoshihiro.shimoda.uh@renesas.com</email>
</author>
<published>2015-12-04T14:21:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d09959e7529451a1c302197fb1396ed5b835f6d3'/>
<id>urn:sha1:d09959e7529451a1c302197fb1396ed5b835f6d3</id>
<content type='text'>
This patch fixes an issue that the "length" of scatterlist should be
set using sg_dma_len(). Otherwise, a dmaengine driver cannot work
correctly if CONFIG_NEED_SG_DMA_LENGTH=y.

Fixes: 7b39d90184 (serial: sh-sci: Fix NULL pointer dereference if HIGHMEM is enabled)
Signed-off-by: Yoshihiro Shimoda &lt;yoshihiro.shimoda.uh@renesas.com&gt;
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Acked-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: Add DT support to DMA setup</title>
<updated>2015-10-04T16:36:10Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2015-09-18T11:08:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ff4411296e99db2c0896580d8b47348abf3ad703'/>
<id>urn:sha1:ff4411296e99db2c0896580d8b47348abf3ad703</id>
<content type='text'>
Add support for obtaining DMA channel information from the device tree.

This requires switching from the legacy sh_dmae_slave structures with
hardcoded channel numbers and the corresponding filter function to:
  1. dma_request_slave_channel_compat(),
       - On legacy platforms, dma_request_slave_channel_compat() uses
	 the passed DMA channel numbers that originate from platform
	 device data,
       - On DT-based platforms, dma_request_slave_channel_compat() will
	 retrieve the information from DT.
  2. and the generic dmaengine_slave_config() configuration method,
     which requires filling in DMA register ports and slave bus widths.

Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Acked-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: sh-sci: Pause DMA engine and get DMA status again</title>
<updated>2015-10-04T16:36:10Z</updated>
<author>
<name>Muhammad Hamza Farooq</name>
<email>mfarooq@visteon.com</email>
</author>
<published>2015-09-18T11:08:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e7327c09def48ccfd204025726f11b57a19a9c24'/>
<id>urn:sha1:e7327c09def48ccfd204025726f11b57a19a9c24</id>
<content type='text'>
Occasionally, DMA transaction completes _after_ DMA engine is stopped.
Verify if the transaction has not finished before forcing the engine to
stop and push the data

Signed-off-by: Muhammad Hamza Farooq &lt;mfarooq@visteon.com&gt;
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: Do not terminate DMA engine when race condition occurs</title>
<updated>2015-10-04T16:36:10Z</updated>
<author>
<name>Muhammad Hamza Farooq</name>
<email>mfarooq@visteon.com</email>
</author>
<published>2015-09-18T11:08:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3b963042b64f5de3c63a1ebcbe2cad6b1597b8b9'/>
<id>urn:sha1:3b963042b64f5de3c63a1ebcbe2cad6b1597b8b9</id>
<content type='text'>
When DMA packet completion and timer expiry take place at the same time,
do not terminate the DMA engine, leading by submission of new
descriptors, as the DMA communication hasn't necessarily stopped here.

Signed-off-by: Muhammad Hamza Farooq &lt;mfarooq@visteon.com&gt;
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: Call dma_async_issue_pending when transaction completes</title>
<updated>2015-10-04T16:36:10Z</updated>
<author>
<name>Muhammad Hamza Farooq</name>
<email>mfarooq@visteon.com</email>
</author>
<published>2015-09-18T11:08:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1d3db608f933605d2dce44a0262ea94da3407465'/>
<id>urn:sha1:1d3db608f933605d2dce44a0262ea94da3407465</id>
<content type='text'>
dmaengine_submit() will not start the DMA operation, it merely adds
it to the pending queue.  If the queue is no longer running, it won't be
restarted until dma_async_issue_pending() is called.

Signed-off-by: Muhammad Hamza Farooq &lt;mfarooq@visteon.com&gt;
[geert: Add more description]
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: Redirect port interrupts to CPU _only_ when DMA stops</title>
<updated>2015-10-04T16:36:10Z</updated>
<author>
<name>Muhammad Hamza Farooq</name>
<email>mfarooq@visteon.com</email>
</author>
<published>2015-09-18T11:08:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=371cfed3116bc2ebd173fe55870f77ea1413edac'/>
<id>urn:sha1:371cfed3116bc2ebd173fe55870f77ea1413edac</id>
<content type='text'>
Since the DMA engine is not stopped everytime rx_timer_fn is called, the
interrupts have to be redirected back to CPU only when incomplete DMA
transaction is handled

Signed-off-by: Muhammad Hamza Farooq &lt;mfarooq@visteon.com&gt;
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: Remove timer on shutdown of port</title>
<updated>2015-10-04T16:36:10Z</updated>
<author>
<name>Aleksandar Mitev</name>
<email>amitev@visteon.com</email>
</author>
<published>2015-09-18T11:08:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9ab76556608665c35080f641c73025297d0a2813'/>
<id>urn:sha1:9ab76556608665c35080f641c73025297d0a2813</id>
<content type='text'>
This prevents DMA timer timeout that can trigger after the port has
been closed.

Signed-off-by: Aleksandar Mitev &lt;amitev@visteon.com&gt;
[geert: Move del_timer_sync() outside spinlock to avoid circular locking
        dependency between rx_timer_fn() and del_timer_sync()]
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: Stop calling sci_start_rx() from sci_request_dma()</title>
<updated>2015-10-04T16:36:10Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2015-09-18T11:08:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0e5c4b4d154ee0a34e39e1a587f71d4671783abf'/>
<id>urn:sha1:0e5c4b4d154ee0a34e39e1a587f71d4671783abf</id>
<content type='text'>
There's no need to call sci_start_rx() from sci_request_dma() when DMA
setup fails, as sci_startup() will call sci_start_rx() anyway.

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: Submit RX DMA from RX interrupt on (H)SCIF</title>
<updated>2015-10-04T16:36:10Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2015-09-18T11:08:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=756981be7497ab76ae7ccd2fda9223a135320aa1'/>
<id>urn:sha1:756981be7497ab76ae7ccd2fda9223a135320aa1</id>
<content type='text'>
For DMA receive requests, the driver is only notified by DMA completion
after the whole DMA request has been transferred.  If less data is
received, it will stay stuck until more data arrives.  The driver
handles this by setting up a timer handler from the receive interrupt,
after reception of the first character.

Unlike SCIFA and SCIFB, SCIF and HSCIF don't issue receive interrupts on
reception of individual characters if a receive DMA request is in
progress, so the timer is never set up.

To fix receive DMA on SCIF and HSCIF, submit the receive DMA request
from the receive interrupt handler instead.
In some sense this is similar to the SCIFA/SCIFB behavior, where the
RDRQE (Rx Data Transfer Request Enable) bit is also set from the receive
interrupt handler.

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: Get rid of the workqueue to handle receive DMA requests</title>
<updated>2015-10-04T16:36:10Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2015-09-18T11:08:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=67f462b069e9d2087d3fe838584730ecefcf9c66'/>
<id>urn:sha1:67f462b069e9d2087d3fe838584730ecefcf9c66</id>
<content type='text'>
The receive DMA workqueue function work_fn_rx() handles two things:
  1. Reception of a full buffer on completion of a receive DMA request,
  2. Reception of a partial buffer on receive DMA time-out.
The workqueue is kicked by both the receive DMA completion handler, and
by a timer to handle DMA time-out.

As there are always two receive DMA requests active, it's possible that
the receive DMA completion handler is called a second time before the
workqueue function runs.

As the time-out handler re-enables the receive interrupt, an interrupt
may come in before time-out has been fully handled.

Move part 1 into the receive DMA completion handler, and move part 2
into the receive DMA time-out handler, to fix these race conditions.

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