<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/tty, branch v3.12.29</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>serial: core: Preserve termios c_cflag for console resume</title>
<updated>2014-09-03T19:31:25+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2014-07-09T13:21:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c2a167948273d25a531024d67a86b55c4e38d487'/>
<id>c2a167948273d25a531024d67a86b55c4e38d487</id>
<content type='text'>
commit ae84db9661cafc63d179e1d985a2c5b841ff0ac4 upstream.

When a tty is opened for the serial console, the termios c_cflag
settings are inherited from the console line settings.
However, if the tty is subsequently closed, the termios settings
are lost. This results in a garbled console if the console is later
suspended and resumed.

Preserve the termios c_cflag for the serial console when the tty
is shutdown; this reflects the most recent line settings.

Fixes: Bugzilla #69751, 'serial console does not wake from S3'
Reported-by: Valerio Vanni &lt;valerio.vanni@inwind.it&gt;
Acked-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit ae84db9661cafc63d179e1d985a2c5b841ff0ac4 upstream.

When a tty is opened for the serial console, the termios c_cflag
settings are inherited from the console line settings.
However, if the tty is subsequently closed, the termios settings
are lost. This results in a garbled console if the console is later
suspended and resumed.

Preserve the termios c_cflag for the serial console when the tty
is shutdown; this reflects the most recent line settings.

Fixes: Bugzilla #69751, 'serial console does not wake from S3'
Reported-by: Valerio Vanni &lt;valerio.vanni@inwind.it&gt;
Acked-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sunsab: Fix detection of BREAK on sunsab serial console</title>
<updated>2014-08-26T12:12:00+00:00</updated>
<author>
<name>Christopher Alexander Tobias Schulze</name>
<email>cat.schulze@alice-dsl.net</email>
</author>
<published>2014-08-03T14:01:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5c1c4ea37d89f674b1f9583ac87c2045a4e365ff'/>
<id>5c1c4ea37d89f674b1f9583ac87c2045a4e365ff</id>
<content type='text'>
[ Upstream commit fe418231b195c205701c0cc550a03f6c9758fd9e ]

Fix detection of BREAK on sunsab serial console: BREAK detection was only
performed when there were also serial characters received simultaneously.
To handle all BREAKs correctly, the check for BREAK and the corresponding
call to uart_handle_break() must also be done if count == 0, therefore
duplicate this code fragment and pull it out of the loop over the received
characters.

Patch applies to 3.16-rc6.

Signed-off-by: Christopher Alexander Tobias Schulze &lt;cat.schulze@alice-dsl.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit fe418231b195c205701c0cc550a03f6c9758fd9e ]

Fix detection of BREAK on sunsab serial console: BREAK detection was only
performed when there were also serial characters received simultaneously.
To handle all BREAKs correctly, the check for BREAK and the corresponding
call to uart_handle_break() must also be done if count == 0, therefore
duplicate this code fragment and pull it out of the loop over the received
characters.

Patch applies to 3.16-rc6.

Signed-off-by: Christopher Alexander Tobias Schulze &lt;cat.schulze@alice-dsl.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>serial: sirf: Fix compilation failure</title>
<updated>2014-07-28T07:12:20+00:00</updated>
<author>
<name>Daniel Thompson</name>
<email>daniel.thompson@linaro.org</email>
</author>
<published>2014-05-29T10:13:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a2c27add78eb2823f4fc588cc851327f8b5644e1'/>
<id>a2c27add78eb2823f4fc588cc851327f8b5644e1</id>
<content type='text'>
commit 58eb97c99da6a82c556ddec70683eb3863d4f617 upstream.

After 07d410e0) serial: sirf: fix spinlock deadlock issue it is no longer
possiblet to compile this driver. The rename of one of the spinlocks is
faulty. After looking at the original patch I believe this is the correct
fix.

Compile tested using ARM's multi_v7_defconfig

Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Cc: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Qipan Li &lt;Qipan.Li@csr.com&gt;
Signed-off-by: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Acked-by: Barry Song &lt;baohua@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 58eb97c99da6a82c556ddec70683eb3863d4f617 upstream.

After 07d410e0) serial: sirf: fix spinlock deadlock issue it is no longer
possiblet to compile this driver. The rename of one of the spinlocks is
faulty. After looking at the original patch I believe this is the correct
fix.

