<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/tty/serial, branch v3.12.35</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>parport: Add support for the WCH353 1S/1P multi-IO card</title>
<updated>2014-11-19T22:30:56+00:00</updated>
<author>
<name>Ezequiel Garcia</name>
<email>ezequiel.garcia@free-electrons.com</email>
</author>
<published>2014-05-24T18:24:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8d6960fa02a523485d20ae8bd4bf3b6731f00937'/>
<id>8d6960fa02a523485d20ae8bd4bf3b6731f00937</id>
<content type='text'>
commit feb5814254094c306429fe6d7b9c534fa0250f4c upstream.

This Multi-IO card has one serial 16550-like and one parallel port connector.
Here's the lspci output, after this commit is applied:

03:07.0 Serial controller: Device 4348:5053 (rev 10) (prog-if 02 [16550])
	Subsystem: Device 4348:5053
	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 21
	Region 0: I/O ports at cf00 [size=8]
	Region 1: I/O ports at ce00 [size=8]
	Kernel driver in use: parport_serial
	Kernel modules: 8250_pci, parport_serial

This commit adds an entry with the device ID to the blacklist declared in
8250_pci to prevent the driver from taking ownership. Also, and as was done
for the 2S/1P variant, add a quirk to skip autodetection and set the correct
type to 16550A clone.

Proper entries are added to parport_serial, to support the device parallel
and serial ports.

Cc: Gianluca Anzolin &lt;gianluca@sottospazio.it&gt;
Cc: Alan Cox &lt;alan@linux.intel.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Ezequiel Garcia &lt;ezequiel.garcia@free-electrons.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 feb5814254094c306429fe6d7b9c534fa0250f4c upstream.

This Multi-IO card has one serial 16550-like and one parallel port connector.
Here's the lspci output, after this commit is applied:

03:07.0 Serial controller: Device 4348:5053 (rev 10) (prog-if 02 [16550])
	Subsystem: Device 4348:5053
	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 21
	Region 0: I/O ports at cf00 [size=8]
	Region 1: I/O ports at ce00 [size=8]
	Kernel driver in use: parport_serial
	Kernel modules: 8250_pci, parport_serial

This commit adds an entry with the device ID to the blacklist declared in
8250_pci to prevent the driver from taking ownership. Also, and as was done
for the 2S/1P variant, add a quirk to skip autodetection and set the correct
type to 16550A clone.

Proper entries are added to parport_serial, to support the device parallel
and serial ports.

Cc: Gianluca Anzolin &lt;gianluca@sottospazio.it&gt;
Cc: Alan Cox &lt;alan@linux.intel.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Ezequiel Garcia &lt;ezequiel.garcia@free-electrons.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: Fix divide-by-zero fault in uart_get_divisor()</title>
<updated>2014-11-13T18:02:43+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2014-10-16T17:46:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=7261d5fa0fdea0d53ed58c7ce2efad1b2485218e'/>
<id>7261d5fa0fdea0d53ed58c7ce2efad1b2485218e</id>
<content type='text'>
commit 547039ec502076e60034eeb79611df3433a99b7d upstream.

uart_get_baud_rate() will return baud == 0 if the max rate is set
to the "magic" 38400 rate and the SPD_* flags are also specified.
On the first iteration, if the current baud rate is higher than the
max, the baud rate is clamped at the max (which in the degenerate
case is 38400). On the second iteration, the now-"magic" 38400 baud
rate selects the possibly higher alternate baud rate indicated by
the SPD_* flag. Since only two loop iterations are performed, the
loop is exited, a kernel WARNING is generated and a baud rate of
0 is returned.

Reproducible with:
 setserial /dev/ttyS0 spd_hi base_baud 38400

Only perform the "magic" 38400 -&gt; SPD_* baud transform on the first
loop iteration, which prevents the degenerate case from recognizing
the clamped baud rate as the "magic" 38400 value.

Reported-by: Robert Święcki &lt;robert@swiecki.net&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 547039ec502076e60034eeb79611df3433a99b7d upstream.

uart_get_baud_rate() will return baud == 0 if the max rate is set
to the "magic" 38400 rate and the SPD_* flags are also specified.
On the first iteration, if the current baud rate is higher than the
max, the baud rate is clamped at the max (which in the degenerate
case is 38400). On the second iteration, the now-"magic" 38400 baud
rate selects the possibly higher alternate baud rate indicated by
the SPD_* flag. Since only two loop iterations are performed, the
loop is exited, a kernel WARNING is generated and a baud rate of
0 is returned.

