linux-stable/drivers
Al Cooper dbb3b1ca56 8250: Fix race condition in serial8250_backup_timeout().
This is to fix an issue where output will suddenly become very slow.
The problem occurs on 8250 UARTS with the hardware bug UART_BUG_THRE.

BACKGROUND
For normal UARTs (without UART_BUG_THRE): When the serial core layer
gets new transmit data and the transmitter is idle, it buffers the
data and calls the 8250s' serial8250_start_tx() routine which will
simply enable the TX interrupt in the IER register and return. This
should immediately fire a THRE interrupt and begin transmitting the
data.
For buggy UARTs (with UART_BUG_THRE): merely enabling the TX interrupt
in IER does not necessarily generate a new THRE interrupt.
Therefore, a background timer periodically checks to see if there is
pending data, and starts transmission if that is the case.

The bug happens on SMP systems when the system has nothing to transmit,
the transmit interrupt is disabled and the following sequence occurs:
- CPU0: The background timer routine serial8250_backup_timeout()
  starts and saves the state of the interrupt enable register (IER)
  and then disables all interrupts in IER. NOTE: The transmit interrupt
  (TI) bit is saved as disabled.
- CPU1: The serial core gets data to transmit, grabs the port lock and
  calls serial8250_start_tx() which enables the TI in IER.
- CPU0: serial8250_backup_timeout() waits for the port lock.
- CPU1: finishes (with TI enabled) and releases the port lock.
- CPU0: serial8250_backup_timeout() calls the interrupt routine which
  will transmit the next fifo's worth of data and then restores the
  IER from the previously saved value (TI disabled).
At this point, as long as the serial core has more transmit data
buffered, it will not call serial8250_start_tx() again and the
background timer routine will slowly transmit the data.

The fix is to have serial8250_start_tx() get the port lock before
it saves the IER state and release it after restoring IER. This will
prevent serial8250_start_tx() from running in parallel.

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 10:10:37 -07:00
..
accessibility
acpi Merge branch 'battery' into release 2011-08-05 22:16:42 -04:00
amba
ata Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2011-08-02 21:17:02 -10:00
atm
auxdisplay
base PM / Runtime: Allow _put_sync() from interrupts-disabled context 2011-08-05 21:45:20 +02:00
bcma
block
bluetooth
cdrom
char net: Compute protocol sequence numbers and fragment IDs using MD5. 2011-08-06 18:33:19 -07:00
clk
clocksource
connector proc_fork_connector: a lockless ->real_parent usage is not safe 2011-07-28 18:26:32 -07:00
cpufreq
cpuidle cpuidle: stop depending on pm_idle 2011-08-03 19:06:37 -04:00
crypto n2_crypto: Attach on Niagara-T3. 2011-07-28 01:30:07 -07:00
dca
dio
dma Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx 2011-08-04 16:43:43 -10:00
edac
eisa eisa/pci_eisa.c: fix BUG introduced by 005bdad7b8 2011-08-04 06:32:51 -10:00
firewire
firmware Merge branch 'pstore-efi' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 2011-08-02 21:18:39 -10:00
gpio Merge branch 'gpio/next' of git://git.secretlab.ca/git/linux-2.6 2011-08-01 06:13:48 -10:00
gpu Revert "drm/i915: Try enabling RC6 by default (again)" 2011-08-05 10:56:29 +01:00
hid
hwmon Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging 2011-07-30 08:57:57 -10:00
hwspinlock
i2c
ide drivers/ide/cy82c693.c: Add missing pci_dev_put 2011-08-04 01:30:34 -07:00
idle
ieee802154
infiniband
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2011-08-03 22:00:09 -10:00
iommu
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2011-07-28 05:58:19 -07:00
leds
lguest
macintosh
mca
md dm table: set flush capability based on underlying devices 2011-08-02 12:32:08 +01:00
media Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 2011-07-30 00:08:53 -07:00
memstick
message Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2011-07-30 08:36:02 -10:00
mfd mfd: Fix mismatch in twl4030 mutex lock-unlock 2011-07-31 23:28:27 +02:00
misc
mmc
mtd
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2011-08-05 06:42:01 -10:00
nfc
nubus
of Revert "dt: add of_alias_scan and of_alias_get_id" 2011-08-04 11:26:24 +01:00
oprofile
parisc
parport
pci Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2011-08-02 21:17:02 -10:00
pcmcia Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2011-07-31 06:23:08 -10:00
platform acer-wmi: support Lenovo ideapad S205 wifi switch 2011-08-05 15:21:52 -04:00
pnp
power Merge git://git.infradead.org/battery-2.6 2011-07-31 06:24:50 -10:00
pps
ps3
ptp
rapidio
regulator Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6 2011-08-01 14:05:46 -10:00
rtc rtc-omap: fix initialization of control register 2011-08-03 14:25:20 -10:00
s390 [S390] qdio: Use kstrtoul_from_user 2011-08-03 16:44:21 +02:00
sbus
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2011-07-30 08:36:02 -10:00
sfi
sh Merge branch 'sh-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x 2011-08-01 06:10:16 -10:00
sn
spi spi/pl022: remove function cannot exit 2011-08-02 14:54:11 +01:00
ssb
staging Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 2011-07-30 00:08:53 -07:00
target Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2011-08-03 15:12:09 -10:00
tc
telephony
thermal thermal: make THERMAL_HWMON implementation fully internal 2011-08-02 14:51:57 -04:00
tty 8250: Fix race condition in serial8250_backup_timeout(). 2011-08-23 10:10:37 -07:00
uio
usb Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 2011-07-30 00:08:53 -07:00
uwb
vhost
video savagedb: Fix typo causing regression in savage4 series video chip detection 2011-08-06 12:02:40 -07:00
virt
virtio
vlynq
w1
watchdog watchdog: Cleanup WATCHDOG_CORE help text 2011-08-02 08:23:07 +00:00
xen xen/self-balloon: Add dependency on tmem. 2011-08-03 14:34:57 -04:00
zorro
Kconfig
Makefile