<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/tty, branch v3.14.3</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>hvc: ensure hvc_init is only ever called once in hvc_console.c</title>
<updated>2014-05-06T14:59:33+00:00</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2014-01-14T21:03:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=df55b19e5b501e69790ccb5cc5deb45b7245cc78'/>
<id>df55b19e5b501e69790ccb5cc5deb45b7245cc78</id>
<content type='text'>
commit f76a1cbed18c86e2d192455f0daebb48458965f3 upstream.

Commit 3e6c6f630a5282df8f3393a59f10eb9c56536d23 ("Delay creation of
khcvd thread") moved the call of hvc_init from being a device_initcall
into hvc_alloc, and used a non-null hvc_driver as indication of whether
hvc_init had already been called.

The problem with this is that hvc_driver is only assigned a value
at the bottom of hvc_init, and so there is a window where multiple
hvc_alloc calls can be in progress at the same time and hence try
and call hvc_init multiple times.  Previously the use of device_init
guaranteed that hvc_init was only called once.

This manifests itself as sporadic instances of two hvc_init calls
racing each other, and with the loser of the race getting -EBUSY
from tty_register_driver() and hence that virtual console fails:

    Couldn't register hvc console driver
    virtio-ports vport0p1: error -16 allocating hvc for port

Here we add an atomic_t to guarantee we'll never run hvc_init twice.

Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Fixes: 3e6c6f630a52 ("Delay creation of khcvd thread")
Reported-by: Jim Somerville &lt;Jim.Somerville@windriver.com&gt;
Tested-by: Jim Somerville &lt;Jim.Somerville@windriver.com&gt;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit f76a1cbed18c86e2d192455f0daebb48458965f3 upstream.

Commit 3e6c6f630a5282df8f3393a59f10eb9c56536d23 ("Delay creation of
khcvd thread") moved the call of hvc_init from being a device_initcall
into hvc_alloc, and used a non-null hvc_driver as indication of whether
hvc_init had already been called.

The problem with this is that hvc_driver is only assigned a value
at the bottom of hvc_init, and so there is a window where multiple
hvc_alloc calls can be in progress at the same time and hence try
and call hvc_init multiple times.  Previously the use of device_init
guaranteed that hvc_init was only called once.

This manifests itself as sporadic instances of two hvc_init calls
racing each other, and with the loser of the race getting -EBUSY
from tty_register_driver() and hence that virtual console fails:

    Couldn't register hvc console driver
    virtio-ports vport0p1: error -16 allocating hvc for port

Here we add an atomic_t to guarantee we'll never run hvc_init twice.

Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Fixes: 3e6c6f630a52 ("Delay creation of khcvd thread")
Reported-by: Jim Somerville &lt;Jim.Somerville@windriver.com&gt;
Tested-by: Jim Somerville &lt;Jim.Somerville@windriver.com&gt;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>tty: Fix low_latency BUG</title>
<updated>2014-04-27T00:19:04+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2014-02-22T12:31:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4f1f4df2c1aee858da70f91970f6c9cb651a63de'/>
<id>4f1f4df2c1aee858da70f91970f6c9cb651a63de</id>
<content type='text'>
commit a9c3f68f3cd8d55f809fbdb0c138ed061ea1bd25 upstream.

The user-settable knob, low_latency, has been the source of
several BUG reports which stem from flush_to_ldisc() running
in interrupt context. Since 3.12, which added several sleeping
locks (termios_rwsem and buf-&gt;lock) to the input processing path,
the frequency of these BUG reports has increased.

Note that changes in 3.12 did not introduce this regression;
sleeping locks were first added to the input processing path
with the removal of the BKL from N_TTY in commit
a88a69c91256418c5907c2f1f8a0ec0a36f9e6cc,
'n_tty: Fix loss of echoed characters and remove bkl from n_tty'
and later in commit 38db89799bdf11625a831c5af33938dcb11908b6,
'tty: throttling race fix'. Since those changes, executing
flush_to_ldisc() in interrupt_context (ie, low_latency set), is unsafe.

However, since most devices do not validate if the low_latency
setting is appropriate for the context (process or interrupt) in
which they receive data, some reports are due to misconfiguration.
Further, serial dma devices for which dma fails, resort to
interrupt receiving as a backup without resetting low_latency.

Historically, low_latency was used to force wake-up the reading
process rather than wait for the next scheduler tick. The
effect was to trim multiple milliseconds of latency from
when the process would receive new data.

Recent tests [1] have shown that the reading process now receives
data with only 10's of microseconds latency without low_latency set.

Remove the low_latency rx steering from tty_flip_buffer_push();
however, leave the knob as an optional hint to drivers that can
tune their rx fifos and such like. Cleanup stale code comments
regarding low_latency.

[1] https://lkml.org/lkml/2014/2/20/434

"Yay.. thats an annoying historical pain in the butt gone."
	-- Alan Cox

Reported-by: Beat Bolli &lt;bbolli@ewanet.ch&gt;
Reported-by: Pavel Roskin &lt;proski@gnu.org&gt;
Acked-by: David Sterba &lt;dsterba@suse.cz&gt;
Cc: Grant Edwards &lt;grant.b.edwards@gmail.com&gt;
Cc: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Cc: Hal Murray &lt;murray+fedora@ip-64-139-1-69.sjc.megapath.net&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit a9c3f68f3cd8d55f809fbdb0c138ed061ea1bd25 upstream.

The user-settable knob, low_latency, has been the source of
several BUG reports which stem from flush_to_ldisc() running
in interrupt context. Since 3.12, which added several sleeping
locks (termios_rwsem and buf-&gt;lock) to the input processing path,
the frequency of these BUG reports has increased.

Note that changes in 3.12 did not introduce this regression;
sleeping locks were first added to the input processing path
with the removal of the BKL from N_TTY in commit
a88a69c91256418c5907c2f1f8a0ec0a36f9e6cc,
'n_tty: Fix loss of echoed characters and remove bkl from n_tty'
and later in commit 38db89799bdf11625a831c5af33938dcb11908b6,
'tty: throttling race fix'. Since those changes, executing
flush_to_ldisc() in interrupt_context (ie, low_latency set), is unsafe.

However, since most devices do not validate if the low_latency
setting is appropriate for the context (process or interrupt) in
which they receive data, some reports are due to misconfiguration.
Further, serial dma devices for which dma fails, resort to
interrupt receiving as a backup without resetting low_latency.

Historically, low_latency was used to force wake-up the reading
process rather than wait for the next scheduler tick. The
effect was to trim multiple milliseconds of latency from
when the process would receive new data.

Recent tests [1] have shown that the reading process now receives
data with only 10's of microseconds latency without low_latency set.

Remove the low_latency rx steering from tty_flip_buffer_push();
however, leave the knob as an optional hint to drivers that can
tune their rx fifos and such like. Cleanup stale code comments
regarding low_latency.

[1] https://lkml.org/lkml/2014/2/20/434

"Yay.. thats an annoying historical pain in the butt gone."
	-- Alan Cox

Reported-by: Beat Bolli &lt;bbolli@ewanet.ch&gt;
Reported-by: Pavel Roskin &lt;proski@gnu.org&gt;
Acked-by: David Sterba &lt;dsterba@suse.cz&gt;
Cc: Grant Edwards &lt;grant.b.edwards@gmail.com&gt;
Cc: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Cc: Hal Murray &lt;murray+fedora@ip-64-139-1-69.sjc.megapath.net&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>tty: Set correct tty name in 'active' sysfs attribute</title>
<updated>2014-04-27T00:19:04+00:00</updated>
<author>
<name>Hannes Reinecke</name>
<email>hare@suse.de</email>
</author>
<published>2014-02-27T11:30:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=192ae8160c9465dd3f0c6650b29cc4ad019bc4e2'/>
<id>192ae8160c9465dd3f0c6650b29cc4ad019bc4e2</id>
<content type='text'>
commit 723abd87f6e536f1353c8f64f621520bc29523a3 upstream.

The 'active' sysfs attribute should refer to the currently active tty
devices the console is running on, not the currently active console. The
console structure doesn't refer to any device in sysfs, only the tty the
console is running on has. So we need to print out the tty names in
'active', not the console names.

There is one special-case, which is tty0. If the console is directed to
it, we want 'tty0' to show up in the file, so user-space knows that the
messages get forwarded to the active VT. The -&gt;device() callback would
resolve tty0, though. Hence, treat it special and don't call into the VT
layer to resolve it (plymouth is known to depend on it).

Cc: Lennart Poettering &lt;lennart@poettering.net&gt;
Cc: Kay Sievers &lt;kay@vrfy.org&gt;
Cc: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: Werner Fink &lt;werner@suse.de&gt;
Signed-off-by: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: David Herrmann &lt;dh.herrmann@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 723abd87f6e536f1353c8f64f621520bc29523a3 upstream.

The 'active' sysfs attribute should refer to the currently active tty
devices the console is running on, not the currently active console. The
console structure doesn't refer to any device in sysfs, only the tty the
console is running on has. So we need to print out the tty names in
'active', not the console names.

There is one special-case, which is tty0. If the console is directed to
it, we want 'tty0' to show up in the file, so user-space knows that the
messages get forwarded to the active VT. The -&gt;device() callback would
resolve tty0, though. Hence, treat it special and don't call into the VT
layer to resolve it (plymouth is known to depend on it).

Cc: Lennart Poettering &lt;lennart@poettering.net&gt;
Cc: Kay Sievers &lt;kay@vrfy.org&gt;
Cc: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: Werner Fink &lt;werner@suse.de&gt;
Signed-off-by: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: David Herrmann &lt;dh.herrmann@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>sparc: serial: Clean up the locking for -rt</title>
<updated>2014-03-06T21:32:25+00:00</updated>
<author>
<name>David Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2014-03-04T20:28:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e58e241c1788856f69d58821e91e5c988905252d'/>
<id>e58e241c1788856f69d58821e91e5c988905252d</id>
<content type='text'>
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Tested-by: Allen Pais &lt;allen.pais@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Tested-by: Allen Pais &lt;allen.pais@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "tty: Set correct tty name in 'active' sysfs attribute"</title>
<updated>2014-02-22T22:31:04+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2014-02-22T22:31:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5c0a2450d695bbe32b1fb81c07751bcbea64f084'/>
<id>5c0a2450d695bbe32b1fb81c07751bcbea64f084</id>
<content type='text'>
This reverts commit d8a5dc3033af2fd6d16030d2ee4fbd073460fe54.

This breaks plymouth installs, either because plymouth is using the file
"incorrectly" or because the patch is incorrect.  Either way, this needs
to be reverted until it is all figured out.

Reported-by: Josh Boyer &lt;jwboyer@fedoraproject.org&gt;
Reported-by: Ray Strode &lt;halfline@gmail.com&gt;
Cc: Lennart Poettering &lt;lennart@poettering.net&gt;
Cc: Kay Sievers &lt;kay@vrfy.org&gt;
Cc: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: David Herrmann &lt;dh.herrmann@gmail.com&gt;
Cc: Werner Fink &lt;werner@suse.de&gt;
Cc: Hannes Reinecke &lt;hare@suse.de&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit d8a5dc3033af2fd6d16030d2ee4fbd073460fe54.

This breaks plymouth installs, either because plymouth is using the file
"incorrectly" or because the patch is incorrect.  Either way, this needs
to be reverted until it is all figured out.

Reported-by: Josh Boyer &lt;jwboyer@fedoraproject.org&gt;
Reported-by: Ray Strode &lt;halfline@gmail.com&gt;
Cc: Lennart Poettering &lt;lennart@poettering.net&gt;
Cc: Kay Sievers &lt;kay@vrfy.org&gt;
Cc: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: David Herrmann &lt;dh.herrmann@gmail.com&gt;
Cc: Werner Fink &lt;werner@suse.de&gt;
Cc: Hannes Reinecke &lt;hare@suse.de&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vt: Fix secure clear screen</title>
<updated>2014-02-13T19:12:00+00:00</updated>
<author>
<name>Petr Písař</name>
<email>petr.pisar@atlas.cz</email>
</author>
<published>2014-02-06T20:01:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0930b0950a8996aa88b0d2ba4bb2bab27cc36bc7'/>
<id>0930b0950a8996aa88b0d2ba4bb2bab27cc36bc7</id>
<content type='text'>
\E[3J console code (secure clear screen) needs to update_screen(vc)
in order to write-through blanks into off-screen video memory.

This has been removed accidentally in 3.6 by:

commit 81732c3b2fede049a692e58a7ceabb6d18ffb18c
Author: Jean-François Moine &lt;moinejf@free.fr&gt;
Date:   Thu Sep 6 19:24:13 2012 +0200

    tty vt: Fix line garbage in virtual console on command line edition

Signed-off-by: Petr Písař &lt;petr.pisar@atlas.cz&gt;
Cc: stable &lt;stable@vger.kernel.org&gt; # 3.6
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
\E[3J console code (secure clear screen) needs to update_screen(vc)
in order to write-through blanks into off-screen video memory.

This has been removed accidentally in 3.6 by:

commit 81732c3b2fede049a692e58a7ceabb6d18ffb18c
Author: Jean-François Moine &lt;moinejf@free.fr&gt;
Date:   Thu Sep 6 19:24:13 2012 +0200

    tty vt: Fix line garbage in virtual console on command line edition

Signed-off-by: Petr Písař &lt;petr.pisar@atlas.cz&gt;
Cc: stable &lt;stable@vger.kernel.org&gt; # 3.6
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>serial: 8250: Support XR17V35x fraction divisor</title>
<updated>2014-02-13T18:02:19+00:00</updated>
<author>
<name>Joe Schultz</name>
<email>jschultz@xes-inc.com</email>
</author>
<published>2014-02-12T00:30:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=45a7bd635930baa960b6817674c64bdfb8f39570'/>
<id>45a7bd635930baa960b6817674c64bdfb8f39570</id>
<content type='text'>
The Exar XR17V35x family of UARTs have an additional fractional divisor
register (DLD) which was not being used. Calculate and set this
register for these devices to reduce their baud rate error.

Signed-off-by: Joe Schultz &lt;jschultz@xes-inc.com&gt;
Signed-off-by: Aaron Sierra &lt;asierra@xes-inc.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Exar XR17V35x family of UARTs have an additional fractional divisor
register (DLD) which was not being used. Calculate and set this
register for these devices to reduce their baud rate error.

Signed-off-by: Joe Schultz &lt;jschultz@xes-inc.com&gt;
Signed-off-by: Aaron Sierra &lt;asierra@xes-inc.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>n_tty: Fix stale echo output</title>
<updated>2014-02-13T18:02:19+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2014-02-11T21:34:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e2613be5093d04e6589924d36a1e363eef3c87c7'/>
<id>e2613be5093d04e6589924d36a1e363eef3c87c7</id>
<content type='text'>
When echoes cannot be flushed to output (usually because the tty
has no more write room) and L_ECHO is subsequently turned off, then
when L_ECHO is turned back on, stale echoes are output.

Output completed echoes regardless of the L_ECHO setting:
  1. before normal writes to that tty
  2. if the tty was stopped by soft flow control and is being
     restarted

Reported-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # 3.13.x
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When echoes cannot be flushed to output (usually because the tty
has no more write room) and L_ECHO is subsequently turned off, then
when L_ECHO is turned back on, stale echoes are output.

Output completed echoes regardless of the L_ECHO setting:
  1. before normal writes to that tty
  2. if the tty was stopped by soft flow control and is being
     restarted

Reported-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # 3.13.x
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>serial: sirf: fix kernel panic caused by unpaired spinlock</title>
<updated>2014-02-13T18:02:19+00:00</updated>
<author>
<name>Qipan Li</name>
<email>Qipan.Li@csr.com</email>
</author>
<published>2014-01-27T06:23:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fb78b811422cd2d8c8605949cc4cc13618347ad5'/>
<id>fb78b811422cd2d8c8605949cc4cc13618347ad5</id>
<content type='text'>
commit 8b9ade9f74f8a279 coming from Viresh Kumar "tty: serial: sirfsoc: drop
uart_port-&gt;lock before calling tty_flip_buffer_push()" broke sirfsoc uart
driver by knic:

	[    5.129122] BUG: spinlock already unlocked on CPU#0, ip6tables/1331
	[    5.132554]  lock: sirfsoc_uart_ports+0x4/0x8a0, .magic: dead4ead,
	.owner: &lt;none&gt;/-1, .owner_cpu: -1
	[    5.141651] CPU: 0 PID: 1331 Comm: ip6tables Tainted: G
	W  O 3.10.16 #3
	[    5.148866] [&lt;c0013528&gt;] (unwind_backtrace+0x0/0xe0) from
	[&lt;c0010e70&gt;] (show_stack+0x10/0x14)
	[    5.157362] [&lt;c0010e70&gt;] (show_stack+0x10/0x14) from
	[&lt;c01a5e68&gt;] (do_raw_spin_unlock+0x40/0xc8)
	[    5.166125] [&lt;c01a5e68&gt;] (do_raw_spin_unlock+0x40/0xc8) from
	[&lt;c03ff8b4&gt;] (_raw_spin_unlock+0x8/0x40)
	[    5.175322] [&lt;c03ff8b4&gt;] (_raw_spin_unlock+0x8/0x40) from
	[&lt;c0203fcc&gt;] (sirfsoc_uart_pio_rx_chars+0xa4/0xc0)
	[    5.185120] [&lt;c0203fcc&gt;]
	(sirfsoc_uart_pio_rx_chars+0xa4/0xc0) from [&lt;c0204fb8&gt;]
	(sirfsoc_rx_tmo_process_tl+0xdc/0x1e0)
	[    5.195875] [&lt;c0204fb8&gt;]
	(sirfsoc_rx_tmo_process_tl+0xdc/0x1e0) from [&lt;c0024b50&gt;]
	(tasklet_action+0x8c/0xec)
	[    5.205673] [&lt;c0024b50&gt;] (tasklet_action+0x8c/0xec) from
	[&lt;c00242a8&gt;] (__do_softirq+0xec/0x1d4)
	[    5.214347] [&lt;c00242a8&gt;] (__do_softirq+0xec/0x1d4) from
	[&lt;c0024428&gt;] (do_softirq+0x48/0x54)
	[    5.222674] [&lt;c0024428&gt;] (do_softirq+0x48/0x54) from
	[&lt;c0024690&gt;] (irq_exit+0x74/0xc0)
	[    5.230573] [&lt;c0024690&gt;] (irq_exit+0x74/0xc0) from
	[&lt;c000e1e8&gt;] (handle_IRQ+0x6c/0x90)
	[    5.238465] [&lt;c000e1e8&gt;] (handle_IRQ+0x6c/0x90) from
	[&lt;c000d500&gt;] (__irq_svc+0x40/0x70)
	[    5.246446] [&lt;c000d500&gt;] (__irq_svc+0x40/0x70) from
	[&lt;c0092e7c&gt;] (mark_page_accessed+0xc/0x68)
	[    5.255034] [&lt;c0092e7c&gt;] (mark_page_accessed+0xc/0x68) from
	[&lt;c00a2a4c&gt;] (unmap_single_vma+0x3bc/0x550)
	[    5.264402] [&lt;c00a2a4c&gt;] (unmap_single_vma+0x3bc/0x550) from
	[&lt;c00a3b4c&gt;] (unmap_vmas+0x44/0x54)
	[    5.273164] [&lt;c00a3b4c&gt;] (unmap_vmas+0x44/0x54) from
	[&lt;c00a81a8&gt;] (exit_mmap+0xc4/0x1e0)
	[    5.281233] [&lt;c00a81a8&gt;] (exit_mmap+0xc4/0x1e0) from
	[&lt;c001bb78&gt;] (mmput+0x3c/0xdc)
	[    5.288868] [&lt;c001bb78&gt;] (mmput+0x3c/0xdc) from [&lt;c0021b0c&gt;]
	(do_exit+0x30c/0x828)
	[    5.296413] [&lt;c0021b0c&gt;] (do_exit+0x30c/0x828) from
	[&lt;c0022dac&gt;] (do_group_exit+0x4c/0xb0)
	[    5.304653] [&lt;c0022dac&gt;] (do_group_exit+0x4c/0xb0) from
	[&lt;c0022e20&gt;] (__wake_up_parent+0x0/0x18)

Root cause:
the commit dropped uart_port-&gt;lock before calling tty_flip_buffer_push(), but in sirfsoc-uart,
sirfsoc_uart_pio_rx_chars() can be called by sirfsoc_rx_tmo_process_tl(). here uart_port-&gt;lock
has not been taken yet. so that caused unpaired lock/unlock.

Solution:
This patch is doing a quick fix for that, it adds spin_lock/unlock(&amp;port-&gt;lock) protect to
sirfsoc_uart_pio_rx_chars() in sirfsoc_rx_tmo_process_tl() to keep spin_lock/unlock in pair.

Signed-off-by: Qipan Li &lt;Qipan.Li@csr.com&gt;
Signed-off-by: Barry Song &lt;Baohua.Song@csr.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt; # 3.12
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 8b9ade9f74f8a279 coming from Viresh Kumar "tty: serial: sirfsoc: drop
uart_port-&gt;lock before calling tty_flip_buffer_push()" broke sirfsoc uart
driver by knic:

	[    5.129122] BUG: spinlock already unlocked on CPU#0, ip6tables/1331
	[    5.132554]  lock: sirfsoc_uart_ports+0x4/0x8a0, .magic: dead4ead,
	.owner: &lt;none&gt;/-1, .owner_cpu: -1
	[    5.141651] CPU: 0 PID: 1331 Comm: ip6tables Tainted: G
	W  O 3.10.16 #3
	[    5.148866] [&lt;c0013528&gt;] (unwind_backtrace+0x0/0xe0) from
	[&lt;c0010e70&gt;] (show_stack+0x10/0x14)
	[    5.157362] [&lt;c0010e70&gt;] (show_stack+0x10/0x14) from
	[&lt;c01a5e68&gt;] (do_raw_spin_unlock+0x40/0xc8)
	[    5.166125] [&lt;c01a5e68&gt;] (do_raw_spin_unlock+0x40/0xc8) from
	[&lt;c03ff8b4&gt;] (_raw_spin_unlock+0x8/0x40)
	[    5.175322] [&lt;c03ff8b4&gt;] (_raw_spin_unlock+0x8/0x40) from
	[&lt;c0203fcc&gt;] (sirfsoc_uart_pio_rx_chars+0xa4/0xc0)
	[    5.185120] [&lt;c0203fcc&gt;]
	(sirfsoc_uart_pio_rx_chars+0xa4/0xc0) from [&lt;c0204fb8&gt;]
	(sirfsoc_rx_tmo_process_tl+0xdc/0x1e0)
	[    5.195875] [&lt;c0204fb8&gt;]
	(sirfsoc_rx_tmo_process_tl+0xdc/0x1e0) from [&lt;c0024b50&gt;]
	(tasklet_action+0x8c/0xec)
	[    5.205673] [&lt;c0024b50&gt;] (tasklet_action+0x8c/0xec) from
	[&lt;c00242a8&gt;] (__do_softirq+0xec/0x1d4)
	[    5.214347] [&lt;c00242a8&gt;] (__do_softirq+0xec/0x1d4) from
	[&lt;c0024428&gt;] (do_softirq+0x48/0x54)
	[    5.222674] [&lt;c0024428&gt;] (do_softirq+0x48/0x54) from
	[&lt;c0024690&gt;] (irq_exit+0x74/0xc0)
	[    5.230573] [&lt;c0024690&gt;] (irq_exit+0x74/0xc0) from
	[&lt;c000e1e8&gt;] (handle_IRQ+0x6c/0x90)
	[    5.238465] [&lt;c000e1e8&gt;] (handle_IRQ+0x6c/0x90) from
	[&lt;c000d500&gt;] (__irq_svc+0x40/0x70)
	[    5.246446] [&lt;c000d500&gt;] (__irq_svc+0x40/0x70) from
	[&lt;c0092e7c&gt;] (mark_page_accessed+0xc/0x68)
	[    5.255034] [&lt;c0092e7c&gt;] (mark_page_accessed+0xc/0x68) from
	[&lt;c00a2a4c&gt;] (unmap_single_vma+0x3bc/0x550)
	[    5.264402] [&lt;c00a2a4c&gt;] (unmap_single_vma+0x3bc/0x550) from
	[&lt;c00a3b4c&gt;] (unmap_vmas+0x44/0x54)
	[    5.273164] [&lt;c00a3b4c&gt;] (unmap_vmas+0x44/0x54) from
	[&lt;c00a81a8&gt;] (exit_mmap+0xc4/0x1e0)
	[    5.281233] [&lt;c00a81a8&gt;] (exit_mmap+0xc4/0x1e0) from
	[&lt;c001bb78&gt;] (mmput+0x3c/0xdc)
	[    5.288868] [&lt;c001bb78&gt;] (mmput+0x3c/0xdc) from [&lt;c0021b0c&gt;]
	(do_exit+0x30c/0x828)
	[    5.296413] [&lt;c0021b0c&gt;] (do_exit+0x30c/0x828) from
	[&lt;c0022dac&gt;] (do_group_exit+0x4c/0xb0)
	[    5.304653] [&lt;c0022dac&gt;] (do_group_exit+0x4c/0xb0) from
	[&lt;c0022e20&gt;] (__wake_up_parent+0x0/0x18)

Root cause:
the commit dropped uart_port-&gt;lock before calling tty_flip_buffer_push(), but in sirfsoc-uart,
sirfsoc_uart_pio_rx_chars() can be called by sirfsoc_rx_tmo_process_tl(). here uart_port-&gt;lock
has not been taken yet. so that caused unpaired lock/unlock.

Solution:
This patch is doing a quick fix for that, it adds spin_lock/unlock(&amp;port-&gt;lock) protect to
sirfsoc_uart_pio_rx_chars() in sirfsoc_rx_tmo_process_tl() to keep spin_lock/unlock in pair.

Signed-off-by: Qipan Li &lt;Qipan.Li@csr.com&gt;
Signed-off-by: Barry Song &lt;Baohua.Song@csr.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt; # 3.12
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>serial: 8250_pci: unbreak last serial ports on NetMos 9865 cards</title>
<updated>2014-02-13T17:57:33+00:00</updated>
<author>
<name>Dmitry Eremin-Solenikov</name>
<email>dbaryshkov@gmail.com</email>
</author>
<published>2014-02-11T10:18:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=333c085e4b0cd9df04b087d29f87969a4e26dfa9'/>
<id>333c085e4b0cd9df04b087d29f87969a4e26dfa9</id>
<content type='text'>
Aparently 9865 uses standard BAR encoding scheme (unlike 99xx cards).
Current pci_netmos_9900_setup() uses wrong BAR indices for the 9865 PCI
device, function 2. Using standard BAR indices makes all 6 ports work
for me. Thus disable the NetMos 9900 quirk for NetMos 9865 pci device.

For the reference, here is the relevant part of lspci for my device:

02:07.0 Serial controller: MosChip Semiconductor Technology Ltd. PCI
9865 Multi-I/O Controller (prog-if 02 [16550])
	Subsystem: Device a000:1000
	Flags: bus master, medium devsel, latency 32, IRQ 17
	I/O ports at ac00 [size=8]
	Memory at fcfff000 (32-bit, non-prefetchable) [size=4K]
	Memory at fcffe000 (32-bit, non-prefetchable) [size=4K]
	Capabilities: [48] Power Management version 2
	Kernel driver in use: serial

02:07.1 Serial controller: MosChip Semiconductor Technology Ltd. PCI
9865 Multi-I/O Controller (prog-if 02 [16550])
	Subsystem: Device a000:1000
	Flags: bus master, medium devsel, latency 32, IRQ 18
	I/O ports at a800 [size=8]
	Memory at fcffd000 (32-bit, non-prefetchable) [size=4K]
	Memory at fcffc000 (32-bit, non-prefetchable) [size=4K]
	Capabilities: [48] Power Management version 2
	Kernel driver in use: serial

02:07.2 Communication controller: MosChip Semiconductor Technology Ltd.
PCI 9865 Multi-I/O Controller
	Subsystem: Device a000:3004
	Flags: bus master, medium devsel, latency 32, IRQ 19
	I/O ports at a400 [size=8]
	I/O ports at a000 [size=8]
	I/O ports at 9c00 [size=8]
	I/O ports at 9800 [size=8]
	Memory at fcffb000 (32-bit, non-prefetchable) [size=4K]
	Capabilities: [48] Power Management version 2
	Kernel driver in use: serial

Signed-off-by: Dmitry Eremin-Solenikov &lt;dbaryshkov@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Aparently 9865 uses standard BAR encoding scheme (unlike 99xx cards).
Current pci_netmos_9900_setup() uses wrong BAR indices for the 9865 PCI
device, function 2. Using standard BAR indices makes all 6 ports work
for me. Thus disable the NetMos 9900 quirk for NetMos 9865 pci device.

For the reference, here is the relevant part of lspci for my device:

02:07.0 Serial controller: MosChip Semiconductor Technology Ltd. PCI
9865 Multi-I/O Controller (prog-if 02 [16550])
	Subsystem: Device a000:1000
	Flags: bus master, medium devsel, latency 32, IRQ 17
	I/O ports at ac00 [size=8]
	Memory at fcfff000 (32-bit, non-prefetchable) [size=4K]
	Memory at fcffe000 (32-bit, non-prefetchable) [size=4K]
	Capabilities: [48] Power Management version 2
	Kernel driver in use: serial

02:07.1 Serial controller: MosChip Semiconductor Technology Ltd. PCI
9865 Multi-I/O Controller (prog-if 02 [16550])
	Subsystem: Device a000:1000
	Flags: bus master, medium devsel, latency 32, IRQ 18
	I/O ports at a800 [size=8]
	Memory at fcffd000 (32-bit, non-prefetchable) [size=4K]
	Memory at fcffc000 (32-bit, non-prefetchable) [size=4K]
	Capabilities: [48] Power Management version 2
	Kernel driver in use: serial

02:07.2 Communication controller: MosChip Semiconductor Technology Ltd.
PCI 9865 Multi-I/O Controller
	Subsystem: Device a000:3004
	Flags: bus master, medium devsel, latency 32, IRQ 19
	I/O ports at a400 [size=8]
	I/O ports at a000 [size=8]
	I/O ports at 9c00 [size=8]
	I/O ports at 9800 [size=8]
	Memory at fcffb000 (32-bit, non-prefetchable) [size=4K]
	Capabilities: [48] Power Management version 2
	Kernel driver in use: serial

Signed-off-by: Dmitry Eremin-Solenikov &lt;dbaryshkov@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