Compile tested using ARM's multi_v7_defconfig

Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Cc: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Qipan Li &lt;Qipan.Li@csr.com&gt;
Signed-off-by: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Acked-by: Barry Song &lt;baohua@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>serial: sirf: fix spinlock deadlock issue</title>
<updated>2014-07-28T07:12:15+00:00</updated>
<author>
<name>Qipan Li</name>
<email>Qipan.Li@csr.com</email>
</author>
<published>2014-05-26T11:02:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=67aedbd928624d9e7e44c531ae3e2f18f099eb3f'/>
<id>67aedbd928624d9e7e44c531ae3e2f18f099eb3f</id>
<content type='text'>
commit 07d410e06463f3c1c106e2bb2a7ff23eff1e71c9 upstream.

commit fb78b811422cd2d8c8605949cc4cc13618347ad5 provide a workaround for
kernel panic, but bring potential deadlock risk. that is in
sirfsoc_rx_tmo_process_tl while enter into sirfsoc_uart_pio_rx_chars
cpu hold uart_port-&gt;lock, if uart interrupt comes cpu enter into
sirfsoc_uart_isr and deadlock occurs in getting uart_port-&gt;lock.

the patch replace spin_lock version to spin_lock_irq* version to avoid
spinlock dead lock issue. let function tty_flip_buffer_push in tasklet
outof spin_lock_irq* protect area to avoid add the pair of spin_lock and
spin_unlock for tty_flip_buffer_push.
BTW drop self defined unused spinlock protect of tx_lock/rx_lock.

56274.220464] BUG: spinlock lockup suspected on CPU#0, swapper/0/0
[56274.223648]  lock: 0xc05d9db0, .magic: dead4ead, .owner: swapper/0/0,
	.owner_cpu: 0
	[56274.231278] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G
	O 3.10.35 #1
	[56274.238241] [&lt;c0015530&gt;] (unwind_backtrace+0x0/0xf4) from
	[&lt;c00120d8&gt;] (show_stack+0x10/0x14)
	[56274.246742] [&lt;c00120d8&gt;] (show_stack+0x10/0x14) from
	[&lt;c01b11b0&gt;] (do_raw_spin_lock+0x110/0x184)
	[56274.255501] [&lt;c01b11b0&gt;] (do_raw_spin_lock+0x110/0x184) from
	[&lt;c02124c8&gt;] (sirfsoc_uart_isr+0x20/0x42c)
	[56274.264874] [&lt;c02124c8&gt;] (sirfsoc_uart_isr+0x20/0x42c) from
	[&lt;c0075790&gt;] (handle_irq_event_percpu+0x54/0x17c)
	[56274.274758] [&lt;c0075790&gt;] (handle_irq_event_percpu+0x54/0x17c)
	from [&lt;c00758f4&gt;] (handle_irq_event+0x3c/0x5c)
	[56274.284561] [&lt;c00758f4&gt;] (handle_irq_event+0x3c/0x5c) from
	[&lt;c0077fa0&gt;] (handle_level_irq+0x98/0xfc)
	[56274.293670] [&lt;c0077fa0&gt;] (handle_level_irq+0x98/0xfc) from
	[&lt;c0074f44&gt;] (generic_handle_irq+0x2c/0x3c)
	[56274.302952] [&lt;c0074f44&gt;] (generic_handle_irq+0x2c/0x3c) from
	[&lt;c000ef80&gt;] (handle_IRQ+0x40/0x90)
	[56274.311706] [&lt;c000ef80&gt;] (handle_IRQ+0x40/0x90) from
	[&lt;c000dc80&gt;] (__irq_svc+0x40/0x70)
	[56274.319697] [&lt;c000dc80&gt;] (__irq_svc+0x40/0x70) from
	[&lt;c038113c&gt;] (_raw_spin_unlock_irqrestore+0x10/0x48)
	[56274.329158] [&lt;c038113c&gt;]
	(_raw_spin_unlock_irqrestore+0x10/0x48) from [&lt;c0200034&gt;]
	(tty_port_tty_get+0x58/0x90)
	[56274.339213] [&lt;c0200034&gt;] (tty_port_tty_get+0x58/0x90) from
	[&lt;c0212008&gt;] (sirfsoc_uart_pio_rx_chars+0x1c/0xc8)
	[56274.349097] [&lt;c0212008&gt;]
	(sirfsoc_uart_pio_rx_chars+0x1c/0xc8) from [&lt;c0212ef8&gt;]
	(sirfsoc_rx_tmo_process_tl+0xe4/0x1fc)
	[56274.359853] [&lt;c0212ef8&gt;]
	(sirfsoc_rx_tmo_process_tl+0xe4/0x1fc) from [&lt;c0027c04&gt;]
	(tasklet_action+0x84/0x114)
	[56274.369739] [&lt;c0027c04&gt;] (tasklet_action+0x84/0x114) from
	[&lt;c0027db4&gt;] (__do_softirq+0x120/0x200)
	[56274.378585] [&lt;c0027db4&gt;] (__do_softirq+0x120/0x200) from
	[&lt;c0027f44&gt;] (do_softirq+0x54/0x5c)
	[56274.386998] [&lt;c0027f44&gt;] (do_softirq+0x54/0x5c) from
	[&lt;c00281ec&gt;] (irq_exit+0x9c/0xd0)
	[56274.394899] [&lt;c00281ec&gt;] (irq_exit+0x9c/0xd0) from
	[&lt;c000ef84&gt;] (handle_IRQ+0x44/0x90)
	[56274.402790] [&lt;c000ef84&gt;] (handle_IRQ+0x44/0x90) from
	[&lt;c000dc80&gt;] (__irq_svc+0x40/0x70)
	[56274.410774] [&lt;c000dc80&gt;] (__irq_svc+0x40/0x70) from
	[&lt;c0288af4&gt;] (cpuidle_enter_state+0x50/0xe0)
	[56274.419532] [&lt;c0288af4&gt;] (cpuidle_enter_state+0x50/0xe0) from
	[&lt;c0288c34&gt;] (cpuidle_idle_call+0xb0/0x148)
	[56274.429080] [&lt;c0288c34&gt;] (cpuidle_idle_call+0xb0/0x148) from
	[&lt;c000f3ac&gt;] (arch_cpu_idle+0x8/0x38)
	[56274.438016] [&lt;c000f3ac&gt;] (arch_cpu_idle+0x8/0x38) from
	[&lt;c0059344&gt;] (cpu_startup_entry+0xfc/0x140)
	[56274.446956] [&lt;c0059344&gt;] (cpu_startup_entry+0xfc/0x140) from
	[&lt;c04a3a54&gt;] (start_kernel+0x2d8/0x2e4)

