linux-stable-rt/drivers/acpi
Thomas Gleixner 0a7992c908 acpi: fix bogus preemption logic
The ACPI_PREEMPTION_POINT() logic was introduced in commit 8bd108d
(ACPICA: add preemption point after each opcode parse).  The follow up
commits abe1dfab6, 138d15692, c084ca70 tried to fix the preemption logic
back and forth, but nobody noticed that the usage of
in_atomic_preempt_off() in that context is wrong.

The check which guards the call of cond_resched() is:

    if (!in_atomic_preempt_off() && !irqs_disabled())

in_atomic_preempt_off() is not intended for general use as the comment
above the macro definition clearly says:

 * Check whether we were atomic before we did preempt_disable():
 * (used by the scheduler, *after* releasing the kernel lock)

On a CONFIG_PREEMPT=n kernel the usage of in_atomic_preempt_off() works by
accident, but with CONFIG_PREEMPT=y it's just broken.

The whole purpose of the ACPI_PREEMPTION_POINT() is to reduce the latency
on a CONFIG_PREEMPT=n kernel, so make ACPI_PREEMPTION_POINT() depend on
CONFIG_PREEMPT=n and remove the in_atomic_preempt_off() check.

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=16210

[akpm@linux-foundation.org: fix build]
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Len Brown <lenb@kernel.org>
Cc: Francois Valenduc <francois.valenduc@tvcablenet.be>
Cc: Lin Ming <ming.m.lin@intel.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-12 08:43:29 -07:00
..
acpica Merge branch 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2010-08-07 17:08:30 -07:00
apei acpi: fix bogus preemption logic 2010-08-12 08:43:29 -07:00
Kconfig acpi ec_sys: Be more cautious about ec write access 2010-08-03 09:49:13 -04:00
Makefile ACPI: Provide /sys/kernel/debug/ec/... 2010-08-03 09:49:08 -04:00
ac.c
acpi_memhotplug.c
acpi_pad.c time: Kill off CONFIG_GENERIC_TIME 2010-07-27 12:40:54 +02:00
atomicio.c
battery.c
blacklist.c
bus.c
button.c
cm_sbs.c
container.c
debug.c
dock.c
ec.c Merge branch 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2010-08-07 17:08:30 -07:00
ec_sys.c acpi ec_sys: Be more cautious about ec write access 2010-08-03 09:49:13 -04:00
event.c
fan.c
glue.c
hed.c
internal.h ACPI: Provide /sys/kernel/debug/ec/... 2010-08-03 09:49:08 -04:00
numa.c
osl.c Merge branch 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2010-08-07 17:08:30 -07:00
pci_bind.c
pci_irq.c
pci_link.c
pci_root.c ACPI: Disable ASPM if the platform won't provide _OSC control for PCIe 2010-07-30 09:29:17 -07:00
pci_slot.c
power.c
power_meter.c
proc.c
processor_core.c
processor_driver.c
processor_idle.c Merge branch 'timers-timekeeping-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-08-06 13:18:29 -07:00
processor_perflib.c
processor_thermal.c
processor_throttling.c
reboot.c
sbs.c
sbshc.c
sbshc.h
scan.c
sleep.c Merge branch 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2010-08-07 17:08:30 -07:00
sleep.h
system.c
tables.c
thermal.c
utils.c
video.c
video_detect.c
wakeup.c