<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/tty/serial, branch v5.19</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.19</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.19'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2022-06-30T15:19:11Z</updated>
<entry>
<title>serial: 8250: dw: Fix the macro RZN1_UART_xDMACR_8_WORD_BURST</title>
<updated>2022-06-30T15:19:11Z</updated>
<author>
<name>Biju Das</name>
<email>biju.das.jz@bp.renesas.com</email>
</author>
<published>2022-06-30T08:39:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b941e487152e0909ef43faacae6eeee266d9b378'/>
<id>urn:sha1:b941e487152e0909ef43faacae6eeee266d9b378</id>
<content type='text'>
As per RZ/N1 peripheral user manual(r01uh0752ej0100-rzn1-peripheral.pdf)
rev 1.0.0 Mar,2019, the value for 8_WORD_BURST is 4(b2,b1=2’b10).

This patch fixes the macro as per the user manual.

Fixes: aa63d786cea2 ("serial: 8250: dw: Add support for DMA flow controlling devices")
Reviewed-by: Phil Edworthy &lt;phil.edworthy@renesas.com&gt;
Signed-off-by: Biju Das &lt;biju.das.jz@bp.renesas.com&gt;
Link: https://lore.kernel.org/r/20220630083909.4294-1-biju.das.jz@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: mvebu-uart: correctly report configured baudrate value</title>
<updated>2022-06-30T15:17:31Z</updated>
<author>
<name>Pali Rohár</name>
<email>pali@kernel.org</email>
</author>
<published>2022-06-28T10:09:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4f532c1e25319e42996ec18a1f473fd50c8e575d'/>
<id>urn:sha1:4f532c1e25319e42996ec18a1f473fd50c8e575d</id>
<content type='text'>
Functions tty_termios_encode_baud_rate() and uart_update_timeout() should
be called with the baudrate value which was set to hardware. Linux then
report exact values via ioctl(TCGETS2) to userspace.

Change mvebu_uart_baud_rate_set() function to return baudrate value which
was set to hardware and propagate this value to above mentioned functions.

With this change userspace would see precise value in termios c_ospeed
field.

Fixes: 68a0db1d7da2 ("serial: mvebu-uart: add function to change baudrate")
Cc: stable &lt;stable@kernel.org&gt;
Reviewed-by: Ilpo Järvinen &lt;ilpo.jarvinen@linux.intel.com&gt;
Signed-off-by: Pali Rohár &lt;pali@kernel.org&gt;
Link: https://lore.kernel.org/r/20220628100922.10717-1-pali@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: 8250: Fix PM usage_count for console handover</title>
<updated>2022-06-30T15:17:31Z</updated>
<author>
<name>Ilpo Järvinen</name>
<email>ilpo.jarvinen@linux.intel.com</email>
</author>
<published>2022-06-29T09:48:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f9b11229b79c0fb2100b5bb4628a101b1d37fbf6'/>
<id>urn:sha1:f9b11229b79c0fb2100b5bb4628a101b1d37fbf6</id>
<content type='text'>
When console is enabled, univ8250_console_setup() calls
serial8250_console_setup() before .dev is set to uart_port. Therefore,
it will not call pm_runtime_get_sync(). Later, when the actual driver
is going to take over univ8250_console_exit() is called. As .dev is
already set, serial8250_console_exit() makes pm_runtime_put_sync() call
with usage count being zero triggering PM usage count warning
(extra debug for univ8250_console_setup(), univ8250_console_exit(), and
serial8250_register_ports()):

[    0.068987] univ8250_console_setup ttyS0 nodev
[    0.499670] printk: console [ttyS0] enabled
[    0.717955] printk: console [ttyS0] printing thread started
[    1.960163] serial8250_register_ports assigned dev for ttyS0
[    1.976830] printk: console [ttyS0] disabled
[    1.976888] printk: console [ttyS0] printing thread stopped
[    1.977073] univ8250_console_exit ttyS0 usage:0
[    1.977075] serial8250 serial8250: Runtime PM usage count underflow!
[    1.977429] dw-apb-uart.6: ttyS0 at MMIO 0x4010006000 (irq = 33, base_baud = 115200) is a 16550A
[    1.977812] univ8250_console_setup ttyS0 usage:2
[    1.978167] printk: console [ttyS0] printing thread started
[    1.978203] printk: console [ttyS0] enabled

To fix the issue, call pm_runtime_get_sync() in
serial8250_register_ports() as soon as .dev is set for an uart_port
if it has console enabled.