Signed-off-by: Qipan Li &lt;Qipan.Li@csr.com&gt;
Signed-off-by: Barry Song &lt;Baohua.Song@csr.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 07d410e06463f3c1c106e2bb2a7ff23eff1e71c9 upstream.

commit fb78b811422cd2d8c8605949cc4cc13618347ad5 provide a workaround for
kernel panic, but bring potential deadlock risk. that is in
sirfsoc_rx_tmo_process_tl while enter into sirfsoc_uart_pio_rx_chars
cpu hold uart_port-&gt;lock, if uart interrupt comes cpu enter into
sirfsoc_uart_isr and deadlock occurs in getting uart_port-&gt;lock.

the patch replace spin_lock version to spin_lock_irq* version to avoid
spinlock dead lock issue. let function tty_flip_buffer_push in tasklet
outof spin_lock_irq* protect area to avoid add the pair of spin_lock and
spin_unlock for tty_flip_buffer_push.
BTW drop self defined unused spinlock protect of tx_lock/rx_lock.

56274.220464] BUG: spinlock lockup suspected on CPU#0, swapper/0/0
[56274.223648]  lock: 0xc05d9db0, .magic: dead4ead, .owner: swapper/0/0,
	.owner_cpu: 0
	[56274.231278] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G
	O 3.10.35 #1
	[56274.238241] [&lt;c0015530&gt;] (unwind_backtrace+0x0/0xf4) from
	[&lt;c00120d8&gt;] (show_stack+0x10/0x14)
	[56274.246742] [&lt;c00120d8&gt;] (show_stack+0x10/0x14) from
	[&lt;c01b11b0&gt;] (do_raw_spin_lock+0x110/0x184)
	[56274.255501] [&lt;c01b11b0&gt;] (do_raw_spin_lock+0x110/0x184) from
	[&lt;c02124c8&gt;] (sirfsoc_uart_isr+0x20/0x42c)
	[56274.264874] [&lt;c02124c8&gt;] (sirfsoc_uart_isr+0x20/0x42c) from
	[&lt;c0075790&gt;] (handle_irq_event_percpu+0x54/0x17c)
	[56274.274758] [&lt;c0075790&gt;] (handle_irq_event_percpu+0x54/0x17c)
	from [&lt;c00758f4&gt;] (handle_irq_event+0x3c/0x5c)
	[56274.284561] [&lt;c00758f4&gt;] (handle_irq_event+0x3c/0x5c) from
	[&lt;c0077fa0&gt;] (handle_level_irq+0x98/0xfc)
	[56274.293670] [&lt;c0077fa0&gt;] (handle_level_irq+0x98/0xfc) from
	[&lt;c0074f44&gt;] (generic_handle_irq+0x2c/0x3c)
	[56274.302952] [&lt;c0074f44&gt;] (generic_handle_irq+0x2c/0x3c) from
	[&lt;c000ef80&gt;] (handle_IRQ+0x40/0x90)
	[56274.311706] [&lt;c000ef80&gt;] (handle_IRQ+0x40/0x90) from
	[&lt;c000dc80&gt;] (__irq_svc+0x40/0x70)
	[56274.319697] [&lt;c000dc80&gt;] (__irq_svc+0x40/0x70) from
	[&lt;c038113c&gt;] (_raw_spin_unlock_irqrestore+0x10/0x48)
	[56274.329158] [&lt;c038113c&gt;]
	(_raw_spin_unlock_irqrestore+0x10/0x48) from [&lt;c0200034&gt;]
	(tty_port_tty_get+0x58/0x90)
	[56274.339213] [&lt;c0200034&gt;] (tty_port_tty_get+0x58/0x90) from
	[&lt;c0212008&gt;] (sirfsoc_uart_pio_rx_chars+0x1c/0xc8)
	[56274.349097] [&lt;c0212008&gt;]
	(sirfsoc_uart_pio_rx_chars+0x1c/0xc8) from [&lt;c0212ef8&gt;]
	(sirfsoc_rx_tmo_process_tl+0xe4/0x1fc)
	[56274.359853] [&lt;c0212ef8&gt;]
	(sirfsoc_rx_tmo_process_tl+0xe4/0x1fc) from [&lt;c0027c04&gt;]
	(tasklet_action+0x84/0x114)
	[56274.369739] [&lt;c0027c04&gt;] (tasklet_action+0x84/0x114) from
	[&lt;c0027db4&gt;] (__do_softirq+0x120/0x200)
	[56274.378585] [&lt;c0027db4&gt;] (__do_softirq+0x120/0x200) from
	[&lt;c0027f44&gt;] (do_softirq+0x54/0x5c)
	[56274.386998] [&lt;c0027f44&gt;] (do_softirq+0x54/0x5c) from
	[&lt;c00281ec&gt;] (irq_exit+0x9c/0xd0)
	[56274.394899] [&lt;c00281ec&gt;] (irq_exit+0x9c/0xd0) from
	[&lt;c000ef84&gt;] (handle_IRQ+0x44/0x90)
	[56274.402790] [&lt;c000ef84&gt;] (handle_IRQ+0x44/0x90) from
	[&lt;c000dc80&gt;] (__irq_svc+0x40/0x70)
	[56274.410774] [&lt;c000dc80&gt;] (__irq_svc+0x40/0x70) from
	[&lt;c0288af4&gt;] (cpuidle_enter_state+0x50/0xe0)
	[56274.419532] [&lt;c0288af4&gt;] (cpuidle_enter_state+0x50/0xe0) from
	[&lt;c0288c34&gt;] (cpuidle_idle_call+0xb0/0x148)
	[56274.429080] [&lt;c0288c34&gt;] (cpuidle_idle_call+0xb0/0x148) from
	[&lt;c000f3ac&gt;] (arch_cpu_idle+0x8/0x38)
	[56274.438016] [&lt;c000f3ac&gt;] (arch_cpu_idle+0x8/0x38) from
	[&lt;c0059344&gt;] (cpu_startup_entry+0xfc/0x140)
	[56274.446956] [&lt;c0059344&gt;] (cpu_startup_entry+0xfc/0x140) from
	[&lt;c04a3a54&gt;] (start_kernel+0x2d8/0x2e4)

