<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/tty, branch v3.8.8</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v3.8.8</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v3.8.8'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2013-04-17T04:48:30+00:00</updated>
<entry>
<title>tty: don't deadlock while flushing workqueue</title>
<updated>2013-04-17T04:48:30+00:00</updated>
<author>
<name>Sebastian Andrzej Siewior</name>
<email>bigeasy@linutronix.de</email>
</author>
<published>2012-12-25T22:02:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=77d0ca8b5d7e7cd48005ddb79b05c79082a68bb5'/>
<id>urn:sha1:77d0ca8b5d7e7cd48005ddb79b05c79082a68bb5</id>
<content type='text'>
commit 852e4a8152b427c3f318bb0e1b5e938d64dcdc32 upstream.

Since commit 89c8d91e31f2 ("tty: localise the lock") I see a dead lock
in one of my dummy_hcd + g_nokia test cases. The first run was usually
okay, the second often resulted in a splat by lockdep and the third was
usually a dead lock.
Lockdep complained about tty-&gt;hangup_work and tty-&gt;legacy_mutex taken
both ways:
| ======================================================
| [ INFO: possible circular locking dependency detected ]
| 3.7.0-rc6+ #204 Not tainted
| -------------------------------------------------------
| kworker/2:1/35 is trying to acquire lock:
|  (&amp;tty-&gt;legacy_mutex){+.+.+.}, at: [&lt;c14051e6&gt;] tty_lock_nested+0x36/0x80
|
| but task is already holding lock:
|  ((&amp;tty-&gt;hangup_work)){+.+...}, at: [&lt;c104f6e4&gt;] process_one_work+0x124/0x5e0
|
| which lock already depends on the new lock.
|
| the existing dependency chain (in reverse order) is:
|
| -&gt; #2 ((&amp;tty-&gt;hangup_work)){+.+...}:
|        [&lt;c107fe74&gt;] lock_acquire+0x84/0x190
|        [&lt;c104d82d&gt;] flush_work+0x3d/0x240
|        [&lt;c12e6986&gt;] tty_ldisc_flush_works+0x16/0x30
|        [&lt;c12e7861&gt;] tty_ldisc_release+0x21/0x70
|        [&lt;c12e0dfc&gt;] tty_release+0x35c/0x470
|        [&lt;c1105e28&gt;] __fput+0xd8/0x270
|        [&lt;c1105fcd&gt;] ____fput+0xd/0x10
|        [&lt;c1051dd9&gt;] task_work_run+0xb9/0xf0
|        [&lt;c1002a51&gt;] do_notify_resume+0x51/0x80
|        [&lt;c140550a&gt;] work_notifysig+0x35/0x3b
|
| -&gt; #1 (&amp;tty-&gt;legacy_mutex/1){+.+...}:
|        [&lt;c107fe74&gt;] lock_acquire+0x84/0x190
|        [&lt;c140276c&gt;] mutex_lock_nested+0x6c/0x2f0
|        [&lt;c14051e6&gt;] tty_lock_nested+0x36/0x80
|        [&lt;c1405279&gt;] tty_lock_pair+0x29/0x70
|        [&lt;c12e0bb8&gt;] tty_release+0x118/0x470
|        [&lt;c1105e28&gt;] __fput+0xd8/0x270
|        [&lt;c1105fcd&gt;] ____fput+0xd/0x10
|        [&lt;c1051dd9&gt;] task_work_run+0xb9/0xf0
|        [&lt;c1002a51&gt;] do_notify_resume+0x51/0x80
|        [&lt;c140550a&gt;] work_notifysig+0x35/0x3b
|
| -&gt; #0 (&amp;tty-&gt;legacy_mutex){+.+.+.}:
|        [&lt;c107f3c9&gt;] __lock_acquire+0x1189/0x16a0
|        [&lt;c107fe74&gt;] lock_acquire+0x84/0x190
|        [&lt;c140276c&gt;] mutex_lock_nested+0x6c/0x2f0
|        [&lt;c14051e6&gt;] tty_lock_nested+0x36/0x80
|        [&lt;c140523f&gt;] tty_lock+0xf/0x20
|        [&lt;c12df8e4&gt;] __tty_hangup+0x54/0x410
|        [&lt;c12dfcb2&gt;] do_tty_hangup+0x12/0x20
|        [&lt;c104f763&gt;] process_one_work+0x1a3/0x5e0
|        [&lt;c104fec9&gt;] worker_thread+0x119/0x3a0
|        [&lt;c1055084&gt;] kthread+0x94/0xa0
|        [&lt;c140ca37&gt;] ret_from_kernel_thread+0x1b/0x28
|
|other info that might help us debug this:
|
|Chain exists of:
|  &amp;tty-&gt;legacy_mutex --&gt; &amp;tty-&gt;legacy_mutex/1 --&gt; (&amp;tty-&gt;hangup_work)
|
| Possible unsafe locking scenario:
|
|       CPU0                    CPU1
|       ----                    ----
|  lock((&amp;tty-&gt;hangup_work));
|                               lock(&amp;tty-&gt;legacy_mutex/1);
|                               lock((&amp;tty-&gt;hangup_work));
|  lock(&amp;tty-&gt;legacy_mutex);
|
| *** DEADLOCK ***

