<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/tty/serial/qcom_geni_serial.c, branch v4.19-rc4</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>tty: serial: qcom_geni_serial: Add support for flow control</title>
<updated>2018-07-16T09:56:22+00:00</updated>
<author>
<name>Girish Mahadevan</name>
<email>girishm@codeaurora.org</email>
</author>
<published>2018-07-13T22:17:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8a8a66a1a18a1dbd213bee460bcedb1361abc7ff'/>
<id>8a8a66a1a18a1dbd213bee460bcedb1361abc7ff</id>
<content type='text'>
Add support for flow control functionality in the GENI serial driver
and also support for non-console higher baud rate(upto 4Mbps) usecases.

Signed-off-by: Girish Mahadevan &lt;girishm@codeaurora.org&gt;
Signed-off-by: Mohammed Khajapasha &lt;mkhaja@codeaurora.org&gt;
Signed-off-by: Karthikeyan Ramasubramanian &lt;kramasub@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add support for flow control functionality in the GENI serial driver
and also support for non-console higher baud rate(upto 4Mbps) usecases.

Signed-off-by: Girish Mahadevan &lt;girishm@codeaurora.org&gt;
Signed-off-by: Mohammed Khajapasha &lt;mkhaja@codeaurora.org&gt;
Signed-off-by: Karthikeyan Ramasubramanian &lt;kramasub@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tty: serial: msm_geni_serial: Fix TX infinite loop</title>
<updated>2018-05-14T11:52:35+00:00</updated>
<author>
<name>Evan Green</name>
<email>evgreen@chromium.org</email>
</author>
<published>2018-05-09T20:44:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=638a6f4ebeba82ad098fdfa4449011074d3e2673'/>
<id>638a6f4ebeba82ad098fdfa4449011074d3e2673</id>
<content type='text'>
The GENI serial driver handled transmit by leaving stuff in the
common circular buffer until it had completely caught up to the head,
then clearing it out all at once. This is a suboptimal way to do
transmit, as it leaves data in the circular buffer that could be
freed. Moreover, the logic implementing it is wrong, and it is easy to
get into a situation where the UART infinitely writes out the same buffer.

I could reproduce infinite serial output of the same buffer by running
dmesg, then hitting Ctrl-C. I believe what happened is xmit_size was
something large, marching towards a larger value. Then the generic OS
code flushed out the buffer and replaced it with two characters. Now the
xmit_size is a large value marching towards a small value, which it wasn't
expecting. The driver subtracts xmit_size (very large) from
uart_circ_chars_pending (2), underflows, and repeats ad nauseum. The
locking isn't wrong here, as the locks are held whenever the buffer is
manipulated, it's just that the driver wasn't expecting the buffer to be
flushed out from underneath it in between transmits.

This change reworks transmit to grab what it can from the circular buffer,
and then update -&gt;tail, both fixing the underflow and freeing up space
for a smoother circular experience.

Signed-off-by: Evan Green &lt;evgreen@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The GENI serial driver handled transmit by leaving stuff in the
common circular buffer until it had completely caught up to the head,
then clearing it out all at once. This is a suboptimal way to do
transmit, as it leaves data in the circular buffer that could be
freed. Moreover, the logic implementing it is wrong, and it is easy to
get into a situation where the UART infinitely writes out the same buffer.

I could reproduce infinite serial output of the same buffer by running
dmesg, then hitting Ctrl-C. I believe what happened is xmit_size was
something large, marching towards a larger value. Then the generic OS
code flushed out the buffer and replaced it with two characters. Now the
xmit_size is a large value marching towards a small value, which it wasn't
expecting. The driver subtracts xmit_size (very large) from
uart_circ_chars_pending (2), underflows, and repeats ad nauseum. The
locking isn't wrong here, as the locks are held whenever the buffer is
manipulated, it's just that the driver wasn't expecting the buffer to be
flushed out from underneath it in between transmits.

This change reworks transmit to grab what it can from the circular buffer,
and then update -&gt;tail, both fixing the underflow and freeing up space
for a smoother circular experience.