Signed-off-by: Qipan Li &lt;Qipan.Li@csr.com&gt;
Signed-off-by: Barry Song &lt;Baohua.Song@csr.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tty: Correct INPCK handling</title>
<updated>2014-07-18T13:51:10+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2014-06-16T12:10:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ad4a4e1ff95b3c7e02a7ce993d7e7c6e07f5f6d0'/>
<id>ad4a4e1ff95b3c7e02a7ce993d7e7c6e07f5f6d0</id>
<content type='text'>
commit 66528f90669691c85c73bea4f0c9f4a5857c4cab upstream.

If INPCK is not set, input parity detection should be disabled. This means
parity errors should not be received from the tty driver, and the data
received should be treated normally.

SUS v3, 11.2.2, General Terminal Interface - Input Modes, states:
  "If INPCK is set, input parity checking shall be enabled. If INPCK is
   not set, input parity checking shall be disabled, allowing output parity
   generation without input parity errors. Note that whether input parity
   checking is enabled or disabled is independent of whether parity detection
   is enabled or disabled (see Control Modes). If parity detection is enabled
   but input parity checking is disabled, the hardware to which the terminal
   is connected shall recognize the parity bit, but the terminal special file
   shall not check whether or not this bit is correctly set."

Ignore parity errors reported by the tty driver when INPCK is not set, and
handle the received data normally.