Before the path mentioned tty_ldisc_release() look like this:

|	tty_ldisc_halt(tty);
|	tty_ldisc_flush_works(tty);
|	tty_lock();

As it can be seen, it first flushes the workqueue and then grabs the
tty_lock. Now we grab the lock first:

|	tty_lock_pair(tty, o_tty);
|	tty_ldisc_halt(tty);
|	tty_ldisc_flush_works(tty);

so lockdep's complaint seems valid.

The earlier version of this patch took the ldisc_mutex since the other
user of tty_ldisc_flush_works() (tty_set_ldisc()) did this.
Peter Hurley then said that it is should not be requried. Since it
wasn't done earlier, I dropped this part.
The code under tty_ldisc_kill() was executed earlier with the tty lock
taken so it is taken again.

I was able to reproduce the deadlock on v3.8-rc1, this patch fixes the
problem in my testcase. I didn't notice any problems so far.

Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Cc: Alan Cox &lt;alan@linux.intel.com&gt;
Cc: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Cc: Bryan O'Donoghue &lt;bryan.odonoghue.lkml@nexus-software.ie&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Revert "tty/8250_pnp: serial port detection regression since v3.7"</title>
<updated>2013-04-12T16:52:13+00:00</updated>
<author>
<name>Sean Young</name>
<email>sean@mess.org</email>
</author>
<published>2013-04-07T19:47:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=292f82fc424238e32754ca67b2b9f280d53efea0'/>
<id>urn:sha1:292f82fc424238e32754ca67b2b9f280d53efea0</id>
<content type='text'>
commit c12f9ea28e9fbe7b1f4cefc953bee33298370683 upstream.

This reverts commit 77e372a3d82e5e4878ce1962207edd766773cc76.

Checking for disabled resources board breaks detection pnp on another
board "AMI UEFI implementation (Version: 0406 Release Date: 06/06/2012)".
I'm working with the reporter of the original bug to write and test
a better fix.

https://bugzilla.redhat.com/show_bug.cgi?id=928246

Signed-off-by: Sean Young &lt;sean@mess.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>vt: synchronize_rcu() under spinlock is not nice...</title>
<updated>2013-04-05T16:25:50+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2013-03-27T00:30:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=240e18740d9f9f45fc31b6a5b792eefc25561c27'/>
<id>urn:sha1:240e18740d9f9f45fc31b6a5b792eefc25561c27</id>
<content type='text'>
commit e8cd81693bbbb15db57d3c9aa7dd90eda4842874 upstream.

vcs_poll_data_free() calls unregister_vt_notifier(), which calls
atomic_notifier_chain_unregister(), which calls synchronize_rcu().
Do it *after* we'd dropped -&gt;f_lock.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tty: atmel_serial_probe(): index of atmel_ports[] fix</title>
<updated>2013-04-05T16:25:50+00:00</updated>
<author>
<name>Pawel Wieczorkiewicz</name>
<email>wpawel@gmail.com</email>
</author>
<published>2013-02-20T16:26:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7b3d641e3e7c5968808d2cff1392a317860f1e10'/>
<id>urn:sha1:7b3d641e3e7c5968808d2cff1392a317860f1e10</id>
<content type='text'>
commit 503bded92da283b2f31d87e054c4c6d30c3c2340 upstream.

Index of atmel_ports[ATMEL_MAX_UART] should be smaller
than ATMEL_MAX_UART.

Signed-off-by: Pawel Wieczorkiewicz &lt;wpawel@gmail.com&gt;
Acked-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>sunsu: Fix panic in case of nonexistent port at "console=ttySY" cmdline option</title>
<updated>2013-03-28T19:17:07+00:00</updated>
<author>
<name>Tkhai Kirill</name>
<email>tkhai@yandex.ru</email>
</author>
<published>2013-02-23T23:01:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ad24fbcb6dd954b3129a4d62208489048eebb6f3'/>
<id>urn:sha1:ad24fbcb6dd954b3129a4d62208489048eebb6f3</id>
<content type='text'>
[ Upstream commit cb29529ea0030e60ef1bbbf8399a43d397a51526 ]