Reproducible with:
 setserial /dev/ttyS0 spd_hi base_baud 38400

Only perform the "magic" 38400 -&gt; SPD_* baud transform on the first
loop iteration, which prevents the degenerate case from recognizing
the clamped baud rate as the "magic" 38400 value.

Reported-by: Robert Święcki &lt;robert@swiecki.net&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>tty: omap-serial: fix division by zero</title>
<updated>2014-10-31T14:11:18+00:00</updated>
<author>
<name>Frans Klaver</name>
<email>frans.klaver@xsens.com</email>
</author>
<published>2014-09-25T09:19:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=aa239d85e03075f3b4406d82171d879dae5bf0b2'/>
<id>aa239d85e03075f3b4406d82171d879dae5bf0b2</id>
<content type='text'>
commit dc3187564e61260f49eceb21a4e7eb5e4428e90a upstream.

If the chosen baud rate is large enough (e.g. 3.5 megabaud), the
calculated n values in serial_omap_is_baud_mode16() may become 0. This
causes a division by zero when calculating the difference between
calculated and desired baud rates. To prevent this, cap the n13 and n16
values on 1.

Division by zero in kernel.
[&lt;c00132e0&gt;] (unwind_backtrace) from [&lt;c00112ec&gt;] (show_stack+0x10/0x14)
[&lt;c00112ec&gt;] (show_stack) from [&lt;c01ed7bc&gt;] (Ldiv0+0x8/0x10)
[&lt;c01ed7bc&gt;] (Ldiv0) from [&lt;c023805c&gt;] (serial_omap_baud_is_mode16+0x4c/0x68)
[&lt;c023805c&gt;] (serial_omap_baud_is_mode16) from [&lt;c02396b4&gt;] (serial_omap_set_termios+0x90/0x8d8)
[&lt;c02396b4&gt;] (serial_omap_set_termios) from [&lt;c0230a0c&gt;] (uart_change_speed+0xa4/0xa8)
[&lt;c0230a0c&gt;] (uart_change_speed) from [&lt;c0231798&gt;] (uart_set_termios+0xa0/0x1fc)
[&lt;c0231798&gt;] (uart_set_termios) from [&lt;c022bb44&gt;] (tty_set_termios+0x248/0x2c0)
[&lt;c022bb44&gt;] (tty_set_termios) from [&lt;c022c17c&gt;] (set_termios+0x248/0x29c)
[&lt;c022c17c&gt;] (set_termios) from [&lt;c022c3e4&gt;] (tty_mode_ioctl+0x1c8/0x4e8)
[&lt;c022c3e4&gt;] (tty_mode_ioctl) from [&lt;c0227e70&gt;] (tty_ioctl+0xa94/0xb18)
[&lt;c0227e70&gt;] (tty_ioctl) from [&lt;c00cf45c&gt;] (do_vfs_ioctl+0x4a0/0x560)
[&lt;c00cf45c&gt;] (do_vfs_ioctl) from [&lt;c00cf568&gt;] (SyS_ioctl+0x4c/0x74)
[&lt;c00cf568&gt;] (SyS_ioctl) from [&lt;c000e480&gt;] (ret_fast_syscall+0x0/0x30)

Signed-off-by: Frans Klaver &lt;frans.klaver@xsens.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 dc3187564e61260f49eceb21a4e7eb5e4428e90a upstream.

If the chosen baud rate is large enough (e.g. 3.5 megabaud), the
calculated n values in serial_omap_is_baud_mode16() may become 0. This
causes a division by zero when calculating the difference between
calculated and desired baud rates. To prevent this, cap the n13 and n16
values on 1.