Fixes: Bugzilla #71681, 'Improvement of n_tty_receive_parity_error from n_tty.c'
Reported-by: Ivan &lt;athlon_@mail.ru&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 66528f90669691c85c73bea4f0c9f4a5857c4cab upstream.

If INPCK is not set, input parity detection should be disabled. This means
parity errors should not be received from the tty driver, and the data
received should be treated normally.

SUS v3, 11.2.2, General Terminal Interface - Input Modes, states:
  "If INPCK is set, input parity checking shall be enabled. If INPCK is
   not set, input parity checking shall be disabled, allowing output parity
   generation without input parity errors. Note that whether input parity
   checking is enabled or disabled is independent of whether parity detection
   is enabled or disabled (see Control Modes). If parity detection is enabled
   but input parity checking is disabled, the hardware to which the terminal
   is connected shall recognize the parity bit, but the terminal special file
   shall not check whether or not this bit is correctly set."

Ignore parity errors reported by the tty driver when INPCK is not set, and
handle the received data normally.

Fixes: Bugzilla #71681, 'Improvement of n_tty_receive_parity_error from n_tty.c'
Reported-by: Ivan &lt;athlon_@mail.ru&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>serial: Fix IGNBRK handling</title>
<updated>2014-07-18T13:51:09+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2014-06-16T12:10:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7d6467cfe6aa0c56d0b4a94d4deb00a718ac4efa'/>
<id>7d6467cfe6aa0c56d0b4a94d4deb00a718ac4efa</id>
<content type='text'>
commit ef8b9ddcb45fa3b1e11acd72be2398001e807d14 upstream.

If IGNBRK is set without either BRKINT or PARMRK set, some uart
drivers send a 0x00 byte for BREAK without the TTYBREAK flag to the
line discipline, when it should send either nothing or the TTYBREAK flag
set. This happens because the read_status_mask masks out the BI
condition, which uart_insert_char() then interprets as a normal 0x00 byte.

SUS v3 is clear regarding the meaning of IGNBRK; Section 11.2.2, General
Terminal Interface - Input Modes, states:
  "If IGNBRK is set, a break condition detected on input shall be ignored;
   that is, not put on the input queue and therefore not read by any
   process."

Fix read_status_mask to include the BI bit if IGNBRK is set; the
lsr status retains the BI bit if a BREAK is recv'd, which is
subsequently ignored in uart_insert_char() when masked with the
ignore_status_mask.

Affected drivers:
8250 - all
serial_txx9
mfd
amba-pl010
amba-pl011
atmel_serial
bfin_uart
dz
ip22zilog
max310x
mxs-auart
netx-serial
pnx8xxx_uart
pxa
sb1250-duart
sccnxp
serial_ks8695
sirfsoc_uart
st-asc
vr41xx_siu
zs
sunzilog
fsl_lpuart
sunsab
ucc_uart
bcm63xx_uart
sunsu
efm32-uart
pmac_zilog
mpsc
msm_serial
m32r_sio

Unaffected drivers:
omap-serial
rp2
sa1100
imx
icom

Annotated for fixes:
altera_uart
mcf

Drivers without break detection:
21285
xilinx-uartps
altera_jtaguart
apbuart
arc-uart
clps711x
max3100
uartlite
msm_serial_hs
nwpserial
lantiq
vt8500_serial

Unknown:
samsung
mpc52xx_uart
bfin_sport_uart
cpm_uart/core

Fixes: Bugzilla #71651, '8250_core.c incorrectly handles IGNBRK flag'
Reported-by: Ivan &lt;athlon_@mail.ru&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit ef8b9ddcb45fa3b1e11acd72be2398001e807d14 upstream.

If IGNBRK is set without either BRKINT or PARMRK set, some uart
drivers send a 0x00 byte for BREAK without the TTYBREAK flag to the
line discipline, when it should send either nothing or the TTYBREAK flag
set. This happens because the read_status_mask masks out the BI
condition, which uart_insert_char() then interprets as a normal 0x00 byte.