If a machine has X (X &lt; 4) sunsu ports and cmdline
option "console=ttySY" is passed, where X &lt; Y &lt;= 4,
than the following panic happens:

Unable to handle kernel NULL pointer dereference
TPC: &lt;sunsu_console_setup+0x78/0xe0&gt;
RPC: &lt;sunsu_console_setup+0x74/0xe0&gt;
I7: &lt;register_console+0x378/0x3e0&gt;
Call Trace:
 [0000000000453a38] register_console+0x378/0x3e0
 [0000000000576fa0] uart_add_one_port+0x2e0/0x340
 [000000000057af40] su_probe+0x160/0x2e0
 [00000000005b8a4c] platform_drv_probe+0xc/0x20
 [00000000005b6c2c] driver_probe_device+0x12c/0x220
 [00000000005b6da8] __driver_attach+0x88/0xa0
 [00000000005b4df4] bus_for_each_dev+0x54/0xa0
 [00000000005b5a54] bus_add_driver+0x154/0x260
 [00000000005b7190] driver_register+0x50/0x180
 [00000000006d250c] sunsu_init+0x18c/0x1e0
 [00000000006c2668] do_one_initcall+0xe8/0x160
 [00000000006c282c] kernel_init_freeable+0x12c/0x1e0
 [0000000000603764] kernel_init+0x4/0x100
 [0000000000405f64] ret_from_syscall+0x1c/0x2c
 [0000000000000000]           (null)

1)Fix the panic;
2)Increment registered port number every successful
probe.

Signed-off-by: Kirill Tkhai &lt;tkhai@yandex.ru&gt;
CC: David Miller &lt;davem@davemloft.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Fix 4 port and add support for 8 port 'Unknown' PCI serial port cards</title>
<updated>2013-03-20T20:10:54+00:00</updated>
<author>
<name>Scott Ashcroft</name>
<email>scott.ashcroft@talk21.com</email>
</author>
<published>2013-03-03T21:35:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f2ebfa449f40a0dc0ff35ab35a35744c4d249b82'/>
<id>urn:sha1:f2ebfa449f40a0dc0ff35ab35a35744c4d249b82</id>
<content type='text'>
commit d13402a4a944e72612a9ec5c9190e35717c02a9d upstream.

I've managed to find an 8 port version of the card 4 port card which was discussed here:

http://marc.info/?l=linux-serial&amp;m=120760744205314&amp;w=2

Looking back at that thread there were two issues in the original patch.

1) The I/O ports for the UARTs are within BAR2 not BAR0. This can been seen in the original post.
2) A serial quirk isn't needed as these cards have no memory in BAR0 which makes pci_plx9050_init just return.

This patch fixes the 4 port support to use BAR2, removes the bogus quirk and adds support for the 8 port card.

$ lspci -vvv -n -s 00:08.0
00:08.0 0780: 10b5:9050 (rev 01)
	Subsystem: 10b5:1588
	Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium &gt;TAbort- &lt;TAbort- &lt;MAbort- &gt;SERR- &lt;PERR- INTx-
	Interrupt: pin A routed to IRQ 17
	Region 1: I/O ports at ff00 [size=128]
	Region 2: I/O ports at fe00 [size=64]
	Region 3: I/O ports at fd00 [size=8]
	Capabilities: &lt;access denied&gt;
	Kernel driver in use: serial

$ dmesg | grep 0000:00:08.0:
[    0.083320] pci 0000:00:08.0: [10b5:9050] type 0 class 0x000780
[    0.083355] pci 0000:00:08.0: reg 14: [io  0xff00-0xff7f]
[    0.083369] pci 0000:00:08.0: reg 18: [io  0xfe00-0xfe3f]
[    0.083382] pci 0000:00:08.0: reg 1c: [io  0xfd00-0xfd07]
[    0.083460] pci 0000:00:08.0: PME# supported from D0 D3hot
[    1.212867] 0000:00:08.0: ttyS4 at I/O 0xfe00 (irq = 17) is a 16550A
[    1.233073] 0000:00:08.0: ttyS5 at I/O 0xfe08 (irq = 17) is a 16550A
[    1.253270] 0000:00:08.0: ttyS6 at I/O 0xfe10 (irq = 17) is a 16550A
[    1.273468] 0000:00:08.0: ttyS7 at I/O 0xfe18 (irq = 17) is a 16550A
[    1.293666] 0000:00:08.0: ttyS8 at I/O 0xfe20 (irq = 17) is a 16550A
[    1.313863] 0000:00:08.0: ttyS9 at I/O 0xfe28 (irq = 17) is a 16550A
[    1.334061] 0000:00:08.0: ttyS10 at I/O 0xfe30 (irq = 17) is a 16550A
[    1.354258] 0000:00:08.0: ttyS11 at I/O 0xfe38 (irq = 17) is a 16550A