Division by zero in kernel.
[&lt;c00132e0&gt;] (unwind_backtrace) from [&lt;c00112ec&gt;] (show_stack+0x10/0x14)
[&lt;c00112ec&gt;] (show_stack) from [&lt;c01ed7bc&gt;] (Ldiv0+0x8/0x10)
[&lt;c01ed7bc&gt;] (Ldiv0) from [&lt;c023805c&gt;] (serial_omap_baud_is_mode16+0x4c/0x68)
[&lt;c023805c&gt;] (serial_omap_baud_is_mode16) from [&lt;c02396b4&gt;] (serial_omap_set_termios+0x90/0x8d8)
[&lt;c02396b4&gt;] (serial_omap_set_termios) from [&lt;c0230a0c&gt;] (uart_change_speed+0xa4/0xa8)
[&lt;c0230a0c&gt;] (uart_change_speed) from [&lt;c0231798&gt;] (uart_set_termios+0xa0/0x1fc)
[&lt;c0231798&gt;] (uart_set_termios) from [&lt;c022bb44&gt;] (tty_set_termios+0x248/0x2c0)
[&lt;c022bb44&gt;] (tty_set_termios) from [&lt;c022c17c&gt;] (set_termios+0x248/0x29c)
[&lt;c022c17c&gt;] (set_termios) from [&lt;c022c3e4&gt;] (tty_mode_ioctl+0x1c8/0x4e8)
[&lt;c022c3e4&gt;] (tty_mode_ioctl) from [&lt;c0227e70&gt;] (tty_ioctl+0xa94/0xb18)
[&lt;c0227e70&gt;] (tty_ioctl) from [&lt;c00cf45c&gt;] (do_vfs_ioctl+0x4a0/0x560)
[&lt;c00cf45c&gt;] (do_vfs_ioctl) from [&lt;c00cf568&gt;] (SyS_ioctl+0x4c/0x74)
[&lt;c00cf568&gt;] (SyS_ioctl) from [&lt;c000e480&gt;] (ret_fast_syscall+0x0/0x30)

Signed-off-by: Frans Klaver &lt;frans.klaver@xsens.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>serial: 8250: Add Quark X1000 to 8250_pci.c</title>
<updated>2014-10-17T07:43:21+00:00</updated>
<author>
<name>Bryan O'Donoghue</name>
<email>pure.logic@nexus-software.ie</email>
</author>
<published>2014-09-23T00:21:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=bc355676ca09ef8f4a5461b85048c86a65fd5594'/>
<id>bc355676ca09ef8f4a5461b85048c86a65fd5594</id>
<content type='text'>
commit 1ede7dcca3c4fa15a518ab0473126f9c3e621e4c upstream.

Quark X1000 contains two designware derived 8250 serial ports.
Each port has a unique PCI configuration space consisting of
BAR0:UART BAR1:DMA respectively.

Unlike the standard 8250 the register width is 32 bits for RHR,IER etc
The Quark UART has a fundamental clock @ 44.2368 MHz allowing for a
bitrate of up to about 2.76 megabits per second.

This patch enables standard 8250 mode

Signed-off-by: Bryan O'Donoghue &lt;pure.logic@nexus-software.ie&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 1ede7dcca3c4fa15a518ab0473126f9c3e621e4c upstream.

Quark X1000 contains two designware derived 8250 serial ports.
Each port has a unique PCI configuration space consisting of
BAR0:UART BAR1:DMA respectively.

Unlike the standard 8250 the register width is 32 bits for RHR,IER etc
The Quark UART has a fundamental clock @ 44.2368 MHz allowing for a
bitrate of up to about 2.76 megabits per second.

This patch enables standard 8250 mode

Signed-off-by: Bryan O'Donoghue &lt;pure.logic@nexus-software.ie&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>
<entry>
<title>serial: 8250_dma: check the result of TX buffer mapping</title>
<updated>2014-10-13T13:41:39+00:00</updated>
<author>
<name>Heikki Krogerus</name>
<email>heikki.krogerus@linux.intel.com</email>
</author>
<published>2014-04-28T12:59:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=77043778de5e2e9c906d9a4a901feabbeac44265'/>
<id>77043778de5e2e9c906d9a4a901feabbeac44265</id>
<content type='text'>
commit d4089a332883ad969700aac5dd4dd5f1c4fee825 upstream.

Using dma_mapping_error() to make sure the mapping did not
fail.

Signed-off-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Cc: "Petallo, MauriceX R" &lt;mauricex.r.petallo@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 d4089a332883ad969700aac5dd4dd5f1c4fee825 upstream.

Using dma_mapping_error() to make sure the mapping did not
fail.

Signed-off-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Cc: "Petallo, MauriceX R" &lt;mauricex.r.petallo@intel.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<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.tavy.me/linux-stable.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.tavy.me/linux-stable.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.tavy.me/linux-stable.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.tavy.me/linux-stable.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>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.tavy.me/linux-stable.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>
</feed>