SUS v3 is clear regarding the meaning of IGNBRK; Section 11.2.2, General
Terminal Interface - Input Modes, states:
  "If IGNBRK is set, a break condition detected on input shall be ignored;
   that is, not put on the input queue and therefore not read by any
   process."

Fix read_status_mask to include the BI bit if IGNBRK is set; the
lsr status retains the BI bit if a BREAK is recv'd, which is
subsequently ignored in uart_insert_char() when masked with the
ignore_status_mask.

Affected drivers:
8250 - all
serial_txx9
mfd
amba-pl010
amba-pl011
atmel_serial
bfin_uart
dz
ip22zilog
max310x
mxs-auart
netx-serial
pnx8xxx_uart
pxa
sb1250-duart
sccnxp
serial_ks8695
sirfsoc_uart
st-asc
vr41xx_siu
zs
sunzilog
fsl_lpuart
sunsab
ucc_uart
bcm63xx_uart
sunsu
efm32-uart
pmac_zilog
mpsc
msm_serial
m32r_sio

Unaffected drivers:
omap-serial
rp2
sa1100
imx
icom

Annotated for fixes:
altera_uart
mcf

Drivers without break detection:
21285
xilinx-uartps
altera_jtaguart
apbuart
arc-uart
clps711x
max3100
uartlite
msm_serial_hs
nwpserial
lantiq
vt8500_serial

Unknown:
samsung
mpc52xx_uart
bfin_sport_uart
cpm_uart/core

Fixes: Bugzilla #71651, '8250_core.c incorrectly handles IGNBRK flag'
Reported-by: Ivan &lt;athlon_@mail.ru&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>serial: 8250_dw: Fix LCR workaround regression</title>
<updated>2014-07-02T10:05:41+00:00</updated>
<author>
<name>James Hogan</name>
<email>james.hogan@imgtec.com</email>
</author>
<published>2013-12-10T22:28:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=be31bc4b3764fb9c9ca99c7cf650d762f3c51a74'/>
<id>be31bc4b3764fb9c9ca99c7cf650d762f3c51a74</id>
<content type='text'>
commit 6979f8d28049879e6147767d93ba6732c8bd94f4 upstream.

Commit c49436b657d0 (serial: 8250_dw: Improve unwritable LCR workaround)
caused a regression. It added a check that the LCR was written properly
to detect and workaround the busy quirk, but the behaviour of bit 5
(UART_LCR_SPAR) differs between IP versions 3.00a and 3.14c per the
docs. On older versions this caused the check to fail and it would
repeatedly force idle and rewrite the LCR register, causing delays and
preventing any input from serial being received.

This is fixed by masking out UART_LCR_SPAR before making the comparison.

Signed-off-by: James Hogan &lt;james.hogan@imgtec.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Tim Kryger &lt;tim.kryger@linaro.org&gt;
Cc: Ezequiel Garcia &lt;ezequiel.garcia@free-electrons.com&gt;
Cc: Matt Porter &lt;matt.porter@linaro.org&gt;
Cc: Markus Mayer &lt;markus.mayer@linaro.org&gt;
Tested-by: Tim Kryger &lt;tim.kryger@linaro.org&gt;
Tested-by: Ezequiel Garcia &lt;ezequiel.garcia@free-electrons.com&gt;
Tested-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 6979f8d28049879e6147767d93ba6732c8bd94f4 upstream.

Commit c49436b657d0 (serial: 8250_dw: Improve unwritable LCR workaround)
caused a regression. It added a check that the LCR was written properly
to detect and workaround the busy quirk, but the behaviour of bit 5
(UART_LCR_SPAR) differs between IP versions 3.00a and 3.14c per the
docs. On older versions this caused the check to fail and it would
repeatedly force idle and rewrite the LCR register, causing delays and
preventing any input from serial being received.

This is fixed by masking out UART_LCR_SPAR before making the comparison.

