aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi
AgeCommit message (Collapse)Author
2007-07-03ACPICA: Clear reserved fields for incoming ACPI 1.0 FADTsBob Moore
Fixed a problem with the internal FADT conversion where ACPI 1.0 FADTs that contained invalid non-zero values in reserved fields could cause later failures because these fields have meaning in later revisions of the FADT. For incoming ACPI 1.0 FADTs, these fields are now always zeroed. (Preferred_PM_Profile, PSTATE_CNT, CST_CNT, IAPC_BOOT_FLAGS.) Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-07-03ACPICA: Fixed possible corruption of global GPE listBob Moore
Fixed a problem in acpi_ev_delete_gpe_xrupt where the global interrupt list could be corrupted if the interrupt being removed was at the head of the list. Reported by Linn Crosetto. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-07-03ACPICA: Update _OSI string listBob Moore
Latest update for the Windows strings, with comments. Removed unused strings. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-07-03ACPI: suspend: delete toshiba S1 quirkPavel Machek
If we have quirk "init... after standby", we should not be calling it while resuming from hibernation. And... that quirk is only ever needed on toshiba 4030cdt... and... noone should be using standby these days, anyway. That quirk was certainly _not_ meant to be ran after hibernation. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
2007-07-03ACPI: Use menuconfig objectsJan Engelhardt
Use menuconfigs instead of menus, so the whole menu can be disabled at once instead of going through all options. Signed-off-by: Jan Engelhardt <jengelh@gmx.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
2007-07-03ACPI video: Don't export sysfs backlight interface if query _BCL failDanny Kukawka
Currently the acpi video module export the backlight interface to sysfs also if acpi_video_device_lcd_query_levels() fails to read _BLC method (e.g. because the method is not available). In this case the userspace don't know which brightness level are supported and can't set a brightness level (echo return with: "write error: Invalid Argument"). This happend e.g. on a ASUS RF1 (correct supported by the asus-laptop module). The video module should not export the backlight interface if query _BLC fail, because you can't set anything from userspace and this make it useless. http://bugzilla.kernel.org/show_bug.cgi?id=8375 Signed-off-by: Danny Kukawka <dkukawka@suse.de> Acked-by: Luming Yu <luming.yu@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
2007-07-03ACPI: staticAdrian Bunk
make the needlessly global osi_linux static. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
2007-07-03ACPI: staticAdrian Bunk
make 2 needlessly global functions static. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
2007-07-02ACPI: fix acpi_osi=!LinuxLen Brown
Need to check for special case "acpi_osi=!Linux" before handling the general case "acpi_osi=!*", or it will have no effect. Signed-off-by: Len Brown <len.brown@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-01asus_acpi: fix oops on non-asus machinesMaxime Austruy
If asus_acpi_init doesn't find any device it knows about, it mistakenly returns a "success" error code even though it cleans up after itself. Later when trying to rmmod asus_acpi, the module_exit routine would try to clean up one more time and we would end up calling acpi_bus_unregister_driver(&asus_hotk_driver) twice. This patch addresses this first problem by returning -ENODEV when no appropriate device is found. Then there was also another bug with the code handling the return value of backlight_device_register. If this function ever failed, the driver would cleanup by calling the module_exit routine from module_init, but it would still return "success". So any attempt to rmmod this module would result in asus_acpi_exit being called twice but it's not ready to handle it (I haven't hit this bug, just found it by code inspection). This patch fixes that by inserting a return -ENODEV; at the end of this error handling path. Signed-off-by: Maxime Austruy <maxime@tralhalla.org> Cc: Len Brown <lenb@kernel.org> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Jan Engelhardt <jengelh@computergmbh.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-06-23ACPI: sbs: probe smart battery vis SMBus controllerAlexey Starikovskiy
http://bugzilla.kernel.org/show_bug.cgi?id=8559 Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-06-23ACPI EC: Add support for non-AML EC query handlersAlexey Starikovskiy
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-06-23ACPI EC: drop usage of ACPI_DEBUG_PRINT as too heavy weightAlexey Starikovskiy
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-06-23ACPI EC: Re-factor EC space handler to avoid using label/goto for cycle.Alexey Starikovskiy
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-06-23ACPI: fix 2.6.20 SMP boot regressionVenkatesh Pallipadi
Always disable/enable interrupts in the acpi idle routine, even in the error path. This is required as the 2.6.20 change in git commit d331e739f5ad2aaa9... "Fix interrupt race in idle callback" expects the idle handler to enable interrupt before returning. There was a case in acpi idle routine, in which interrupt was not being enabled before return, which caused the system to hang at bootup, while enabling C-states on an SMP system. The signature of the hang was that "processor.nocst" was required to enable boot. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-06-20ACPI: asus_acpi: Do not load if no device has been foundThomas Renninger
asus_acpi_init() has a hack to prevent the driver from loading when asus_hotk_add() fails. However, it was returning the successful return value of acpi_bug_registger_driver() on failure. This caused an oops on unload. Instead it should return -ENODEV. Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-06-18ACPICA: fix error path in new external package objects as method argumentsMyron Stowe
In the routine acpi_ut_create_package_object(), if the ACPI_ALLOCATE_ZEROED() fails then ACPI_FREE(package_desc) is called as part of the cleanup. This should instead be acpi_ut_remove_reference(package_desc) in order to remove the reference acquired from acpi_ut_create_internal_object() [see the routine acpi_ut_create_buffer_object() as an example of proper functionality]. Signed-off-by: Myron Stowe <myron.stowe@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-06-18ACPI: gracefully print null trip-point deviceThomas Renninger
if acpi_bus_get_device() returns NULL, print nothing instead of "<NUL" in /proc/acpi/thermal_zone/*/trip_points Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-06-16toshiba_acpi: fix section mismatch in allyesconfigRandy Dunlap
Fix section error (allyesconfig). The exit function is called from init, so functions that are called by the exit function cannot be marked __exit. WARNING: drivers/built-in.o(.text+0xe5bc6): Section mismatch: reference to .exit. text: (between 'toshiba_acpi_exit' and 'hci_raw') Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Len Brown <len.brown@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-06-09ACPI: disable _OSI(Linux) by defaultLen Brown
In Linux-2.6.22 we expanded the boot parameter osi= so that it can enable and !enable an OSI string. _OSI(Linux) is a special case because we know that there are both systems that require it set, and systems require that it _not_ to be set. In the long term it can't be set, for the same reason _OS(Linux) can't be enabled -- it tends to confuse BIOS that are not properly validated with Linux. Further, the semantics and version information of _OSI(Linux) were never actually defined. The kernel prints out a message if it sees _OSI(Linux) requested, and there is a DMI workaround to invoke "osi=Linux" automatically for existing systems that need it. http://bugzilla.kernel.org/show_bug.cgi?id=7787 Signed-off-by: Len Brown <len.brown@intel.com>
2007-06-02Pull osi-now into release branchLen Brown
2007-06-02Pull now into release branchLen Brown
2007-06-02ACPI: bay: send envp with ueventKristen Carlson Accardi
Make the bay driver send env information on bay events. Upon any bay event, we will send the string "BAY_EVENT=%d" along with the KOBJ_CHANGE, and report the event number. What the event number means will be platform specific. Event 3 is always an eject request, but an insert may be either event 1, or it may be event 0. Event 1 may also be a remove request. It would be best if you check the number of your event with udevmonitor before writing any udev scripts for inserting and removing drive bays. Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Cc: Stephan Berberig <s.berberig@arcor.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
2007-06-02ACPICA: Support for external package objects as method argumentsBob Moore
Implemented support to allow Package objects to be passed as method arguments to the acpi_evaluate_object interface. Previously, this would return an AE_NOT_IMPLEMENTED exception. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-06-02ACPI: Section mismatch ... acpi_map_pxm_to_nodeLuck, Tony
Last of the "Section mismatch" errors from ia64 builds! acpi_map_pxm_to_node() is defined with attribute __cpuinit, but is called by "normal" kernel functions acpi_getnode() and acpi_map_cpu2node(). Commit f363d16fbb9374c0bd7f2757d412c287169094c9 moved the data structures on which this routine operates from __cpuinitdata to regular memory, so this routine can also move out of init space. Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-06-02ACPI: Lindent processor throttling codeLen Brown
Signed-off-by: Len Brown <len.brown@intel.com>
2007-06-02ACPI: add ACPI 3.0 _TPC _TSS _PTC throttling supportLuming Yu
adds _TPC _TSS _PTC -- Throttling Present Capabilities Signed-off-by: Luming Yu <luming.yu@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-06-01acpi: fix section mismatch warning in asus + toshibaSam Ravnborg
Fix following section mismatch warnings in acpi WARNING: drivers/acpi/asus_acpi.o(.init.text+0xb7): Section mismatch: reference to .exit.text: (after 'init_module') WARNING: o-i386/drivers/acpi/toshiba_acpi.o(.init.text+0x13a): Section mismatch: reference to .exit.text: (after 'init_module') The exit function is used in the init function during an error codition. As __exit may be discarded during link-time / run-time this is no good. Do not mark the exit function __exit. Note: This warning is only seen by my local copy of modpost but the change will soon hit upstream. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> 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-05-30ACPI: add __init to acpi_initialize_subsystem()Len Brown
Add __init to: acpi_initialize_subsystem() (and un-export it) acpi_os_initialize() Add __initdata to: acpi_osl_dmi_table[] Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-30ACPI: Make _OSI(Linux) a special caseLen Brown
_OSI("Linux") is like _OS("Linux"), it is ill-defined and virtually no BIOS vendors test interaction with it. As a result, it can do more damage than good because it causes the BIOS to follow un-tested paths. Recently, several machines have turned up that erroneously test this string in a way which causes them to _not_ test other compatibility strings, including the ZI9 and Toshiba. So it appears that this bad code has made it into a BIOS vendor's reference BIOS. Linux has no choice but to stop advertising compatibility with _OSI string "Linux" - as there are an unbounded number of possible incompatibilities going forward. But some BIOSes have already shipped which do use it for things like conditionally re-enabling video on resume from S3. (Too bad they didn't do that unconditionally) Add special case code for _OSI(Linux) Squawk to dmesg if _OSI(Linux) is requested Add DMI list both to enable and disable _OSI(Linux) But for now, keep the default enabled via #define OSI_LINUX_ENABLED. http://bugzilla.kernel.org/show_bug.cgi?id=7787 Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-29ACPI: extend "acpi_osi=" boot optionLen Brown
The boot option "acpi_osi=" has always disabled Linux _OSI support, thus disabling all OS Interface strings which are advertised by Linux to the BIOS. Now... acpi_osi="string" adds the interface string, and acpi_osi="!string" invalidates the pre-defined interface string eg. acpi_osi="!Windows 2006" would disable Linux's claim of Vista compatibility. Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-29ACPI: thermal: Replace pointer with name in trip_pointsThomas Renninger
For users with active thermal trip points, they need the fan's name, rather than its address, to understand where to look to observe and control fan state. Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-29ACPICA: allow Load(OEMx) tablesLen Brown
HP and Hitachi machines have been implemented with SSDT's that use the "OEMx" signatures. But upon Load, ACPICA is rejecting these tables because they are not using the "SSDT" signature. ACPI Error (tbinstal-0134): Table has invalid signature [OEMx], must be SSDT... Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-17acpi: fix potential call to a freed memory section.Aaron Durbin
Strip __cpuinit[data] from Node <-> PXM routines and supporting data structures. Also make pxm_to_node_map and node_to_pxm_map local to the numa acpi module. This fixes a bug triggered by the following conditions: - boot on a machine with a SLIT table defined - kernel is configured w/ CONFIG_HOTPLUG_CPU=n - cat /sys/devices/system/node/node*/distance This will cause an oops by calling into a freed memory section. In particular, on x86_64, __node_distance calls node_to_pxm(). Signed-off-by: Aaron Durbin <adurbin@google.com> Cc: Len Brown <lenb@kernel.org> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-11ACPI: battery: syntax cleanupAlexey Starikovskiy
In response to review comments from Andrew Morton Signed-off-by: Alexey Starikovskiy <aystarik@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-10Pull misc-for-upstream into release branchLen Brown
2007-05-10acpi,msi-laptop: Fall back to EC polling mode for MSI laptop specific EC ↵Lennart Poettering
commands The ACPI EC that is used in MSI laptops knows some non-standard commands for changing the screen brighntess and a few other things, which are used by the msi-laptop.c driver. Unfortunately for these commands no GPE events for IBF and OBF are triggered. Since nowadays the EC code uses the ec_intr=1 mode by default, this causes these operations to timeout, although they don't fail. In result, all operations that you can do with the msi-laptop.c driver take more or less 1s to complete, which is awfully slow. In one of the more recent kernels (2.6.20?) the EC subsystem has been revamped. With that change the EC timeout has been increased. before that increase the MSI EC accesses were slow -- but not *that* slow, hence I took notice of this limitation of the MSI EC hardware only very recently. The standard EC operations on the MSI EC as defined in the ACPI spec support GPE events properly. The following patch adds a new argument "force_poll" to the ec_transaction() function (and friends). If set to 1, the function will poll for IBF/OBF even if ec_intr=1 is enabled. If set to 0 the current behaviour is used. The msi-laptop driver is modified to make use of this new flag, so that OBF/IBF is polled for the special MSI EC transactions -- but only for them. Signed-off-by: Lennart Poettering <mzxreary@0pointer.de> Acked-by: Alexey Starikovskiy <aystarik@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-10ACPI: bay: unsuppress ueventsKristen Carlson Accardi
Since platform devices seem to get uevents suppressed by default, manually unsuppress for the bay device since we want to be able to send uevents. Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-10ACPI: dock: send envp with ueventKristen Carlson Accardi
Send an env along with our KOBJ_CHANGE uevent so that user space has the option of checking for that to see if a dock or undock has occurred. Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-10ACPI: dock: unsuppress ueventsKristen Carlson Accardi
Platform devices may not send uevents by default - override the setting so that we can send uevents on dock/undock. Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-10ACPI: dock: add immediate_undock optionKristen Carlson Accardi
Allow the driver to be loaded with an option that will allow userspace to control whether the laptop is ejected immediately when the user presses the button, or only when the syfs undock file is written. if immediate_undock == 1, then when the user presses the undock button, the laptop will send an event to userspace to notify userspace of the undock, but then immediately undock without waiting for userspace. This is the current behavior, and I set this to be the default. if immediate_undock == 0, then when the user presses the undock button, the laptop will send an event to userspace and do nothing. User space can query the "flags" sysfs entry to determine if an undock request has been made by the user (if bit 1 is set). User space will then need to write the undock sysfs entry to complete the undocking process. Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-10ACPI: dock: use dynamically allocated platform deviceKristen Carlson Accardi
Get rid of no release function warnings by switching to dynamically allocating the platform_device and using the platform device release routine in the base driver. Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-10ACPI: dock: fix opps after dock driver fails to initializeChuck Ebbert
The driver tests the dock_station pointer for nonnull to check whether it has initialized properly. But in some cases dock_station will be non-null after being freed when driver init fails. Fix by zeroing the pointer after freeing. Signed-off-by: Chuck Ebbert <cebbert@redhat.com> Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-10ACPI: dock: cleanup the uid patchKristen Carlson Accardi
Make uid sysfs file error path free memory, and cleanup sysfs file when removing driver. Also fix CodingStyle violations. Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Cc: Illya A. Volynets-Evenbakh <ilya@total-knowledge.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-10Pull acpica into release branchLen Brown
2007-05-10Pull bugzilla-8385 into release branchLen Brown
2007-05-10Pull thermal into release branchLen Brown
2007-05-09ACPICA: LindentLen Brown
Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-09ACPI: created a dedicated workqueue for notify() executionAlexey Starikovskiy
HP nx6125/nx6325/... machines have a _GPE handler with an infinite loop sending Notify() events to different ACPI subsystems. Notify handler in ACPI driver is a C-routine, which may call ACPI interpreter again to get access to some ACPI variables (acpi_evaluate_xxx). On these HP machines such an evaluation changes state of some variable and lets the loop above break. In the current ACPI implementation Notify requests are being deferred to the same kacpid workqueue on which the above GPE handler with infinite loop is executing. Thus we have a deadlock -- loop will continue to spin, sending notify events, and at the same time preventing these notify events from being run on a workqueue. All notify events are deferred, thus we see increase in memory consumption noticed by author of the thread. Also as GPE handling is bloked, machines overheat. Eventually by external poll of the same acpi_evaluate, kacpid is released and all the queued notify events are free to run, thus 100% cpu utilization by kacpid for several seconds or more. To prevent all these horrors it's needed to not put notify events to kacpid workqueue by either executing them immediately or putting them on some other thread. It's dangerous to execute notify events in place, as it will put several ACPI interpreter stacks on top of each other (at least 4 in case of nx6125), thus causing kernel stack overflow. First attempt to create a new thread was done by Peter Wainwright He created a bunch of threads, which were stealing work from a kacpid workqueue. This patch appeared in 2.6.15 kernel shipped with Ubuntu 6.06 LTS. Second attempt was done by me, I created a new thread for each Notify event. This worked OK on HP nx machines, but broke Linus' Compaq n620c, by producing threads with a speed what they stopped the machine completely. Thus this patch was reverted from 18-rc2 as I remember. I re-made the patch to create second workqueue just for notify events, thus hopping it will not break Linus' machine. Patch was tested on the same HP nx machines in #5534 and #7122, but I did not received reply from Linus on a test patch sent to him. Patch went to 19-rc and was rejected with much fanfare again. There was 4th patch, which inserted schedule_timeout(1) into deferred execution of kacpid, if we had any notify requests pending, but Linus decided that it was too complex (involved either changes to workqueue to see if it's empty or atomic inc/dec). Now you see last variant which adds yield() to every GPE execution. http://bugzilla.kernel.org/show_bug.cgi?id=5534 http://bugzilla.kernel.org/show_bug.cgi?id=8385 Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-09Revert "ACPICA: fix AML mutex re-entrancy"Len Brown
This reverts commit c0d127b56937c3e72c2b1819161d2f6718eee877. These changes to AML locking were made to allow Notify handlers to be called on the stack and not deadlock. However, that scheme turns out to be flawed and was reverted by the previous commit, so this commit restores the locking to it previous design. Signed-off-by: Len Brown <len.brown@intel.com>