<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/tty, branch v6.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=v6.14</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.14'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-02-16T20:50:44Z</updated>
<entry>
<title>Merge tag 'tty-6.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty</title>
<updated>2025-02-16T20:50:44Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2025-02-16T20:50:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=56400391b1d312a14f912f36d2f04b0dba0d4a2f'/>
<id>urn:sha1:56400391b1d312a14f912f36d2f04b0dba0d4a2f</id>
<content type='text'>
Pull serial driver fixes from Greg KH:
 "Here are some small serial driver fixes for some reported problems.
  Nothing major, just:

   - sc16is7xx irq check fix

   - 8250 fifo underflow fix

   - serial_port and 8250 iotype fixes

  Most of these have been in linux-next already, and all have passed
  0-day testing"

* tag 'tty-6.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  serial: 8250: Fix fifo underflow on flush
  serial: 8250_pnp: Remove unneeded -&gt;iotype assignment
  serial: 8250_platform: Remove unneeded -&gt;iotype assignment
  serial: 8250_of: Remove unneeded -&gt;iotype assignment
  serial: port: Make -&gt;iotype validation global in __uart_read_properties()
  serial: port: Always update -&gt;iotype in __uart_read_properties()
  serial: port: Assign -&gt;iotype correctly when -&gt;iobase is set
  serial: sc16is7xx: Fix IRQ number check behavior
</content>
</entry>
<entry>
<title>serial: 8250: Fix fifo underflow on flush</title>
<updated>2025-02-14T08:50:55Z</updated>
<author>
<name>John Keeping</name>
<email>jkeeping@inmusicbrands.com</email>
</author>
<published>2025-02-08T12:41:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9e512eaaf8f4008c44ede3dfc0fbc9d9c5118583'/>
<id>urn:sha1:9e512eaaf8f4008c44ede3dfc0fbc9d9c5118583</id>
<content type='text'>
When flushing the serial port's buffer, uart_flush_buffer() calls
kfifo_reset() but if there is an outstanding DMA transfer then the
completion function will consume data from the kfifo via
uart_xmit_advance(), underflowing and leading to ongoing DMA as the
driver tries to transmit another 2^32 bytes.

This is readily reproduced with serial-generic and amidi sending even
short messages as closing the device on exit will wait for the fifo to
drain and in the underflow case amidi hangs for 30 seconds on exit in
tty_wait_until_sent().  A trace of that gives:

     kworker/1:1-84    [001]    51.769423: bprint:               serial8250_tx_dma: tx_size=3 fifo_len=3
           amidi-763   [001]    51.769460: bprint:               uart_flush_buffer: resetting fifo
 irq/21-fe530000-76    [000]    51.769474: bprint:               __dma_tx_complete: tx_size=3
 irq/21-fe530000-76    [000]    51.769479: bprint:               serial8250_tx_dma: tx_size=4096 fifo_len=4294967293
 irq/21-fe530000-76    [000]    51.781295: bprint:               __dma_tx_complete: tx_size=4096
 irq/21-fe530000-76    [000]    51.781301: bprint:               serial8250_tx_dma: tx_size=4096 fifo_len=4294963197
 irq/21-fe530000-76    [000]    51.793131: bprint:               __dma_tx_complete: tx_size=4096
 irq/21-fe530000-76    [000]    51.793135: bprint:               serial8250_tx_dma: tx_size=4096 fifo_len=4294959101
 irq/21-fe530000-76    [000]    51.804949: bprint:               __dma_tx_complete: tx_size=4096

Since the port lock is held in when the kfifo is reset in
uart_flush_buffer() and in __dma_tx_complete(), adding a flush_buffer
hook to adjust the outstanding DMA byte count is sufficient to avoid the
kfifo underflow.

Fixes: 9ee4b83e51f74 ("serial: 8250: Add support for dmaengine")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: John Keeping &lt;jkeeping@inmusicbrands.com&gt;
Link: https://lore.kernel.org/r/20250208124148.1189191-1-jkeeping@inmusicbrands.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fsnotify: use accessor to set FMODE_NONOTIFY_*</title>
<updated>2025-02-07T09:27:26Z</updated>
<author>
<name>Amir Goldstein</name>
<email>amir73il@gmail.com</email>
</author>
<published>2025-02-03T22:32:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=95101401bb50ae2cf9deee1bbf4d2b28d0dfdc26'/>
<id>urn:sha1:95101401bb50ae2cf9deee1bbf4d2b28d0dfdc26</id>
<content type='text'>
The FMODE_NONOTIFY_* bits are a 2-bits mode.  Open coding manipulation
of those bits is risky.  Use an accessor file_set_fsnotify_mode() to
set the mode.

