aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi
AgeCommit message (Collapse)Author
2007-12-07ACPI: move timer broadcast before busmaster disableThomas Gleixner
The timer broadcast code might access HPET, which should not be accessed after the busmaster disable. In acpi_idle_enter_simple() this change also prevents, that we modify the busmaster state without going actually idle. This might leave the ACPI bm state in a stale state, when we leave the function early in the need_resched() check. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
2007-12-06ACPI: battery: fix ACPI battery technology reportingAndrey Borzenkov
At least some systems report technology information with trailing spaces: {pts/1}% cat -E /var/tmp/bat/2.6.23 | grep type battery type: Li-ION $ Use strncasecmp to compare model string to skip trailing part Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru> Acked-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-12-02Pull bugzilla-9429 into release branchLen Brown
2007-12-02Pull thermal into release branchLen Brown
2007-12-02ACPICA: fix acpi-cpufreq boot crash due to _PSD return-by-referenceBob Moore
Changed resolution of named references in packages Fixed a problem with the Package operator where all named references were created as object references and left otherwise unresolved. According to the ACPI specification, a Package can only contain Data Objects or references to control methods. The implication is that named references to Data Objects (Integer, Buffer, String, Package, BufferField, Field) should be resolved immediately upon package creation. This is the approach taken with this change. References to all other named objects (Methods, Devices, Scopes, etc.) are all now properly created as reference objects. http://bugzilla.kernel.org/show_bug.cgi?id=5328 http://bugzilla.kernel.org/show_bug.cgi?id=9429 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-12-01ACPI: Delete the IRQ operation in throttling controll via PTCZhao Yakui
The IRQ operation(enable/disable) should be avoided when throttling is controlled via PTC method. It is replaced by the migration of task. This fixes an oops on T61 -- a regression due to f79f06ab9f86 b/c FixedHW support tried to read remote MSR with interrupts disabled. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-29ACPI: avoid references to impossible processors.Christoph Lameter
ACPI uses NR_CPUS in various loops and in some it accesses per cpu data of processors that are not present(!) and that will never be present. The pointers to per cpu data are typically not initialized for processors that are not present. So we seem to be reading something here from offset 0 in memory. Make ACPI use nr_cpu_ids instead. That stops at the end of the possible processors. Convert one loop to NR_CPUS to use the cpu_possible map instead. That way ranges of processor that can never be brought online are skipped during the loop. Signed-off-by: Christoph Lameter <clameter@sgi.com> Cc: Len Brown <lenb@kernel.org> Acked-by: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-26Merge git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86: x86: fix APIC related bootup crash on Athlon XP CPUs time: add ADJ_OFFSET_SS_READ x86: export the symbol empty_zero_page on the 32-bit x86 architecture x86: fix kprobes_64.c inlining borkage pci: use pci=bfsort for HP DL385 G2, DL585 G2 x86: correctly set UTS_MACHINE for "make ARCH=x86" lockdep: annotate do_debug() trap handler x86: turn off iommu merge by default x86: fix ACPI compile for LOCAL_APIC=n x86: printk kernel version in WARN_ON and other dump_stack users ACPI: Set max_cstate to 1 for early Opterons. x86: fix NMI watchdog & 'stopped time' problem
2007-11-26ACPI: Set max_cstate to 1 for early Opterons.Alexey Starikovskiy
AMD Opteron processors before CG revision don't like C-states > 1. This solves the long standing bugzilla #5303 and probably some more on affected machines: http://bugzilla.kernel.org/show_bug.cgi?id=5303 [ tglx@linutronix.de: reworked the patch so it does not wreck ia64 ] Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2007-11-20Pull bugzilla-9327 into release branchLen Brown
Conflicts: drivers/acpi/ec.c Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-20ACPI: EC: Workaround for optimized controllers (version 3)Alexey Starikovskiy
Some controllers fail to send confirmation GPE after address or data write. Detect this and don't expect such confirmation in future. This is a generalization of previous workaround (66c5f4e7367b0085652931b2f3366de29e7ff5ec), which did only read address. Reference: http://bugzilla.kernel.org/show_bug.cgi?id=9327 Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Tested-by: Romano Giannetti <romano.giannetti@gmail.com> Tested-by: Mats Johannesson Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-20ACPI: EC: use printk_ratelimit(), add some DEBUG mode messagesMárton Németh
Sometimes it is usefull to see raw protocol dump. Uncomment '#define DEBUG' at the beginning of file to make EC really verbose. Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-20Revert "ACPI: EC: Workaround for optimized controllers"Len Brown
This reverts commit f2d68935ba08cf80f151bbdb5628381184e4a498.
2007-11-20ACPI: acpiphp: Remove dmesg spam on device removeGary Hade
In cases where acpi_pci_bind() does not attach device data, acpi_pci_unbind() complains via an ACPI exception about the missing data when the device is removed. For example, acpi_pci_bind() does not attach data for non-existent device functions so when the device is removed using the ACPI PCI hotplug driver 'acpiphp' an ACPI exception is logged for every non-existent function. This patch avoids the confusing log messages by removing the unnecessary ACPI exception. Signed-off-by: Gary Hade <garyhade@us.ibm.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-20Pull fluff into release branchLen Brown
Conflicts: drivers/acpi/ec.c Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-20Pull video-2.6.24 into release branchLen Brown
2007-11-20Pull thermal into release branchLen Brown
2007-11-20Pull procfs-default into release branchLen Brown
Conflicts: drivers/acpi/sbs.c Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-20Pull cpuidle into release branchLen Brown
2007-11-20Pull bugzilla-9327 into release branchLen Brown
2007-11-20Pull bugzilla-9262 into release branchLen Brown
2007-11-20Pull battery into release branchLen Brown
2007-11-19ACPI: Add missing spaces to printk formatJoe Perches
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19cpuidle: fix HP nx6125 regressionVenkatesh Pallipadi
Fix for http://bugzilla.kernel.org/show_bug.cgi?id=9355 cpuidle always used to fallback to C2 if there is some bm activity while entering C3. But, presence of C2 is not always guaranteed. Change cpuidle algorithm to detect a safe_state to fallback in case of bm_activity and use that state instead of C2. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19cpuidle: add sched_clock_idle_[sleep|wakeup]_event() hooksVenkatesh Pallipadi
Port 2aa44d0567ed21b47b87d68819415d48194cb923 (sched: sched_clock_idle_[sleep|wakeup]_event()) to cpuidle. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19cpuidle: fix C3 for no bus-master control caseVenkatesh Pallipadi
Port 18eab8550397f1f3d4b8b2c5257c88dae25d58ed (Enable C3 even when PM2_control is zero) to cpuidle. Without this patch, some systems will notice a regression when enabling CPU_IDLE -- C3 would no longer be available. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19ACPI: EC: Don't init EC early if it has no _INIAlexey Starikovskiy
Option to init EC early inserted to handle #8598 ASUS problem, introduced several others. EC driver in this particular case has fake _INI method, not present on other machines, which don't need or break from this workaround, so lets use its presence as a flag for early init. http://bugzilla.kernel.org/show_bug.cgi?id=9262 http://bugzilla.kernel.org/show_bug.cgi?id=8598 https://bugzilla.novell.com/show_bug.cgi?id=334806 Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19Revert "acpi: make ACPI_PROCFS default to y"Len Brown
This reverts commit cbff2fbf55c21f50298b1aef1263b11bf510e35f.
2007-11-19Revert "ACPI: add documentation for deprecated /proc/acpi/battery in ↵Len Brown
ACPI_PROCFS" This reverts commit 6e800af233e0bdf108efb7bd23c11ea6fa34cdeb.
2007-11-19ACPI: Split out control for /proc/acpi entries from battery, ac, and sbs.Alexey Starikovskiy
Introduce new ACPI_PROCFS_POWER (default Yes) config option and move procfs code in battery, ac, and sbs drivers under it. This is done to allow ACPI_PROCFS to be default No. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19ACPI: Video: Increase buffer size for writes to brightness proc file.Danny Baumann
In order to be able to write the value "100" to /proc/acpi/video/.../brightness, we have to allocate 5 bytes: 4 characters will be written (1, 0, 0 plus null byte), and 1 byte should be buffer for a terminating NULL character. http://bugzilla.kernel.org/show_bug.cgi?id=9278 Signed-off-by: Danny Baumann <dannybaumann@web.de> Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19ACPI: EC: Workaround for optimized controllersAlexey Starikovskiy
Some controllers fail to send confirmation GPE after address write. Detect this and don't expect such confirmation in future. This is a generalization of previous workaround (66c5f4e7367b0085652931b2f3366de29e7ff5ec), which did only read address. http://bugzilla.kernel.org/show_bug.cgi?id=9327 Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Tested-by: Romano Giannetti <romano.giannetti@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-18ACPI: SBS: Fix retval warningJeff Garzik
drivers/acpi/sbs.c: In function acpi_battery_add: drivers/acpi/sbs.c:811: warning: ignoring return value of device_create_file, declared with attribute warn_unused_result Additional cleanups: * use struct acpi_battery in acpi_battery_remove() to clean up function calls, just like acpi_battery_add() already does. * put braces around unregister call, as it depends on dev being not NULL. * remove unneeded braces Signed-off-by: Jeff Garzik <jgarzik@redhat.com> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16ACPI: Enable MSR (FixedHW) support for T-StatesZhao Yakui
Add throttling control via MSR when T-states uses the FixHW Control Status registers. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Li Shaohua <shaohua.li@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16ACPI: Get throttling info from BIOS only after evaluating _PDCZhao Yakui
Previously _PDC was evaluated later, and thus we'd not get the chance to tell the BIOS that we can suport FixedHW registers (MSRs) and the BIOS would always ask us to use System I/O access for throttling. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Li Shaohua <shaohua.li@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16ACPI: Use _TSS for throttling control, when present. Add error checks.Zhao Yakui
_TSS was erroneously ignored, in favor of the FADT. When TSS is used, the access width is included in the PTC control/status register. So it is unnecessary that the access bit width is multiplied by 8. At the same time the bit_offset should be considered for system I/O Access. It should be checked the bit_width and bit_offset of PTC regsiter in order to avoid the failure of system I/O access. It means that bit_width plus bit_offset can't be greater than 32. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Li Shaohua <shaohua.li@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16ACPI: throttle: Change internal APIs better handle _PTCZhao Yakui
Change the function interface for throttling control via PTC. The following functions are concerned: acpi_read_throttling_status() acpi_write_throttling_state() acpi_get_throttling_value() acpi_get_throttling_state() Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Li Shaohua <shaohua.li@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16ACPI: If _TSS exists, do not access FADT.duty_widthZhao Yakui
Factor out legacy FADT.duty_width code and run it only in the non _TSS case. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Li Shaohua <shaohua.li@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16ACPI: Handle I/O access width requestst that are not a multiple of 8 bits.Zhao Yakui
We've run into BIOS that hand us 4-bit access width requests for T-state control when the code expected only multipls of 8-bits. Round up. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Li Shaohua <shaohua.li@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16ACPI: Enforce T-state limit changes immediatelyZhao Yakui
When a T-state limit change notification is received, Linux must evaluate _TPC and change its current T-state immediately to comply with the new limit. Previously, Linux would notice the new limit only upon the next throttling change. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Li Shaohua <shaohua.li@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-14ACPI: AC: Update AC state on resumeAlexey Starikovskiy
Check if AC state has changed across resume and notify userspace if so. Fixes "[2.6.24-rc1 regression] AC adapter state does not change after resume" Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Tested-by: Andrey Borzenkov <arvidjaar@mail.ru> Cc: Len Brown <lenb@kernel.org> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14make /proc/acpi/ac_adapter dependent on ACPI_PROCFSAndrey Borzenkov
Do not provide /proc/acpi/ac_adapter if ACPI_PROCFS is not defined. This eliminates duplicated power adapters in HAL and makes it consistent with battery module Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru> Acked-by: Alexey Starikovskiy <astarikovskiy@suse.de> Cc: Len Brown <lenb@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14acpi: make ACPI_PROCFS default to yAndrew Morton
Zillions of people are getting my-battery-monitor-doesnt-work problems (including me). Lessen the damage by making ACPI_PROCFS default to on. Cc: Len Brown <lenb@kernel.org> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14Fix Oops in toshiba_acpi error return pathAndrey Borzenkov
When backlight_device_register() fails, return after undo initialization, do not try to use pointer that just was reset to NULL This fixes this oops: [ 1595.177672] [<c010480a>] show_trace_log_lvl+0x1a/0x30 [ 1595.177706] [<c01052a2>] show_trace+0x12/0x20 [ 1595.177718] [<c0105305>] dump_stack+0x15/0x20 [ 1595.177728] [<c01c9375>] kobject_shadow_add+0x125/0x1c0 [ 1595.177754] [<c01c941a>] kobject_add+0xa/0x10 [ 1595.177764] [<c0239a37>] device_add+0x97/0x5d0 [ 1595.177776] [<c0239f82>] device_register+0x12/0x20 [ 1595.177786] [<dfd912df>] backlight_device_register+0x9f/0x110 [backlight] [ 1595.177814] [<df861117>] toshiba_acpi_init+0x117/0x15e [toshiba_acpi] [ 1595.177834] [<c013e28d>] sys_init_module+0xfd/0x14e0 [ 1595.177871] [<c0104112>] sysenter_past_esp+0x5f/0x99 [ 1595.177883] ======================= [ 1595.177890] Could not register toshiba backlight device [ 1595.177985] BUG: unable to handle kernel NULL pointer dereference at virtual address 00000004 ... [ 1595.394097] EIP: 0060:[<df861143>] Not tainted VLI [ 1595.394101] EFLAGS: 00010282 (2.6.23-rc9-1avb #24) [ 1595.480081] EIP is at toshiba_acpi_init+0x143/0x15e [toshiba_acpi] Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru> Cc: John Belmonte <toshiba_acpi@memebeam.org> Acked-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14ACPI: video - delete stray run-time printkLen Brown
printk("video bus notify\n"); Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-14ACPI: video - convert semaphore to a mutexDmitry Torokhov
Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-14ACPI: video - remove unsafe uses of list_for_each_safe()Dmitry Torokhov
list_for_each_safe() only protects list from list alterations performed by the same thread. One still needs to implement proper locking when list is being accessed from several threads. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-14ACPI: video - add missing input_free_device()Dmitry Torokhov
If input_register_device() fails input_free_device() must be called to release memory allocated for the device. Also consolidate error handling in acpi_bus_video_add() and handle input_allocate_device() failures. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-14ACPI: video - fit input device into sysfs treeDmitry Torokhov
Properly set up parent on input device registered by the video driver. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-13ACPI: Battery: remove cycle from battery removal.Alexey Starikovskiy
get_property() should not call battery_update(), it also should call get_status() only if battery is present to avoid cycle and oops. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Tested-by: Rolf Eike Beer <eike-kernel@sf-tec.de> Acked-by: Johannes Weiner <hannes@saeurebad.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>