<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/tty/synclink.c, branch v4.4.171</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.4.171</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.4.171'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2015-10-18T04:14:06+00:00</updated>
<entry>
<title>tty: synclink, fix indentation</title>
<updated>2015-10-18T04:14:06+00:00</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2015-10-11T13:22:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4bd0162264da0d71df7e37a12a544459ba7ddcde'/>
<id>urn:sha1:4bd0162264da0d71df7e37a12a544459ba7ddcde</id>
<content type='text'>
The statement after if should be indenteted. So fix this.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: Remove ASYNC_CLOSING checks in open()/hangup() methods</title>
<updated>2015-10-18T04:11:29+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2015-10-10T20:00:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fef062cbf2a90fd926a6fff9eb06dde1b699f1b3'/>
<id>urn:sha1:fef062cbf2a90fd926a6fff9eb06dde1b699f1b3</id>
<content type='text'>
Since at least before 2.6.30, tty drivers that do not drop the tty lock
while closing cannot observe ASYNC_CLOSING set while holding the
tty lock; this includes the tty driver's open() and hangup() methods,
since the tty core calls these methods holding the tty lock.

For these drivers, waiting for ASYNC_CLOSING to clear while opening
is not required, since this condition cannot occur. Similarly, even
when the open() method drops and reacquires the tty lock after
blocking, ASYNC_CLOSING cannot be set (again, for drivers that
do not drop the tty lock while closing).

Now that tty port drivers no longer drop the tty lock while closing
(since 'tty: Remove tty_wait_until_sent_from_close()'), the same
conditions apply: waiting for ASYNC_CLOSING to clear while opening
is not required, nor is re-checking ASYNC_CLOSING after dropping and
reacquiring the tty lock while blocking (eg., in *_block_til_ready()).

Note: The ASYNC_CLOSING flag state is still maintained since several
bitrotting drivers use it for (dubious) other purposes.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: synclink.c: move assignment out of if () block</title>
<updated>2015-05-10T17:04:18+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2015-04-30T09:22:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a271ca37ac85efac89533799d53dc32325480db1'/>
<id>urn:sha1:a271ca37ac85efac89533799d53dc32325480db1</id>
<content type='text'>
We should not be doing assignments within an if () block
so fix up the code to not do this.

change was created using Coccinelle.

CC: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: Remove tty_hung_up_p() tests from tty drivers' open()</title>
<updated>2014-07-10T23:06:49+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2014-06-16T13:17:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e359a4e38d229d53e28905863a1fabf41debd591'/>
<id>urn:sha1:e359a4e38d229d53e28905863a1fabf41debd591</id>
<content type='text'>
Since at least before 2.6.30, it has not been possible to observe
a hung up file pointer in a tty driver's open() method unless/until
the driver open() releases the tty_lock() (eg., before blocking).

This is because tty_open() adds the file pointer while holding
the tty_lock() _and_ doesn't release the lock until after calling
the tty driver's open() method. [ Before tty_lock(), this was
lock_kernel(). ]

Since __tty_hangup() first waits on the tty_lock() before
enumerating and hanging up the open file pointers, either
__tty_hangup() will wait for the tty_lock() or tty_open() will
not yet have added the file pointer. For example,

CPU 0                          |  CPU 1
                               |
tty_open                       |  __tty_hangup
  ..                           |    ..
  tty_lock                     |    ..
  tty_reopen                   |    tty_lock  / blocks
  ..                           |
  tty_add_file(tty, filp)      |
  ..                           |
  tty-&gt;ops-&gt;open(tty, filp)    |
    tty_port_open              |
      tty_port_block_til_ready |
        ..                     |
        while (1)              |
          ..                   |
          tty_unlock           |    / unblocks
          schedule             |    for each filp on tty-&gt;tty_files
                               |      f_ops = tty_hung_up_fops;
                               |    ..
                               |    tty_unlock
          tty_lock             |
  ..                           |
  tty_unlock                   |

Note that since tty_port_block_til_ready() and similar drop
the tty_lock while blocking, when woken, the file pointer
must then be tested for having been hung up.

Also, fix bit-rotted drivers that used extra_count to track the
port-&gt;count bump.