Rename file_set_fsnotify_mode() =&gt; file_set_fsnotify_mode_from_watchers()
to make way for the simple accessor name.

Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Link: https://lore.kernel.org/r/20250203223205.861346-2-amir73il@gmail.com
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>serial: 8250_pnp: Remove unneeded -&gt;iotype assignment</title>
<updated>2025-02-04T13:44:53Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2025-01-24T16:10:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0f3fd9cf6491f5beecbb65abb41556c56135340c'/>
<id>urn:sha1:0f3fd9cf6491f5beecbb65abb41556c56135340c</id>
<content type='text'>
If -&gt;iobase is set the default will be UPIO_PORT for -&gt;iotype after
the uart_read_and_validate_port_properties() call. Hence no need
to assign that explicitly. Otherwise it will be UPIO_MEM.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20250124161530.398361-7-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: 8250_platform: Remove unneeded -&gt;iotype assignment</title>
<updated>2025-02-04T13:44:52Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2025-01-24T16:10:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=34bbb5d5137f32be3186a995a5ad4c60aaad11a7'/>
<id>urn:sha1:34bbb5d5137f32be3186a995a5ad4c60aaad11a7</id>
<content type='text'>
If -&gt;iobase is set the default will be UPIO_PORT for -&gt;iotype after
the uart_read_and_validate_port_properties() call. Hence no need
to assign that explicitly. Otherwise it will be UPIO_MEM.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20250124161530.398361-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: 8250_of: Remove unneeded -&gt;iotype assignment</title>
<updated>2025-02-04T13:44:50Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2025-01-24T16:10:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fe310f75327edbc042c7cc0df32c6b9ec29eb93a'/>
<id>urn:sha1:fe310f75327edbc042c7cc0df32c6b9ec29eb93a</id>
<content type='text'>
If -&gt;iobase is set the default will be UPIO_PORT for -&gt;iotype after
the uart_read_and_validate_port_properties() call. Hence no need
to assign that explicitly.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20250124161530.398361-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: port: Make -&gt;iotype validation global in __uart_read_properties()</title>
<updated>2025-02-04T13:44:44Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2025-01-24T16:10:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=12397549b5014071e1d2b315509f68eb93ef9144'/>
<id>urn:sha1:12397549b5014071e1d2b315509f68eb93ef9144</id>
<content type='text'>
In order to make code robust against potential changes in the future
move -&gt;iotype validation outside of switch in __uart_read_properties().
If any code will be added in between that might leave the -&gt;iotype value
unknown the validation catches this up.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20250124161530.398361-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: port: Always update -&gt;iotype in __uart_read_properties()</title>
<updated>2025-02-04T13:44:41Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2025-01-24T16:10:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e8486bd50ecf63c9a1e25271f258a8d959f2672f'/>
<id>urn:sha1:e8486bd50ecf63c9a1e25271f258a8d959f2672f</id>
<content type='text'>
The documentation of the __uart_read_properties() states that
-&gt;iotype member is always altered after the function call, but
the code doesn't do that in the case when use_defaults == false
and the value of reg-io-width is unsupported. Make sure the code
follows the documentation.

Note, the current users of the uart_read_and_validate_port_properties()
will fail and the change doesn't affect their behaviour, neither
users of uart_read_port_properties() will be affected since the
alteration happens there even in the current code flow.

Fixes: e894b6005dce ("serial: port: Introduce a common helper to read properties")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20250124161530.398361-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: port: Assign -&gt;iotype correctly when -&gt;iobase is set</title>
<updated>2025-02-04T13:44:35Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2025-01-24T16:10:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=166ac2bba167d575e7146beaa66093bc7c072f43'/>
<id>urn:sha1:166ac2bba167d575e7146beaa66093bc7c072f43</id>
<content type='text'>
Currently the -&gt;iotype is always assigned to the UPIO_MEM when
the respective property is not found. However, this will not
support the cases when user wants to have UPIO_PORT to be set
or preserved.  Support this scenario by checking -&gt;iobase value
and default the -&gt;iotype respectively.

Fixes: 1117a6fdc7c1 ("serial: 8250_of: Switch to use uart_read_port_properties()")
Fixes: e894b6005dce ("serial: port: Introduce a common helper to read properties")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20250124161530.398361-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: sc16is7xx: Fix IRQ number check behavior</title>
<updated>2025-02-04T13:42:42Z</updated>
<author>
<name>Andre Werner</name>
<email>andre.werner@systec-electronic.com</email>
</author>
<published>2025-01-21T07:18:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e8ed246ded863eb862806c5591afdcf70012ab5e'/>
<id>urn:sha1:e8ed246ded863eb862806c5591afdcf70012ab5e</id>
<content type='text'>
The logical meaning of the previous version is wrong due to a typo.

If the IRQ equals 0, no interrupt pin is available and polling mode
shall be used.

Additionally, this fix adds a check for IRQ &lt; 0 to increase robustness,
because documentation still says that negative IRQ values cannot be
absolutely ruled-out.

Fixes: 104c1b9dde9d ("serial: sc16is7xx: Add polling mode if no IRQ pin is available")
Signed-off-by: Andre Werner &lt;andre.werner@systec-electronic.com&gt;
Reviewed-by: Jiri Slaby &lt;jirislaby@kernel.org&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Reviewed-by: Maarten Brock &lt;maarten.brock@sttls.nl&gt;
Reviewed-by: Hugo Villeneuve &lt;hvilleneuve@dimonoff.com&gt;
Link: https://lore.kernel.org/r/20250121071819.1346672-1-andre.werner@systec-electronic.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