This problem became apparent only recently because 82586a721595 ("PM:
runtime: Avoid device usage count underflows") added the warning
printout. I confirmed this problem also occurs with v5.18 (w/o the
warning printout, obviously).

Fixes: bedb404e91bb ("serial: 8250_port: Don't use power management for kernel console")
Cc: stable &lt;stable@kernel.org&gt;
Tested-by: Tony Lindgren &lt;tony@atomide.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Reviewed-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Ilpo Järvinen &lt;ilpo.jarvinen@linux.intel.com&gt;
Link: https://lore.kernel.org/r/b4f428e9-491f-daf2-2232-819928dc276e@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: 8250: fix return error code in serial8250_request_std_resource()</title>
<updated>2022-06-30T15:15:47Z</updated>
<author>
<name>Yi Yang</name>
<email>yiyang13@huawei.com</email>
</author>
<published>2022-06-28T08:35:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6e690d54cfa802f939cefbd2fa2c91bd0b8bd1b6'/>
<id>urn:sha1:6e690d54cfa802f939cefbd2fa2c91bd0b8bd1b6</id>
<content type='text'>
If port-&gt;mapbase = NULL in serial8250_request_std_resource() , it need
return a error code instead of 0. If uart_set_info() fail to request new
regions by serial8250_request_std_resource() but the return value of
serial8250_request_std_resource() is 0, The system incorrectly considers
that the resource application is successful and does not attempt to
restore the old setting. A null pointer reference is triggered when the
port resource is later invoked.

Signed-off-by: Yi Yang &lt;yiyang13@huawei.com&gt;
Cc: stable &lt;stable@kernel.org&gt;
Link: https://lore.kernel.org/r/20220628083515.64138-1-yiyang13@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: stm32: Clear prev values before setting RTS delays</title>
<updated>2022-06-30T15:15:31Z</updated>
<author>
<name>Ilpo Järvinen</name>
<email>ilpo.jarvinen@linux.intel.com</email>
</author>
<published>2022-06-27T15:07:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5c5f44e36217de5ead789ff25da71c31c2331c96'/>
<id>urn:sha1:5c5f44e36217de5ead789ff25da71c31c2331c96</id>
<content type='text'>
The code lacks clearing of previous DEAT/DEDT values. Thus, changing
values on the fly results in garbage delays tending towards the maximum
value as more and more bits are ORed together. (Leaving RS485 mode
would have cleared the old values though).

Fixes: 1bcda09d2910 ("serial: stm32: add support for RS485 hardware control mode")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Ilpo Järvinen &lt;ilpo.jarvinen@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20220627150753.34510-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: 8250: Fix __stop_tx() &amp; DMA Tx restart races</title>
<updated>2022-06-27T12:47:57Z</updated>
<author>
<name>Ilpo Järvinen</name>
<email>ilpo.jarvinen@linux.intel.com</email>
</author>
<published>2022-06-15T09:06:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f8d6e9d3ca5c68e24dd485132a93d49abd444eaf'/>
<id>urn:sha1:f8d6e9d3ca5c68e24dd485132a93d49abd444eaf</id>
<content type='text'>
Commit e8ffbb71f783 ("serial: 8250: use THRE &amp; __stop_tx also with
DMA") changed __dma_tx_complete() to enable THRI that is cleared in
__stop_tx() once THRE is asserted as UART runs out bits to transmit. It
is possible, however, that more data arrives in between in which case
serial8250_tx_dma() resumes Tx. THRI is not supposed to be on during
DMA Tx because DMA is based on completion handler, therefore THRI must
be cleared unconditionally in serial8250_tx_dma().

When Tx is about to start, another race window exists with
serial8250_handle_irq() leading to a call into __stop_tx() while the
Tx has already been resumed:

__tx_complete():
  -&gt; spin_lock(port-&gt;lock)
  -&gt; dma-&gt;tx_running = 0
  -&gt; serial8250_set_THRI()
  -&gt; spin_unlock(port-&gt;lock)

uart_start():
				serial8250_handle_irq():
  -&gt; spin_lock(port-&gt;lock)
  -&gt; serial8250_tx_dma():
    -&gt; dma-&gt;tx_running = 1
  -&gt; spin_unlock(port-&gt;lock)
				  -&gt; spin_lock(port-&gt;lock)
				  -&gt; __stop_tx()

Close this race by checking !dma-&gt;tx_running before calling into
__stop_tx().

Fixes: e8ffbb71f783 ("serial: 8250: use THRE &amp; __stop_tx also with DMA")
Signed-off-by: Ilpo Järvinen &lt;ilpo.jarvinen@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20220615090651.15340-2-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: pl011: UPSTAT_AUTORTS requires .throttle/unthrottle</title>
<updated>2022-06-27T12:47:02Z</updated>
<author>
<name>Ilpo Järvinen</name>
<email>ilpo.jarvinen@linux.intel.com</email>
</author>
<published>2022-06-14T07:56:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=211565b100993c90b53bf40851eacaefc830cfe0'/>
<id>urn:sha1:211565b100993c90b53bf40851eacaefc830cfe0</id>
<content type='text'>
The driver must provide throttle and unthrottle in uart_ops when it
sets UPSTAT_AUTORTS. Add them using existing stop_rx &amp;
enable_interrupts functions.

Fixes: 2a76fa283098 (serial: pl011: Adopt generic flag to store auto RTS status)
Cc: stable &lt;stable@kernel.org&gt;
Cc: Lukas Wunner &lt;lukas@wunner.de&gt;
Reported-by: Nuno Gonçalves &lt;nunojpg@gmail.com&gt;
Tested-by: Nuno Gonçalves &lt;nunojpg@gmail.com&gt;
Signed-off-by: Ilpo Järvinen &lt;ilpo.jarvinen@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20220614075637.8558-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: serial: samsung_tty: set dma burst_size to 1</title>
<updated>2022-06-27T12:46:39Z</updated>
<author>
<name>Chanho Park</name>
<email>chanho61.park@samsung.com</email>
</author>
<published>2022-06-27T06:51:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f7e35e4bf1e8dc2c8cbd5e0955dc1bd58558dae0'/>
<id>urn:sha1:f7e35e4bf1e8dc2c8cbd5e0955dc1bd58558dae0</id>
<content type='text'>
The src_maxburst and dst_maxburst have been changed to 1 but the settings
of the UCON register aren't changed yet. They should be changed as well
according to the dmaengine slave config.

Fixes: aa2f80e752c7 ("serial: samsung: fix maxburst parameter for DMA transactions")
Cc: stable &lt;stable@kernel.org&gt;
Cc: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;
Signed-off-by: Chanho Park &lt;chanho61.park@samsung.com&gt;
Link: https://lore.kernel.org/r/20220627065113.139520-1-chanho61.park@samsung.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: 8250: dw: enable using pdata with ACPI</title>
<updated>2022-06-27T12:45:49Z</updated>
<author>
<name>Marcin Wojtas</name>
<email>mw@semihalf.com</email>
</author>
<published>2022-06-20T12:10:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cd16044d7c38d76fe2f9b71a06619e9590e3e401'/>
<id>urn:sha1:cd16044d7c38d76fe2f9b71a06619e9590e3e401</id>
<content type='text'>
Commit ffd381445eac ("serial: 8250: dw: Move the USR register to pdata")
caused NULL-pointer dereference when booting with ACPI by unconditional
usage of the recently added pdata.

In order to fix that and prevent similar issues in future, hook the
default version of this structure in dw8250_acpi_match table.
While at it, sort all entries alphabetically.

Fixes: ffd381445eac ("serial: 8250: dw: Move the USR register to pdata")
Reviewed-by: Ilpo Järvinen &lt;ilpo.jarvinen@linux.intel.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Signed-off-by: Marcin Wojtas &lt;mw@semihalf.com&gt;
Link: https://lore.kernel.org/r/20220620121046.1307412-1-mw@semihalf.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: 8250: Store to lsr_save_flags after lsr read</title>
<updated>2022-06-10T11:52:19Z</updated>
<author>
<name>Ilpo Järvinen</name>
<email>ilpo.jarvinen@linux.intel.com</email>
</author>
<published>2022-05-20T10:35:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=be03b0651ffd8bab69dfd574c6818b446c0753ce'/>
<id>urn:sha1:be03b0651ffd8bab69dfd574c6818b446c0753ce</id>
<content type='text'>
Not all LSR register flags are preserved across reads. Therefore, LSR
readers must store the non-preserved bits into lsr_save_flags.

This fix was initially mixed into feature commit f6f586102add ("serial:
8250: Handle UART without interrupt on TEMT using em485"). However,
that feature change had a flaw and it was reverted to make room for
simpler approach providing the same feature. The embedded fix got
reverted with the feature change.

Re-add the lsr_save_flags fix and properly mark it's a fix.

Link: https://lore.kernel.org/all/1d6c31d-d194-9e6a-ddf9-5f29af829f3@linux.intel.com/T/#m1737eef986bd20cf19593e344cebd7b0244945fc
Fixes: e490c9144cfa ("tty: Add software emulated RS485 support for 8250")
Cc: stable &lt;stable@kernel.org&gt;
Acked-by: Uwe Kleine-König &lt;u.kleine-koenig@penugtronix.de&gt;
Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: Ilpo Järvinen &lt;ilpo.jarvinen@linux.intel.com&gt;
Link: https://lore.kernel.org/r/f4d774be-1437-a550-8334-19d8722ab98c@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