Signed-off-by: Evan Green &lt;evgreen@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tty: serial: qcom_geni_serial: Add early console support</title>
<updated>2018-05-14T11:44:55+00:00</updated>
<author>
<name>Karthikeyan Ramasubramanian</name>
<email>kramasub@codeaurora.org</email>
</author>
<published>2018-05-03T20:14:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=43f1831b081d7ea86552311a77b6b04d82694d79'/>
<id>43f1831b081d7ea86552311a77b6b04d82694d79</id>
<content type='text'>
Add early console support in Qualcomm Technologies Inc., GENI based
UART controller.

Signed-off-by: Karthikeyan Ramasubramanian &lt;kramasub@codeaurora.org&gt;
Signed-off-by: Girish Mahadevan &lt;girishm@codeaurora.org&gt;
Reviewed-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add early console support in Qualcomm Technologies Inc., GENI based
UART controller.

Signed-off-by: Karthikeyan Ramasubramanian &lt;kramasub@codeaurora.org&gt;
Signed-off-by: Girish Mahadevan &lt;girishm@codeaurora.org&gt;
Reviewed-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tty: serial: qcom_geni_serial: Return IRQ_NONE for spurious interrupts</title>
<updated>2018-05-14T11:44:55+00:00</updated>
<author>
<name>Karthikeyan Ramasubramanian</name>
<email>kramasub@codeaurora.org</email>
</author>
<published>2018-05-03T20:14:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ec91df8d3faf90d1cb428a7c4950995c6514d0ab'/>
<id>ec91df8d3faf90d1cb428a7c4950995c6514d0ab</id>
<content type='text'>
Currently the driver returns IRQ_HANDLED when spurious interrupts happen.
This is misleading. Fix the behavior by returning IRQ_NONE for spurious
interrupts.

Signed-off-by: Karthikeyan Ramasubramanian &lt;kramasub@codeaurora.org&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently the driver returns IRQ_HANDLED when spurious interrupts happen.
This is misleading. Fix the behavior by returning IRQ_NONE for spurious
interrupts.

Signed-off-by: Karthikeyan Ramasubramanian &lt;kramasub@codeaurora.org&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tty: serial: qcom_geni_serial: Use iowrite32_rep to write to FIFO</title>
<updated>2018-05-14T11:44:55+00:00</updated>
<author>
<name>Karthikeyan Ramasubramanian</name>
<email>kramasub@codeaurora.org</email>
</author>
<published>2018-05-03T20:14:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=69736b57dfe57d116cac7846006cb4b0be9ac0d0'/>
<id>69736b57dfe57d116cac7846006cb4b0be9ac0d0</id>
<content type='text'>
Use iowrite32_rep to write to the hardware FIFO so that the code does
not have to worry about the system endianness.

Signed-off-by: Karthikeyan Ramasubramanian &lt;kramasub@codeaurora.org&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use iowrite32_rep to write to the hardware FIFO so that the code does
not have to worry about the system endianness.

Signed-off-by: Karthikeyan Ramasubramanian &lt;kramasub@codeaurora.org&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tty: serial: qcom_geni_serial: Remove unnecessary memory barrier</title>
<updated>2018-05-14T11:44:55+00:00</updated>
<author>
<name>Karthikeyan Ramasubramanian</name>
<email>kramasub@codeaurora.org</email>
</author>
<published>2018-05-03T20:14:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7fb5b8800194c0d9a5d2aa8b3983cf7bc615b3ea'/>
<id>7fb5b8800194c0d9a5d2aa8b3983cf7bc615b3ea</id>
<content type='text'>
While initiating TX, only the register reads need to be ordered. The
register write order either is achieved due to data dependency or is
not required.

Use readl to achieve the read order and remove the unnecessary barrier.

Signed-off-by: Karthikeyan Ramasubramanian &lt;kramasub@codeaurora.org&gt;
Reviewed-by: Evan Green &lt;evgreen@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While initiating TX, only the register reads need to be ordered. The
register write order either is achieved due to data dependency or is
not required.

