<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/tty/mxser.c, branch v5.17</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.17</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.17'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2021-11-25T17:33:22Z</updated>
<entry>
<title>mxser: use PCI_DEVICE_DATA</title>
<updated>2021-11-25T17:33:22Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2021-11-18T07:31:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c668d5676461b9449b7a3e11912db3fba9ace94d'/>
<id>urn:sha1:c668d5676461b9449b7a3e11912db3fba9ace94d</id>
<content type='text'>
Now that we have all the PCI device IDs unified, we can use
PCI_DEVICE_DATA() macro to simplify mxser's pci_device_id list, i.e.
mxser_pcibrds.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Link: https://lore.kernel.org/r/20211118073125.12283-20-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mxser: move ids from pci_ids.h here</title>
<updated>2021-11-25T17:33:22Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2021-11-18T07:31:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4167bd25ec3bc221387ec6811c05eadfe3cf1d3e'/>
<id>urn:sha1:4167bd25ec3bc221387ec6811c05eadfe3cf1d3e</id>
<content type='text'>
There is no point having MOXA PCI device IDs in include/linux/pci_ids.h.
Move them to the driver and sort them all by the ID.

Cc: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Cc: linux-pci@vger.kernel.org
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Link: https://lore.kernel.org/r/20211118073125.12283-19-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mxser: add MOXA prefix to some PCI device IDs</title>
<updated>2021-11-25T17:33:22Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2021-11-18T07:31:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=16add04f7bff891eebc7d34bc404600c0fc41db1'/>
<id>urn:sha1:16add04f7bff891eebc7d34bc404600c0fc41db1</id>
<content type='text'>
Some of the MOXA PCI device IDs contain _MOXA_, some don't. Add it to
the latter, so that they are all unified.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Link: https://lore.kernel.org/r/20211118073125.12283-18-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mxser: increase buf_overrun if tty_insert_flip_char() fails</title>
<updated>2021-11-25T17:33:22Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2021-11-18T07:31:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eb68ac0462bffc2ceb63b3a76737d6c9f186e6de'/>
<id>urn:sha1:eb68ac0462bffc2ceb63b3a76737d6c9f186e6de</id>
<content type='text'>
mxser doesn't increase port-&gt;icount.buf_overrun at all. Do so if overrun
happens, so that it can be read from the stats.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Link: https://lore.kernel.org/r/20211118073125.12283-17-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mxser: remove tty parameter from mxser_receive_chars_new()</title>
<updated>2021-11-25T17:33:22Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2021-11-18T07:31:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9dd6f3063a733e0df2ff66f9c35419eb217d9af5'/>
<id>urn:sha1:9dd6f3063a733e0df2ff66f9c35419eb217d9af5</id>
<content type='text'>
After the previous change (no plays with of tty-&gt;receive_room), the tty
parameter is unused.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Link: https://lore.kernel.org/r/20211118073125.12283-16-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mxser: don't throttle manually</title>
<updated>2021-11-25T17:33:22Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2021-11-18T07:31:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c6693e6e07805f1b7822b13a5b482bf2b6a1f312'/>
<id>urn:sha1:c6693e6e07805f1b7822b13a5b482bf2b6a1f312</id>
<content type='text'>
First, checking tty-&gt;receive_room to signalize whether there is enough space
in the tty buffers does not make much sense. Provided the tty buffers
are in tty_port and those are not checked at all.

Second, if the rx path is throttled, with CRTSCTS, RTS is deasserted,
but is never asserted again. This leads to port "lockup", not accepting
any more input.

So:
1) stty -F /dev/ttyMI0 crtscts # the mxser port
2) stty -F /dev/ttyS6 crtscts # the connected port
3) cat /dev/ttyMI0
4) "write in a loop" to /dev/ttyS6
5) cat from 3) produces the bytes from 4)
6) killall -STOP cat (the 3)'s one)
7) wait for RTS to drop on /dev/ttyMI0
8) killall -CONT cat (again the 3)'s one)

cat erroneously produces no more output now (i.e. no data sent from
ttyS6 to ttyMI can be seen).

Note that the step 7) is performed twice: once from n_tty by
tty_throttle_safe(), once by mxser_stoprx() from the receive path. Then
after step 7), n_tty correctly unthrottles the input, but mxser calls
mxser_stoprx() again as there is still only a little space in n_tty
buffers (tty-&gt;receive_room mentioned at the beginning), but the device's
FIFO is/can be already filled.

After this patch, the output is correctly resumed, i.e. n_tty both
throttles and unthrottles without interfering with mxser's attempts.

This allows us to get rid of the non-standard ldisc_stop_rx flag from
struct mxser_port.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Link: https://lore.kernel.org/r/20211118073125.12283-15-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mxser: clean up timeout handling in mxser_wait_until_sent()</title>
<updated>2021-11-25T17:33:22Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2021-11-18T07:31:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=49b798a69e2b1b8c9de6df66a5b8ccf090583551'/>
<id>urn:sha1:49b798a69e2b1b8c9de6df66a5b8ccf090583551</id>
<content type='text'>
timeout cannot be zero at the point of use. So no need to check for
zero. Also precompute the expiration time (into expire) and use it. This
makes the code more clear.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Link: https://lore.kernel.org/r/20211118073125.12283-14-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mxser: use msleep_interruptible() in mxser_wait_until_sent()</title>
<updated>2021-11-25T17:33:22Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2021-11-18T07:31:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fe74bc619b0db23c4b513141acd3e3e45694bb08'/>
<id>urn:sha1:fe74bc619b0db23c4b513141acd3e3e45694bb08</id>
<content type='text'>
Instead of schedule_timeout_interruptible(), because:
1) we don't have to bother with the task state, and
2) msleep* guarantees to sleep that time (if not interrupted).

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Link: https://lore.kernel.org/r/20211118073125.12283-13-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mxser: extract TX empty check from mxser_wait_until_sent()</title>
<updated>2021-11-25T17:33:22Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2021-11-18T07:31:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=239ef19ef040698ccbabf25582b40c43554542fd'/>
<id>urn:sha1:239ef19ef040698ccbabf25582b40c43554542fd</id>
<content type='text'>
And move it to new mxser_tx_empty(), because:
1) it simplifies the code (esp. the locking), and
2) serial_core needs such a hook anyway, so have it ready.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Link: https://lore.kernel.org/r/20211118073125.12283-12-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mxser: use tty_port_close() in mxser_close()</title>
<updated>2021-11-25T17:33:22Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2021-11-18T07:31:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c7ec012f6c563a84fc5c3052d490292a129413b7'/>
<id>urn:sha1:c7ec012f6c563a84fc5c3052d490292a129413b7</id>
<content type='text'>
Finally, the mxser_close() code in is mostly identical to
tty_port_close(), so replace the code by a single call to the function.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Link: https://lore.kernel.org/r/20211118073125.12283-11-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