CC: Mikael Starvik &lt;starvik@axis.com&gt;
CC: Samuel Ortiz &lt;samuel@sortiz.org&gt;
CC: "David S. Miller" &lt;davem@davemloft.net&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Acked-by: Jesper Nilsson &lt;jesper.nilsson@axis.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>synclink: fix info leak in ioctl</title>
<updated>2014-03-17T23:13:23+00:00</updated>
<author>
<name>Salva Peiró</name>
<email>speiro@ai2.upv.es</email>
</author>
<published>2014-03-11T18:31:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b19a47e0603ef89c4179e6e48f6dd1ccc7fa3a7c'/>
<id>urn:sha1:b19a47e0603ef89c4179e6e48f6dd1ccc7fa3a7c</id>
<content type='text'>
The hdlcdev_ioctl() code fails to initialize the two padding bytes of
struct sync_serial_settings after the -&gt;loopback member. Add an explicit
memset(0) before filling the structure to avoid the info leak.

Signed-off-by: Salva Peiró &lt;speiro@ai2.upv.es&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: synclink: avoid sleep_on race</title>
<updated>2014-01-08T01:05:21+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2014-01-02T12:07:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b8c98ae49e8d53344b1d62417eea05ebc3cdbd78'/>
<id>urn:sha1:b8c98ae49e8d53344b1d62417eea05ebc3cdbd78</id>
<content type='text'>
The four variants of the synclink driver use the same code in their
open() callback to wait for a port in process of being closed,
using interruptible_sleep_on, which is racy and going away soon.

Making things worse, these functions hold the BTM while doing so,
which means that if we ever enter this code path, we cannot actually
continue since the other thread that is in process of closing the
port can no longer get the BTM.

This addresses both issues by using wait_event_interruptible_tty()
instead.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>TTY: synclink: replace bitmasks add operation with OR operation.</title>
<updated>2013-07-29T19:47:37+00:00</updated>
<author>
<name>Alexandru Juncu</name>
<email>alexj@rosedu.org</email>
</author>
<published>2013-07-27T08:14:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e06922aa836f098c4893218a1c656ce7d73a3b6a'/>
<id>urn:sha1:e06922aa836f098c4893218a1c656ce7d73a3b6a</id>
<content type='text'>
Found with coccinelle, manually fixed and verified.

Signed-off-by: Alexandru Juncu &lt;alexj@rosedu.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>TTY: synclink: fix DTR being raised on hang up</title>
<updated>2013-04-12T21:08:17+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>jhovold@gmail.com</email>
</author>
<published>2013-04-12T08:32:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=78c6cccadb6ead2dab503f95aefdbfb2ae409a32'/>
<id>urn:sha1:78c6cccadb6ead2dab503f95aefdbfb2ae409a32</id>
<content type='text'>
Make sure to check ASYNC_INITIALISED before raising DTR when waking up
from blocked open in block_til_ready.

Currently DTR could get raised at hang up as a blocked process would
raise DTR unconditionally before checking for hang up and returning.

Signed-off-by: Johan Hovold &lt;jhovold@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>TTY: synclink, remove superfluous check</title>
<updated>2013-03-18T23:17:20+00:00</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2013-03-07T12:12:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=049b539b39977fc9343056435eba568fc7779970'/>
<id>urn:sha1:049b539b39977fc9343056435eba568fc7779970</id>
<content type='text'>
info is obtained by container_of. It can never be NULL. So do not test
that.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>TTY: synclink: Convert + to | for bit operations</title>
<updated>2013-01-30T05:09:58+00:00</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2013-01-28T02:21:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9fe8074b82ed14358be50c62ab9d081bcb911607'/>
<id>urn:sha1:9fe8074b82ed14358be50c62ab9d081bcb911607</id>
<content type='text'>
Dan Carpenter noticed a missing set of parentheses
around a multiple field addition.

https://lkml.org/lkml/2013/1/27/166

His original commit message:

There is a kind of precedence problem here, but it doesn't affect how
the code works because -&gt;serial_signals is unsigned char.  We want to
clear two flags here.

#define SerialSignal_RTS            0x20     /* Request to Send */
#define SerialSignal_DTR            0x80     /* Data Terminal Ready */

Without the parenthesis then it does:

	info-&gt;serial_signals &amp;= 0x5f;

With the parenthesis it does:

	info-&gt;serial_signals &amp;= 0xffffff5f;

info-&gt;serial_signals is an unsigned char so the two statements are
equivalent, but it's cleaner to add the parenthesis.  In other dtr_rts()
functions the parenthesis are there so this makes it more consistent.

Other changes:

Convert all + uses to | for these bit operations.

Reorder the multiple fields for consistency.
Update the comments too.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