Signed-off-by: James Hogan &lt;james.hogan@imgtec.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Tim Kryger &lt;tim.kryger@linaro.org&gt;
Cc: Ezequiel Garcia &lt;ezequiel.garcia@free-electrons.com&gt;
Cc: Matt Porter &lt;matt.porter@linaro.org&gt;
Cc: Markus Mayer &lt;markus.mayer@linaro.org&gt;
Tested-by: Tim Kryger &lt;tim.kryger@linaro.org&gt;
Tested-by: Ezequiel Garcia &lt;ezequiel.garcia@free-electrons.com&gt;
Tested-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>serial: 8250_dw: Improve unwritable LCR workaround</title>
<updated>2014-07-02T10:05:41+00:00</updated>
<author>
<name>Tim Kryger</name>
<email>tim.kryger@linaro.org</email>
</author>
<published>2013-10-01T17:18:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2401577586898b3590db80f8b97a26f81f0f6d4e'/>
<id>2401577586898b3590db80f8b97a26f81f0f6d4e</id>
<content type='text'>
commit c49436b657d0a56a6ad90d14a7c3041add7cf64d upstream.

When configured with UART_16550_COMPATIBLE=NO or in versions prior to
the introduction of this option, the Designware UART will ignore writes
to the LCR if the UART is busy.  The current workaround saves a copy of
the last written LCR and re-writes it in the ISR for a special interrupt
that is raised when a write was ignored.

Unfortunately, interrupts are typically disabled prior to performing a
sequence of register writes that include the LCR so the point at which
the retry occurs is too late.  An example is serial8250_do_set_termios()
where an ignored LCR write results in the baud divisor not being set and
instead a garbage character is sent out the transmitter.

Furthermore, since serial_port_out() offers no way to indicate failure,
a serious effort must be made to ensure that the LCR is actually updated
before returning back to the caller.  This is difficult, however, as a
UART that was busy during the first attempt is likely to still be busy
when a subsequent attempt is made unless some extra action is taken.

This updated workaround reads back the LCR after each write to confirm
that the new value was accepted by the hardware.  Should the hardware
ignore a write, the TX/RX FIFOs are cleared and the receive buffer read
before attempting to rewrite the LCR out of the hope that doing so will
force the UART into an idle state.  While this may seem unnecessarily
aggressive, writes to the LCR are used to change the baud rate, parity,
stop bit, or data length so the data that may be lost is likely not
important.  Admittedly, this is far from ideal but it seems to be the
best that can be done given the hardware limitations.

Lastly, the revised workaround doesn't touch the LCR in the ISR, so it
avoids the possibility of a "serial8250: too much work for irq" lock up.
This problem is rare in real situations but can be reproduced easily by
wiring up two UARTs and running the following commands.

  # stty -F /dev/ttyS1 echo
  # stty -F /dev/ttyS2 echo
  # cat /dev/ttyS1 &amp;
  [1] 375
  # echo asdf &gt; /dev/ttyS1
  asdf

  [   27.700000] serial8250: too much work for irq96
  [   27.700000] serial8250: too much work for irq96
  [   27.710000] serial8250: too much work for irq96
  [   27.710000] serial8250: too much work for irq96
  [   27.720000] serial8250: too much work for irq96
  [   27.720000] serial8250: too much work for irq96
  [   27.730000] serial8250: too much work for irq96
  [   27.730000] serial8250: too much work for irq96
  [   27.740000] serial8250: too much work for irq96

Signed-off-by: Tim Kryger &lt;tim.kryger@linaro.org&gt;
Reviewed-by: Matt Porter &lt;matt.porter@linaro.org&gt;
Reviewed-by: Markus Mayer &lt;markus.mayer@linaro.org&gt;
Reviewed-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

Conflicts:
	drivers/tty/serial/8250/8250_dw.c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit c49436b657d0a56a6ad90d14a7c3041add7cf64d upstream.

When configured with UART_16550_COMPATIBLE=NO or in versions prior to
the introduction of this option, the Designware UART will ignore writes
to the LCR if the UART is busy.  The current workaround saves a copy of
the last written LCR and re-writes it in the ISR for a special interrupt
that is raised when a write was ignored.

Unfortunately, interrupts are typically disabled prior to performing a
sequence of register writes that include the LCR so the point at which
the retry occurs is too late.  An example is serial8250_do_set_termios()
where an ignored LCR write results in the baud divisor not being set and
instead a garbage character is sent out the transmitter.

Furthermore, since serial_port_out() offers no way to indicate failure,
a serious effort must be made to ensure that the LCR is actually updated
before returning back to the caller.  This is difficult, however, as a
UART that was busy during the first attempt is likely to still be busy
when a subsequent attempt is made unless some extra action is taken.

This updated workaround reads back the LCR after each write to confirm
that the new value was accepted by the hardware.  Should the hardware
ignore a write, the TX/RX FIFOs are cleared and the receive buffer read
before attempting to rewrite the LCR out of the hope that doing so will
force the UART into an idle state.  While this may seem unnecessarily
aggressive, writes to the LCR are used to change the baud rate, parity,
stop bit, or data length so the data that may be lost is likely not
important.  Admittedly, this is far from ideal but it seems to be the
best that can be done given the hardware limitations.

