<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/tty/tty_mutex.c, branch v4.4</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=v4.4</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-02-02T18:11:27Z</updated>
<entry>
<title>tty: Make lock subclasses available for other tty locks</title>
<updated>2015-02-02T18:11:27Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2015-01-17T20:42:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3abf87cd3e70009ed70a7f28c2914888a7e27332'/>
<id>urn:sha1:3abf87cd3e70009ed70a7f28c2914888a7e27332</id>
<content type='text'>
Besides nested legacy_mutex locking which is required on pty pair
teardown, other nested pty operations require lock subclassing.

Move lock subclass definition to tty interface header, include/linux/tty.h,
and document its use.

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: Remove warning in tty_lock_slave()</title>
<updated>2015-01-09T22:17:59Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2014-12-30T12:11:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eef15e2a54fad4c2ce3f0a81485dc591ce678f4f'/>
<id>urn:sha1:eef15e2a54fad4c2ce3f0a81485dc591ce678f4f</id>
<content type='text'>
Commit 2aff5e2bc62db43e05c814461a08aff0fc2b7fe5 ('tty: Change
tty lock order to master-&gt;slave') added a warning which is broken
and unnecessary now that the tty lock has fixed lock subclasses,
added in commit 2febdb632bb96235b94b8fccaf882a78f8f4b2bb
('tty: Preset lock subclass for nested tty locks').

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
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: Preset lock subclass for nested tty locks</title>
<updated>2014-11-06T02:50:42Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2014-11-05T17:13:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2febdb632bb96235b94b8fccaf882a78f8f4b2bb'/>
<id>urn:sha1:2febdb632bb96235b94b8fccaf882a78f8f4b2bb</id>
<content type='text'>
Eliminate the requirement of specifying the tty lock nesting at
lock time; instead, set the lock subclass for slave ptys at pty
install (normal ttys and master ptys use subclass 0).

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: Change tty lock order to master-&gt;slave</title>
<updated>2014-11-06T02:50:42Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2014-11-05T17:13:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2aff5e2bc62db43e05c814461a08aff0fc2b7fe5'/>
<id>urn:sha1:2aff5e2bc62db43e05c814461a08aff0fc2b7fe5</id>
<content type='text'>
When releasing the master pty, the slave pty also needs to be locked
to prevent concurrent tty count changes for the slave pty and to
ensure that only one parallel master and slave release observe the
final close, and proceed to destruct the pty pair. Conversely, when
releasing the slave pty, locking the master pty is not necessary
(since the master's state can be inferred by the slave tty count).

Introduce tty_lock_slave()/tty_unlock_slave() which acquires/releases
the tty lock of the slave pty. Remove tty_lock_pair()/tty_unlock_pair().

Dropping the tty_lock is no longer required to re-establish a stable
lock order.

Reviewed-by: Alan Cox &lt;alan@linux.intel.com&gt;
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: tty_mutex.c: Fixed coding style warning (using printk)</title>
<updated>2012-10-24T18:34:51Z</updated>
<author>
<name>Sangho Yi</name>
<email>antiroot@gmail.com</email>
</author>
<published>2012-10-17T15:15:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7a0c4edae99da6ab3d402deb0d88410251c6ac63'/>
<id>urn:sha1:7a0c4edae99da6ab3d402deb0d88410251c6ac63</id>
<content type='text'>
Here I fixed from printk(KERN_ERR, ... to pr_err(... on tty_mutex.c

Signed-off-by: Sangho Yi &lt;antiroot@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: localise the lock</title>
<updated>2012-08-10T19:55:47Z</updated>
<author>
<name>Alan Cox</name>
<email>alan@linux.intel.com</email>
</author>
<published>2012-08-08T15:30:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=89c8d91e31f267703e365593f6bfebb9f6d2ad01'/>
<id>urn:sha1:89c8d91e31f267703e365593f6bfebb9f6d2ad01</id>
<content type='text'>
The termios and other changes mean the other protections needed on the driver
tty arrays should be adequate. Turn it all back on.

This contains pieces folded in from the fixes made to the original patches

| From: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;	(fix m68k)
| From: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;	(fix cris)
| From: Jiri Kosina &lt;jkosina@suze.cz&gt;			(lockdep)
| From: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;		(lockdep)

Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: revert incorrectly applied lock patch</title>
<updated>2012-07-16T19:58:12Z</updated>
<author>
<name>Alan Cox</name>
<email>alan@linux.intel.com</email>
</author>
<published>2012-07-14T14:31:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6d31a88cb2e01d46c0cb74aa5da529e1f92ae3db'/>
<id>urn:sha1:6d31a88cb2e01d46c0cb74aa5da529e1f92ae3db</id>
<content type='text'>
I sent GregKH this after the pre-requisites. He dropped the pre-requesites
for good reason and unfortunately then applied this patch. Without this
reverted you get random kernel memory corruption which will make bisecting
anything between it and the properly applied patches a complete sod.

Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: localise the lock</title>
<updated>2012-07-06T21:24:52Z</updated>
<author>
<name>Alan Cox</name>
<email>alan@linux.intel.com</email>
</author>
<published>2012-06-29T13:48:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f5e3bcc504c3c35cc6e06a9ee42efed7c274066b'/>
<id>urn:sha1:f5e3bcc504c3c35cc6e06a9ee42efed7c274066b</id>
<content type='text'>
The termios and other changes mean the other protections needed on the driver
tty arrays should be adequate. Turn it all back on.

This contains pieces folded in from the fixes made to the original patches

| From: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;	(fix m68k)
| From: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;	(fix cris)
| From: Jiri Kosina &lt;jkosina@suze.cz&gt;			(lockdep)
| From: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;		(lockdep)

Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: Revert the tty locking series, it needs more work</title>
<updated>2012-06-02T22:21:43Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-06-02T22:21:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f309532bf3e1cc1b787403d84e3039812a7dbe50'/>
<id>urn:sha1:f309532bf3e1cc1b787403d84e3039812a7dbe50</id>
<content type='text'>
This reverts the tty layer change to use per-tty locking, because it's
not correct yet, and fixing it will require some more deep surgery.

The main revert is d29f3ef39be4 ("tty_lock: Localise the lock"), but
there are several smaller commits that built upon it, they also get
reverted here. The list of reverted commits is:

  fde86d310886 - tty: add lockdep annotations
  8f6576ad476b - tty: fix ldisc lock inversion trace
  d3ca8b64b97e - pty: Fix lock inversion
  b1d679afd766 - tty: drop the pty lock during hangup
  abcefe5fc357 - tty/amiserial: Add missing argument for tty_unlock()
  fd11b42e3598 - cris: fix missing tty arg in wait_event_interruptible_tty call
  d29f3ef39be4 - tty_lock: Localise the lock

The revert had a trivial conflict in the 68360serial.c staging driver
that got removed in the meantime.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>tty: add lockdep annotations</title>
<updated>2012-05-31T18:59:41Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2012-05-31T09:35:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fde86d310886372a377213251e72fb87aaa406c9'/>
<id>urn:sha1:fde86d310886372a377213251e72fb87aaa406c9</id>
<content type='text'>
tty_lock_pair() do the right thing to avoid deadlocks, but should
instruct LOCKDEP of this to avoid a splat.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
