aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi
AgeCommit message (Collapse)Author
2007-01-26[PATCH] ACPI: fix cpufreq regressionIngo Molnar
Recently cpufreq support on my laptop (Lenovo T60) broke completely: when it's plugged into AC it would never go higher than 1 GHz - neither 1.3 GHz nor 1.83 GHz is possible - no matter which governor (userspace, speed or ondemand) is used. After some cpufreq debugging i tracked the regression back to the following (totally correct) bug-fix commit: commit 0916bd3ebb7cefdd0f432e8491abe24f4b5a101e Author: Dave Jones <davej@redhat.com> Date: Wed Nov 22 20:42:01 2006 -0500 [PATCH] Correct bound checking from the value returned from _PPC method. This bugfix, which makes other laptops work, made a previously hidden (BIOS) bug visible on my laptop. The bug is the following: if the _PPC (Performance Present Capabilities) optional ACPI object is queried /after/ bootup then the BIOS reports an incorrect value of '2'. My laptop (Lenovo T60) has the following performance states supported: 0: 1833000 1: 1333000 2: 1000000 Per ACPI specification, a _PPC value of '0' means that all 3 performance states are usable. A _PPC value of '1' means states 1 .. 2 are usable, a value of '2' means only state '2' (slowest) is usable. now, the _PPC object is optional, and it also comes with notification. Furthermore, when a CPU object is initialized, the _PPC object is initialized as well. So the following evaluation of the _PPC object is superfluous: [<c028ba5f>] acpi_processor_get_platform_limit+0xa1/0xaf [<c028c040>] acpi_processor_register_performance+0x3b9/0x3ef [<c0111a85>] acpi_cpufreq_cpu_init+0xb7/0x596 [<c03dab74>] cpufreq_add_dev+0x160/0x4a8 [<c02bed90>] sysdev_driver_register+0x5a/0xa0 [<c03d9c4c>] cpufreq_register_driver+0xb4/0x176 [<c068ac08>] acpi_cpufreq_init+0xe5/0xeb [<c010056e>] init+0x14f/0x3dd And this is the point where my laptop's BIOS returns the incorrect value of '2'. Note that it has not sent any notification event, so the value is probably not really intentional (possibly spurious), and Windows likely doesnt query it after bootup either. Maybe the value is kept at '2' normally, and is only set to the real value when a true asynchronous event (such as AC plug event, battery switch, etc.) occurs. So i /think/ this is a grey area of the ACPI spec: per the letter of the spec the _PPC value only changes when notified, so there's no reason to query it after the system has booted up. So in my opinion the best (and most compatible) strategy would be to do the change below, and to not evaluate the _PPC object in the acpi_processor_get_performance_info() call, but only evaluate it if _PPC is present during CPU object init, or if it's notified during an asynchronous event. This change is more permissive than the previous logic, so it definitely shouldnt break any existing system. This also happens to fix my laptop, which is merrily chugging along at 1.83 GHz now. Yay! Signed-off-by: Ingo Molnar <mingo@elte.hu> Cc: Dave Jones <davej@redhat.com> Acked-by: Len Brown <lenb@kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-01-23[PATCH] acpi: remove "video device notify" messageJeff Chua
Seems to be some left-over debug code. Cc: Len Brown <lenb@kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-01-11Revert "ACPI: ibm-acpi: make non-generic bay support optional"Henrique de Moraes Holschuh
This reverts commit 2df910b4c3edcce9a0c12394db6f5f4a6e69c712. ACPI_BAY has not been merged into mainline yet, so the changes to ibm-acpi related Kconfig entries that depend on ACPI_BAY were permanently disabling ibm-acpi bay support. This is a serious regression for ThinkPad users. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
2007-01-11Pull sgi into release branchLen Brown
2007-01-11Pull trivial into release branchLen Brown
2007-01-10ACPI: delete two spurious ACPI messagesVenkatesh Pallipadi
ACPI: Getting cpuindex for acpiid 0x4 acpi_processor-0742 [00] processor_preregister_: Error while parsing _PSD domain information. Assuming no coordination http://bugzilla.kernel.org/show_bug.cgi?id=7286 Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-01-05[PATCH] fix the toshiba_acpi write_lcd return valueMatthijs van Otterdijk
write_lcd() in toshiba_acpi returns 0 on success since the big ACPI patch merged in 2.6.20-rc2. It should return count. Signed-off-by: Matthijs van Otterdijk <thotter@gmail.com> Cc: Len Brown <lenb@kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2007-01-06ACPI: ec: enable printk on cmdline useLen Brown
if somebody uses "ec_intr=", lets be sure to capture that in the dmesg even in the non-debug case. Signed-off-by: Len Brown <len.brown@intel.com>
2007-01-04ACPI: Altix: ACPI _PRT supportJohn Keller
Provide ACPI _PRT support for SN Altix systems. The SN Altix platform does not conform to the IOSAPIC IRQ routing model, so a new acpi_irq_model (ACPI_IRQ_MODEL_PLATFORM) has been defined. The SN platform specific code sets acpi_irq_model to this new value, and keys off of it in acpi_register_gsi() to avoid the iosapic code path. Signed-off-by: John Keller <jpk@sgi.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-01-02ACPI: EC: move verbose printk to debug build onlyGuillaume Chazarain
The recent EC cleanup left a printk enabled on handler evaluation resulting in a bunch of messages on normal operation, like so: ACPI: EC: evaluating _Q60 Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-22Merge branch 'release' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (68 commits) ACPI: replace kmalloc+memset with kzalloc ACPI: Add support for acpi_load_table/acpi_unload_table_id fbdev: update after backlight argument change ACPI: video: Add dev argument for backlight_device_register ACPI: Implement acpi_video_get_next_level() ACPI: Kconfig - depend on PM rather than selecting it ACPI: fix NULL check in drivers/acpi/osl.c ACPI: make drivers/acpi/ec.c:ec_ecdt static ACPI: prevent processor module from loading on failures ACPI: fix single linked list manipulation ACPI: ibm_acpi: allow clean removal ACPI: fix git automerge failure ACPI: ibm_acpi: respond to workqueue update ACPI: dock: add uevent to indicate change in device status ACPI: ec: Lindent once again ACPI: ec: Change #define to enums there possible. ACPI: ec: Style changes. ACPI: ec: Acquire Global Lock under EC mutex. ACPI: ec: Drop udelay() from poll mode. Loop by reading status field instead. ACPI: ec: Rename gpe_bit to gpe ...
2006-12-22[PATCH] sched: fix bad missed wakeups in the i386, x86_64, ia64, ACPI and ↵Ingo Molnar
APM idle code Fernando Lopez-Lezcano reported frequent scheduling latencies and audio xruns starting at the 2.6.18-rt kernel, and those problems persisted all until current -rt kernels. The latencies were serious and unjustified by system load, often in the milliseconds range. After a patient and heroic multi-month effort of Fernando, where he tested dozens of kernels, tried various configs, boot options, test-patches of mine and provided latency traces of those incidents, the following 'smoking gun' trace was captured by him: _------=> CPU# / _-----=> irqs-off | / _----=> need-resched || / _---=> hardirq/softirq ||| / _--=> preempt-depth |||| / ||||| delay cmd pid ||||| time | caller \ / ||||| \ | / IRQ_19-1479 1D..1 0us : __trace_start_sched_wakeup (try_to_wake_up) IRQ_19-1479 1D..1 0us : __trace_start_sched_wakeup <<...>-5856> (37 0) IRQ_19-1479 1D..1 0us : __trace_start_sched_wakeup (c01262ba 0 0) IRQ_19-1479 1D..1 0us : resched_task (try_to_wake_up) IRQ_19-1479 1D..1 0us : __spin_unlock_irqrestore (try_to_wake_up) ... <idle>-0 1...1 11us!: default_idle (cpu_idle) ... <idle>-0 0Dn.1 602us : smp_apic_timer_interrupt (c0103baf 1 0) ... <...>-5856 0D..2 618us : __switch_to (__schedule) <...>-5856 0D..2 618us : __schedule <<idle>-0> (20 162) <...>-5856 0D..2 619us : __spin_unlock_irq (__schedule) <...>-5856 0...1 619us : trace_stop_sched_switched (__schedule) <...>-5856 0D..1 619us : trace_stop_sched_switched <<...>-5856> (37 0) what is visible in this trace is that CPU#1 ran try_to_wake_up() for PID:5856, it placed PID:5856 on CPU#0's runqueue and ran resched_task() for CPU#0. But it decided to not send an IPI that no CPU - due to TS_POLLING. But CPU#0 never woke up after its NEED_RESCHED bit was set, and only rescheduled to PID:5856 upon the next lapic timer IRQ. The result was a 600+ usecs latency and a missed wakeup! the bug turned out to be an idle-wakeup bug introduced into the mainline kernel this summer via an optimization in the x86_64 tree: commit 495ab9c045e1b0e5c82951b762257fe1c9d81564 Author: Andi Kleen <ak@suse.de> Date: Mon Jun 26 13:59:11 2006 +0200 [PATCH] i386/x86-64/ia64: Move polling flag into thread_info_status During some profiling I noticed that default_idle causes a lot of memory traffic. I think that is caused by the atomic operations to clear/set the polling flag in thread_info. There is actually no reason to make this atomic - only the idle thread does it to itself, other CPUs only read it. So I moved it into ti->status. the problem is this type of change: if (!hlt_counter && boot_cpu_data.hlt_works_ok) { - clear_thread_flag(TIF_POLLING_NRFLAG); + current_thread_info()->status &= ~TS_POLLING; smp_mb__after_clear_bit(); while (!need_resched()) { local_irq_disable(); this changes clear_thread_flag() to an explicit clearing of TS_POLLING. clear_thread_flag() is defined as: clear_bit(flag, &ti->flags); and clear_bit() is a LOCK-ed atomic instruction on all x86 platforms: static inline void clear_bit(int nr, volatile unsigned long * addr) { __asm__ __volatile__( LOCK_PREFIX "btrl %1,%0" hence smp_mb__after_clear_bit() is defined as a simple compile barrier: #define smp_mb__after_clear_bit() barrier() but the explicit TS_POLLING clearing introduced by the patch: + current_thread_info()->status &= ~TS_POLLING; is not an atomic op! So the clearing of the TS_POLLING bit is freely reorderable with the reading of the NEED_RESCHED bit - and both now reside in different memory addresses. CPU idle wakeup very much depends on ordered memory ops, the clearing of the TS_POLLING flag must always be done before we test need_resched() and hit the idle instruction(s). [Symmetrically, the wakeup code needs to set NEED_RESCHED before it tests the TS_POLLING flag, so memory ordering is paramount.] Fernando's dual-core Athlon64 system has a sufficiently advanced memory ordering model so that it triggered this scenario very often. ( And it also turned out that the reason why these latencies never triggered on my testsystems is that i routinely use idle=poll, which was the only idle variant not affected by this bug. ) The fix is to change the smp_mb__after_clear_bit() to an smp_mb(), to act as an absolute barrier between the TS_POLLING write and the NEED_RESCHED read. This affects almost all idling methods (default, ACPI, APM), on all 3 x86 architectures: i386, x86_64, ia64. Signed-off-by: Ingo Molnar <mingo@elte.hu> Tested-by: Fernando Lopez-Lezcano <nando@ccrma.Stanford.EDU> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-20ACPI: replace kmalloc+memset with kzallocBurman Yan
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20Driver core: proper prototype for drivers/base/init.c:driver_init()Adrian Bunk
Add a prototype for driver_init() in include/linux/device.h. Also remove a static function of the same name in drivers/acpi/ibm_acpi.c to ibm_acpi_driver_init() to fix the namespace collision. Signed-off-by: Adrian Bunk <bunk@stusta.de> Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-20Pull sgi into test branchLen Brown
2006-12-20Pull bugfix into test branchLen Brown
2006-12-20Pull ec into test branchLen Brown
2006-12-20Pull platform-drivers into test branchLen Brown
2006-12-20ACPI: Add support for acpi_load_table/acpi_unload_table_idJohn Keller
Make acpi_load_table() available for use by removing it from the #ifdef ACPI_FUTURE_USAGE. Also add a new routine used to unload an ACPI table of a given type and "id" - acpi_unload_table_id(). The implementation of this new routine was almost a direct copy of existing routine acpi_unload_table() - only difference being that it only removes a specific table id instead of ALL tables of a given type. The SN hotplug driver (sgi_hotplug.c) now uses both of these interfaces to dynamically load and unload SSDT ACPI tables. Also, a few other ACPI routines now used by the SN hotplug driver are exported (since the driver can be a loadable module): acpi_ns_map_handle_to_node acpi_ns_convert_entry_to_handle acpi_ns_get_next_node Signed-off-by: Aaron Young <ayoung@sgi.com> Cc: Greg KH <greg@kroah.com> Cc: "Luck, Tony" <tony.luck@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20ACPI: video: Add dev argument for backlight_device_registerYu Luming
This patch set adds generic abstract layer support for acpi video driver to have generic user interface to control backlight and output switch control by leveraging the existing backlight sysfs class driver, and by adding a new video output sysfs class driver. This patch: Add dev argument for backlight_device_register to link the class device to real device object. The platform specific driver should find a way to get the real device object for their video device. [akpm@osdl.org: build fix] [akpm@osdl.org: fix msi-laptop.c] Signed-off-by: Luming Yu <Luming.yu@intel.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20ACPI: Implement acpi_video_get_next_level()Thomas Tuttle
acpi_video_get_next_level was supposed to implement an algorithm to select a new brightness level based on the old brightness level of an ACPI video device, but it simply says "/* Fix me */" and returns the current brightness. This patch implements acpi_video_get_next_level properly. It had to change a few constants at the top of the file because they were (apparently) wrong, but it appears to work on my Dell Inspiron e1405 (with BIOS A05 only--BIOS A04 doesn't seem to send ACPI video hotkey events). [akpm@osdl.org: cleanups] Signed-off-by: Thomas Tuttle <linux-kernel@ttuttle.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20ACPI: Kconfig - depend on PM rather than selecting itAndrew Morton
Make ACPI depend on PM rather than selecting it. Otherwise it's a nightmare working out why CONFIG_PM keeps getting set. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20ACPI: fix NULL check in drivers/acpi/osl.cAdrian Bunk
Spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20ACPI: make drivers/acpi/ec.c:ec_ecdt staticAdrian Bunk
Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20ACPI: prevent processor module from loading on failuresAkinobu Mita
Make loading processor.ko fail when an error happens. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20ACPI: fix single linked list manipulationAkinobu Mita
Fix single linked list manipulation for sub_driver. If the remving entry is not on the head of the sub_driver list, it goes into infinate loop. Though that infinite loop doesn't happen. Because the only user of acpi_pci_register_dirver() is acpiphp. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-19ACPI: ibm_acpi: allow clean removalAlexey Starikovskiy
Allow clean removal by setting notify_installed in the right place. Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-16Pull style into test branchLen Brown
Conflicts: drivers/acpi/button.c drivers/acpi/ec.c drivers/acpi/osl.c drivers/acpi/sbs.c
2006-12-16Pull bugfix into test branchLen Brown
Conflicts: kernel/power/disk.c
2006-12-16Pull trivial into test branchLen Brown
Conflicts: drivers/acpi/ec.c
2006-12-16ACPI: ibm_acpi: respond to workqueue updateLen Brown
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-16Pull platform-drivers into test branchLen Brown
2006-12-16Pull button into test branchLen Brown
2006-12-16Pull dock into test branchLen Brown
2006-12-14ACPI: dock: add uevent to indicate change in device statusKristen Carlson Accardi
Send a uevent to indicate a device change whenever we dock or undock, so that userspace may now check the dock status via sysfs. Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Holger Macht <hmacht@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08ACPI: ec: Lindent once againAlexey Starikovskiy
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08ACPI: ec: Change #define to enums there possible.Alexey Starikovskiy
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08ACPI: ec: Style changes.Alexey Starikovskiy
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08ACPI: ec: Acquire Global Lock under EC mutex.Alexey Starikovskiy
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08ACPI: ec: Drop udelay() from poll mode. Loop by reading status field instead.Alexey Starikovskiy
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08ACPI: ec: Rename gpe_bit to gpeAlexey Starikovskiy
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08ACPI: ec: Change semaphore to mutex.Alexey Starikovskiy
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08ACPI: ec: Query only single query at a time.Alexey Starikovskiy
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08ACPI: ec: Remove calls to clear_gpe() and enable_gpe(), as these are handled atAlexey Starikovskiy
dispatch_gpe() level. Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08ACPI: ec: Remove expect_event and all races around it.Alexey Starikovskiy
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08ACPI: ec: Read status register from check_status() functionAlexey Starikovskiy
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08ACPI: ec: Increase timeout from 50 to 500 ms to handle old slow machines.Alexey Starikovskiy
http://bugzilla.kernel.org/show_bug.cgi?id=7466 Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08ACPI: ec: Enable EC GPE at beginning of transactionAlexey Starikovskiy
Temporary measure until resume sequence is right. Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08ACPI: ec: Allow for write semantics in any command.Alexey Starikovskiy
Check for transaction attributes, not command index to decide on event to expect. Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-07ACPI: dock: Fix symbol conflict between acpiphp and dockPrarit Bhargava
Fix bug which will cause acpiphp to not be able to load when dock.ko cannot load. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>