Lastly, the revised workaround doesn't touch the LCR in the ISR, so it
avoids the possibility of a "serial8250: too much work for irq" lock up.
This problem is rare in real situations but can be reproduced easily by
wiring up two UARTs and running the following commands.

  # stty -F /dev/ttyS1 echo
  # stty -F /dev/ttyS2 echo
  # cat /dev/ttyS1 &amp;
  [1] 375
  # echo asdf &gt; /dev/ttyS1
  asdf

  [   27.700000] serial8250: too much work for irq96
  [   27.700000] serial8250: too much work for irq96
  [   27.710000] serial8250: too much work for irq96
  [   27.710000] serial8250: too much work for irq96
  [   27.720000] serial8250: too much work for irq96
  [   27.720000] serial8250: too much work for irq96
  [   27.730000] serial8250: too much work for irq96
  [   27.730000] serial8250: too much work for irq96
  [   27.740000] serial8250: too much work for irq96

Signed-off-by: Tim Kryger &lt;tim.kryger@linaro.org&gt;
Reviewed-by: Matt Porter &lt;matt.porter@linaro.org&gt;
Reviewed-by: Markus Mayer &lt;markus.mayer@linaro.org&gt;
Reviewed-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

Conflicts:
	drivers/tty/serial/8250/8250_dw.c
</pre>
</div>
</content>
</entry>
<entry>
<title>Staging: speakup: Update __speakup_paste_selection() tty (ab)usage to match vt</title>
<updated>2014-06-20T15:34:05+00:00</updated>
<author>
<name>Ben Hutchings</name>
<email>ben@decadent.org.uk</email>
</author>
<published>2014-05-19T00:03:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d743aefeb796657d61155b0074c43a0eda2e6bdc'/>
<id>d743aefeb796657d61155b0074c43a0eda2e6bdc</id>
<content type='text'>
commit 28a821c306889b9f2c3fff49abedc9b2c743eb73 upstream.

This function is largely a duplicate of paste_selection() in
drivers/tty/vt/selection.c, but with its own selection state.  The
speakup selection mechanism should really be merged with vt.

For now, apply the changes from 'TTY: vt, fix paste_selection ldisc
handling', 'tty: Make ldisc input flow control concurrency-friendly',
and 'tty: Fix unsafe vt paste_selection()'.

References: https://bugs.debian.org/735202
References: https://bugs.debian.org/744015
Reported-by: Paul Gevers &lt;elbrus@debian.org&gt;
Reported-and-tested-by: Jarek Czekalski &lt;jarekczek@poczta.onet.pl&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 28a821c306889b9f2c3fff49abedc9b2c743eb73 upstream.

This function is largely a duplicate of paste_selection() in
drivers/tty/vt/selection.c, but with its own selection state.  The
speakup selection mechanism should really be merged with vt.

For now, apply the changes from 'TTY: vt, fix paste_selection ldisc
handling', 'tty: Make ldisc input flow control concurrency-friendly',
and 'tty: Fix unsafe vt paste_selection()'.

References: https://bugs.debian.org/735202
References: https://bugs.debian.org/744015
Reported-by: Paul Gevers &lt;elbrus@debian.org&gt;
Reported-and-tested-by: Jarek Czekalski &lt;jarekczek@poczta.onet.pl&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>8250_core: Fix unwanted TX chars write</title>
<updated>2014-06-06T09:40:21+00:00</updated>
<author>
<name>Loic Poulain</name>
<email>loic.poulain@intel.com</email>
</author>
<published>2014-04-24T09:38:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9ebff4b62caaf11ad6a701f8c4905411410b7728'/>
<id>9ebff4b62caaf11ad6a701f8c4905411410b7728</id>
<content type='text'>
commit b08c9c317e3f7764a91d522cd031639ba42b98cc upstream.

On transmit-hold-register empty, serial8250_tx_chars
should be called only if we don't use DMA.
DMA has its own tx cycle.

Signed-off-by: Loic Poulain &lt;loic.poulain@intel.com&gt;
Reviewed-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

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

On transmit-hold-register empty, serial8250_tx_chars
should be called only if we don't use DMA.
DMA has its own tx cycle.

Signed-off-by: Loic Poulain &lt;loic.poulain@intel.com&gt;
Reviewed-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</pre>
</div>
</content>
</entry>
</feed>