Use readl to achieve the read order and remove the unnecessary barrier.

Signed-off-by: Karthikeyan Ramasubramanian &lt;kramasub@codeaurora.org&gt;
Reviewed-by: Evan Green &lt;evgreen@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tty: serial: qcom_geni_serial: Initialize console port statically</title>
<updated>2018-05-14T11:44:55+00:00</updated>
<author>
<name>Karthikeyan Ramasubramanian</name>
<email>kramasub@codeaurora.org</email>
</author>
<published>2018-05-03T20:14:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f73717506151742ec580d52a6e427e333f853eef'/>
<id>f73717506151742ec580d52a6e427e333f853eef</id>
<content type='text'>
Perform static initialization of console_port since its initial state has
no run-time dependencies.

Signed-off-by: Karthikeyan Ramasubramanian &lt;kramasub@codeaurora.org&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Perform static initialization of console_port since its initial state has
no run-time dependencies.

Signed-off-by: Karthikeyan Ramasubramanian &lt;kramasub@codeaurora.org&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tty: serial: qcom_geni_serial: Use min3 to find minimum of 3 values</title>
<updated>2018-05-14T11:44:55+00:00</updated>
<author>
<name>Karthikeyan Ramasubramanian</name>
<email>kramasub@codeaurora.org</email>
</author>
<published>2018-05-03T20:14:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8e70c47c48d2563cf9c64e9f512668a834c45bf6'/>
<id>8e70c47c48d2563cf9c64e9f512668a834c45bf6</id>
<content type='text'>
Use min3 helper to calculate the minimum value of 3 variables.

Signed-off-by: Karthikeyan Ramasubramanian &lt;kramasub@codeaurora.org&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use min3 helper to calculate the minimum value of 3 variables.

Signed-off-by: Karthikeyan Ramasubramanian &lt;kramasub@codeaurora.org&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tty: serial: qcom_geni_serial: Cleanup redundant code</title>
<updated>2018-05-14T11:44:54+00:00</updated>
<author>
<name>Karthikeyan Ramasubramanian</name>
<email>kramasub@codeaurora.org</email>
</author>
<published>2018-05-03T20:14:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6a10635e90e8cb000e6aa8f1292f5aed4c8369e3'/>
<id>6a10635e90e8cb000e6aa8f1292f5aed4c8369e3</id>
<content type='text'>
* Remove redundant casting while using min_t
* Remove redundant initialization of port_setup flag
* Remove redundant error checking in get_tx_fifo_size
* Remove logging redundant error code in debug messages
* Remove redundant disable_irq before free_irq

Signed-off-by: Karthikeyan Ramasubramanian &lt;kramasub@codeaurora.org&gt;
Reviewed-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Remove redundant casting while using min_t
* Remove redundant initialization of port_setup flag
* Remove redundant error checking in get_tx_fifo_size
* Remove logging redundant error code in debug messages
* Remove redundant disable_irq before free_irq

Signed-off-by: Karthikeyan Ramasubramanian &lt;kramasub@codeaurora.org&gt;
Reviewed-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tty: serial: qcom_geni_serial: Add comments for clarification</title>
<updated>2018-05-14T11:44:54+00:00</updated>
<author>
<name>Karthikeyan Ramasubramanian</name>
<email>kramasub@codeaurora.org</email>
</author>
<published>2018-05-03T20:14:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f02625689e543165d840aa0eb9cf2945636de25d'/>
<id>f02625689e543165d840aa0eb9cf2945636de25d</id>
<content type='text'>
* Document reason for newline character counting in console_write
* Document reason for disabling IRQ in the system resume operation

Signed-off-by: Karthikeyan Ramasubramanian &lt;kramasub@codeaurora.org&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Document reason for newline character counting in console_write
* Document reason for disabling IRQ in the system resume operation

Signed-off-by: Karthikeyan Ramasubramanian &lt;kramasub@codeaurora.org&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