Signed-off-by: Scott Ashcroft &lt;scott.ashcroft@talk21.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>TTY: do not reset master's packet mode</title>
<updated>2013-03-20T20:10:54+00:00</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2013-01-15T22:26:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3c39ecfd0ed5671344845f2c866e73103d8361a0'/>
<id>urn:sha1:3c39ecfd0ed5671344845f2c866e73103d8361a0</id>
<content type='text'>
commit b81273a132177edd806476b953f6afeb17b786d5 upstream.

Now that login from util-linux is forced to drop all references to a
TTY which it wants to hangup (to reach reference count 1) we are
seeing issues with telnet. When login closes its last reference to the
slave PTY, it also resets packet mode on the *master* side. And we
have a race here.

What telnet does is fork+exec of `login'. Then there are two
scenarios:
* `login' closes the slave TTY and resets thus master's packet mode,
  but even now telnet properly sets the mode, or
* `telnetd' sets packet mode on the master, `login' closes the slave
  TTY and resets master's packet mode.

The former case is OK. However the latter happens in much more cases,
by the order of magnitude to be precise. So when one tries to login to
such a messed telnet setup, they see the following:
inux login:
            ogin incorrect

Note the missing first letters -- telnet thinks it is still in the
packet mode, so when it receives "linux login" from `login', it
considers "l" as the type of the packet and strips it.

SuS does not mention how the implementation should behave. Both BSDs I
checked (Free and Net) do not reset the flag upon the last close.

By this I am resurrecting an old bug, see References. We are hitting
it regularly now, i.e. with updated util-linux, ergo login.

Here, I am changing a behavior introduced back in 2.1 times. It would
better have a long time testing before goes upstream.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
Cc: Bryan Mason &lt;bmason@redhat.com&gt;
References: https://lkml.org/lkml/2009/11/11/223
References: https://bugzilla.redhat.com/show_bug.cgi?id=504703
References: https://bugzilla.novell.com/show_bug.cgi?id=797042
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>TTY: disable debugging warning</title>
<updated>2013-03-20T20:10:54+00:00</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2013-02-27T21:30:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=34cc65c1b46e25d24eb4744be0b62541869a2bd0'/>
<id>urn:sha1:34cc65c1b46e25d24eb4744be0b62541869a2bd0</id>
<content type='text'>
commit 34dcfb8479ab3c3669561eb9279284cb0eda2572 upstream.

We added a warning to flush_to_ldisc to report cases when it is called
with a NULL tty. It was for debugging purposes and it lead to a
patchset from Peter Hurley. The patchset however did not make it to
3.9, so disable the warning now to not disturb people.

We can re-add it when the series is in and we are hunting for another
bugs.

Reported-by: David Miller &lt;davem@davemloft.net&gt;
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/serial: Add support for Altera serial port</title>
<updated>2013-03-20T20:10:54+00:00</updated>
<author>
<name>Ley Foon Tan</name>
<email>lftan@altera.com</email>
</author>
<published>2013-03-07T02:28:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ec99e285dbd0dfc65495b459b57b35e1ce5dc55c'/>
<id>urn:sha1:ec99e285dbd0dfc65495b459b57b35e1ce5dc55c</id>
<content type='text'>
commit e06c93cacb82dd147266fd1bdb2d0a0bd45ff2c1 upstream.

Add support for Altera 8250/16550 compatible serial port.

Signed-off-by: Ley Foon Tan &lt;lftan@altera.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tty: serial: fix typo "SERIAL_S3C2412"</title>
<updated>2013-03-20T20:10:54+00:00</updated>
<author>
<name>Paul Bolle</name>
<email>pebolle@tiscali.nl</email>
</author>
<published>2013-03-12T09:10:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=53b90339a62ec1d726130a4ad273d826ebefc04d'/>
<id>urn:sha1:53b90339a62ec1d726130a4ad273d826ebefc04d</id>
<content type='text'>
commit c51d41a1dd8f23a06a4ed651ebb9617de7f59368 upstream.

The Kconfig symbol SERIAL_S3C2412 got removed in commit
da121506eb03ee5daea55404709110b798bd61d9 ("serial: samsung: merge
probe() function from all SoC specific extensions"). But it also added a
last reference to that symbol. The commit and the tree make clear that
CPU_S3C2412 should have been used instead.

Signed-off-by: Paul Bolle &lt;pebolle@tiscali.nl&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
