Commit Graph

1523 Commits

Author SHA1 Message Date
Linus Torvalds 08acd4f8af Merge branch 'release' of 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: (179 commits)
  ACPI: Fix acpi_processor_idle and idle= boot parameters interaction
  acpi: fix section mismatch warning in pnpacpi
  intel_menlo: fix build warning
  ACPI: Cleanup: Remove unneeded, multiple local dummy variables
  ACPI: video - fix permissions on some proc entries
  ACPI: video - properly handle errors when registering proc elements
  ACPI: video - do not store invalid entries in attached_array list
  ACPI: re-name acpi_pm_ops to acpi_suspend_ops
  ACER_WMI/ASUS_LAPTOP: fix build bug
  thinkpad_acpi: fix possible NULL pointer dereference if kstrdup failed
  ACPI: check a return value correctly in acpi_power_get_context()
  #if 0 acpi/bay.c:eject_removable_drive()
  eeepc-laptop: add hwmon fan control
  eeepc-laptop: add backlight
  eeepc-laptop: add base driver
  ACPI: thinkpad-acpi: bump up version to 0.20
  ACPI: thinkpad-acpi: fix selects in Kconfig
  ACPI: thinkpad-acpi: use a private workqueue
  ACPI: thinkpad-acpi: fluff really minor fix
  ACPI: thinkpad-acpi: use uppercase for "LED" on user documentation
  ...

Fixed conflicts in drivers/acpi/video.c and drivers/misc/intel_menlow.c
manually.
2008-04-30 11:52:52 -07:00
Len Brown 96916090f4 Merge branches 'release', 'acpica', 'bugzilla-10224', 'bugzilla-9772', 'bugzilla-9916', 'ec', 'eeepc', 'idle', 'misc', 'pm-legacy', 'sysfs-links-2.6.26', 'thermal', 'thinkpad' and 'video' into release 2008-04-30 13:58:00 -04:00
Venkatesh Pallipadi 36a9135865 ACPI: Fix acpi_processor_idle and idle= boot parameters interaction
acpi_processor_idle and "idle=" boot parameter interaction is broken.
The problem is that, at boot time acpi driver is checking for "idle=" boot
option and not registering the acpi idle handler. But, when there is a CST
changed callback (typically when switching AC <-> battery or suspend-resume)
there are no checks for boot_option_idle_override and acpi idle handler tries
to get installed with nasty side effects.

With CPU_IDLE configured this issue causes results in a nasty oops on CST
change callback and without CPU_IDLE there is no oops, but boot option
of "idle=" gets ignored and acpi idle handler gets installed.

Change the behavior to not do anything in acpi idle handler when there is a
"idle=" boot option.

Note that the problem is only there when "idle=" boot option is used.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-30 13:57:15 -04:00
Alex Chiang fe086a7bea [IA64] Provide ACPI fixup for /proc/cpuinfo/physical_id
Legacy HP ia64 platforms currently cannot provide
/proc/cpuinfo/physical_id due to legacy SAL/PAL implementations.
However, that physical topology information can be obtained
via ACPI.

Provide an interface that gives ACPI one last chance to provide
physical_id for these legacy platforms. This logic only comes
into play iff:

- ACPI actually provides slot information for the CPU
- we lack a valid socket_id

Otherwise, we don't do anything.

Since x86 uses the ACPI processor driver as well, we provide a nop
stub function for arch_fix_phys_package_id() in asm-x86/topology.h

Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2008-04-29 15:05:29 -07:00
Linus Torvalds 5f78e4d339 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86-bigbox-pci
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86-bigbox-pci:
  x86: add pci=check_enable_amd_mmconf and dmi check
  x86: work around io allocation overlap of HT links
  acpi: get boot_cpu_id as early for k8_scan_nodes
  x86_64: don't need set default res if only have one root bus
  x86: double check the multi root bus with fam10h mmconf
  x86: multi pci root bus with different io resource range, on 64-bit
  x86: use bus conf in NB conf fun1 to get bus range on, on 64-bit
  x86: get mp_bus_to_node early
  x86 pci: remove checking type for mmconfig probe
  x86: remove unneeded check in mmconf reject
  driver core: try parent numa_node at first before using default
  x86: seperate mmconf for fam10h out from setup_64.c
  x86: if acpi=off, force setting the mmconf for fam10h
  x86_64: check MSR to get MMCONFIG for AMD Family 10h
  x86_64: check and enable MMCONFIG for AMD Family 10h
  x86_64: set cfg_size for AMD Family 10h in case MMCONFIG
  x86: mmconf enable mcfg early
  x86: clear pci_mmcfg_virt when mmcfg get rejected
  x86: validate against acpi motherboard resources

Fixed up fairly trivial conflicts in arch/x86/pci/{init.c,pci.h} due to
OLPC support manually.
2008-04-29 08:26:51 -07:00
Denis V. Lunev cf7acfab03 acpi: use non-racy method for proc entries creation
Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data
be setup before gluing PDE to main tree.

Add correct ->owner to proc_fops to fix reading/module unloading race.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Cc: Len Brown <lenb@kernel.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-29 08:06:22 -07:00
Thomas Renninger 66fb9d120e ACPI: Cleanup: Remove unneeded, multiple local dummy variables
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 10:51:45 -04:00
Dmitry Torokhov c46e5658a0 ACPI: video - fix permissions on some proc entries
POST and DOS are supposed to be writable but permissions
did not allow it.

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>
2008-04-29 10:50:55 -04:00
Dmitry Torokhov 251cb0bc79 ACPI: video - properly handle errors when registering proc elements
Have acpi_video_device_add_fs() and acpi_video_bus_add_fs()
properly unwind proc creation after error.

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>
2008-04-29 10:50:41 -04:00
Dmitry Torokhov 78eed028f1 ACPI: video - do not store invalid entries in attached_array list
this is a cleanup, not a change to function.

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>
2008-04-29 10:50:31 -04:00
Len Brown 2c6e33c366 ACPI: re-name acpi_pm_ops to acpi_suspend_ops
... as they are platform_suspend_ops after all.

cosmetic re-name only, no functional change.

Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 10:15:27 -04:00
Li Zefan a815ab8b58 ACPI: check a return value correctly in acpi_power_get_context()
We should check *resource != NULL rather than resource != NULL, which will be
always true.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 10:10:03 -04:00
Adrian Bunk 2a241d77cf #if 0 acpi/bay.c:eject_removable_drive()
This patch #if 0's the unused eject_removable_drive().

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 10:09:52 -04:00
Damián Viano 51ae796f7f ACPICA: always disable GPE when requested
acpi_ev_disable_gpe() has an optimization where it doesn't disable
a GPE that it "doesn't have to".  Unfortunately, it can get tricked
by AML that scribbles on register state behind its back.  So when asked
to disable a GPE, simply do it -- a redundant register write
in the common case is a fair price to pay to be bomb-proof
for the rare cases.

http://bugzilla.kernel.org/show_bug.cgi?id=6217

Signed-off-by: Damián Viano <des@debian.org>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 03:32:25 -04:00
Zhang, Rui 76ecb4f2d7 ACPI: update thermal temperature
Fix the problem that thermal_get_temp returns the cached value,
which causes the temperature in generic thermal never updates.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 02:53:42 -04:00
Julia Lawall 9030062f3d ACPI: elide a non-zero test on a result that is never 0
thermal_cooling_device_register used to return NULL if THERMAL is "n".
As the ACPI fan, processor and video drivers SELECT the generic
thermal in PATCH 01, this is not a problem any more.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 02:52:45 -04:00
Zhang Rui e9ae71078b thermal: update the documentation
Update the documentation for the thermal driver hwmon sys I/F.

Change the ACPI thermal zone type to be consistent with hwmon.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 02:49:47 -04:00
Zhang, Rui 9ec732ff80 thermal: add new get_crit_temp callback
Add a new callback so that the generic thermal can get
the critical trip point info of a thermal zone,
which is needed for building the tempX_crit hwmon sysfs attribute.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 02:45:49 -04:00
Zhang Rui 63c4ec905d thermal: add the support for building the generic thermal as a module
Build the generic thermal driver as module "thermal_sys".

Make ACPI thermal, video, processor and fan SELECT the generic
thermal driver, as these drivers rely on it to build the sysfs I/F.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 02:44:00 -04:00
Zhang Rui 2f67a0695d flush kacpi_notify_wq before removing notify handler
Flush kacpi_notify_wq before notify handler is removed,
this can fix a bug which the deferred notify handler is executed
after the notify_handler has already been removed.
http://bugzilla.kernel.org/show_bug.cgi?id=9772

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 02:34:42 -04:00
Mike Travis c938ac2132 [CPUFREQ] change cpu freq tables to per_cpu variables
Change cpufreq tables from arrays to per_cpu variables in
drivers/acpi/processor_thermal.c

Based on git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

Cc: Len Brown <len.brown@intel.com>
Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Dave Jones <davej@codemonkey.org.uk>
2008-04-28 15:05:44 -04:00
Andrew Morton d83fd8a267 drivers/acpi/thermal.c: fix build with CONFIG_DMI=n
drivers/acpi/thermal.c: In function 'acpi_thermal_init':
drivers/acpi/thermal.c:1794: error: 'thermal_dmi_table' undeclared (first use in this function)
drivers/acpi/thermal.c:1794: error: (Each undeclared identifier is reported only once
drivers/acpi/thermal.c:1794: error: for each function it appears in.)

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-28 08:58:30 -07:00
Peter Zijlstra 7f424a8b08 fix idle (arch, acpi and apm) and lockdep
OK, so 25-mm1 gave a lockdep error which made me look into this.

The first thing that I noticed was the horrible mess; the second thing I
saw was hacks like: 71e93d1561

The problem is that arch idle routines are somewhat inconsitent with
their IRQ state handling and instead of fixing _that_, we go paper over
the problem.

So the thing I've tried to do is set a standard for idle routines and
fix them all up to adhere to that. So the rules are:

  idle routines are entered with IRQs disabled
  idle routines will exit with IRQs enabled

Nearly all already did this in one form or another.

Merge the 32 and 64 bit bits so they no longer have different bugs.

As for the actual lockdep warning; __sti_mwait() did a plainly un-annotated
irq-enable.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Tested-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-27 00:01:45 +02:00
Robert Hancock 7752d5cfe3 x86: validate against acpi motherboard resources
This path adds validation of the MMCONFIG table against the ACPI reserved
motherboard resources.  If the MMCONFIG table is found to be reserved in
ACPI, we don't bother checking the E820 table.  The PCI Express firmware
spec apparently tells BIOS developers that reservation in ACPI is required
and E820 reservation is optional, so checking against ACPI first makes
sense.  Many BIOSes don't reserve the MMCONFIG region in E820 even though
it is perfectly functional, the existing check needlessly disables MMCONFIG
in these cases.

In order to do this, MMCONFIG setup has been split into two phases.  If PCI
configuration type 1 is not available then MMCONFIG is enabled early as
before.  Otherwise, it is enabled later after the ACPI interpreter is
enabled, since we need to be able to execute control methods in order to
check the ACPI reserved resources.  Presently this is just triggered off
the end of ACPI interpreter initialization.

There are a few other behavioral changes here:

- Validate all MMCONFIG configurations provided, not just the first one.

- Validate the entire required length of each configuration according to
  the provided ending bus number is reserved, not just the minimum required
  allocation.

- Validate that the area is reserved even if we read it from the chipset
  directly and not from the MCFG table.  This catches the case where the
  BIOS didn't set the location properly in the chipset and has mapped it
  over other things it shouldn't have.

This also cleans up the MMCONFIG initialization functions so that they
simply do nothing if MMCONFIG is not compiled in.

Based on an original patch by Rajesh Shah from Intel.

[akpm@linux-foundation.org: many fixes and cleanups]
Signed-off-by: Robert Hancock <hancockr@shaw.ca>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Andi Kleen <ak@suse.de>
Cc: Rajesh Shah <rajesh.shah@intel.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andi Kleen <ak@suse.de>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-04-26 23:41:03 +02:00
Venkatesh Pallipadi 0fda6b403f 2.6.25 regression: powertop says 120K wakeups/sec
Patch to fix huge number of wakeups reported due to recent changes in
processor_idle.c. The problem was that the entry_method determination was
broken due to one of the recent commits (bc71bec91f) causing
C1 entry to not to go to halt.

http://lkml.org/lkml/2008/3/22/124

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-24 20:05:01 -04:00
Alexey Starikovskiy 204470272c ACPI: GPE enabling should happen after EC installation
GPE could try to access EC region, so should not be enabled before
EC is installed

http://bugzilla.kernel.org/show_bug.cgi?id=9916

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-24 19:55:20 -04:00
Len Brown 75a44ce00b ACPICA: update Intel copyright
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-23 23:00:13 -04:00
Bob Moore cca97b8156 ACPICA: Fix for some local named nodes not marked temporary and to disallow duplicates
Fixed a problem with the CreateField, CreateXXXField (Bit, Byte,
Word, Dword, Qword), Field, BankField, and IndexField operators
when invoked from inside an executing control method. In this case,
these operators created namespace nodes that were incorrectly
left marked as permanent nodes instead of temporary nodes. This
could cause a problem if there is race condition between an
exiting control method and a running namespace walk. (Reported
by Linn Crosetto). Fixed a problem where the CreateField and
CreateXXXField operators would incorrectly allow duplicate names
(the name of the field) with no exception generated.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 23:01:51 -04:00
Zhang Rui 514d18d79b ACPICA: Update for new Notify values
Implemented several changes for Notify handling: Added support
for new Notify values (ACPI 2.0+) and improved the Notify debug
output. Notify on PowerResource objects is no longer allowed,
as per the ACPI specification.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 23:01:36 -04:00
Bob Moore 66d3ca9ea2 ACPICA: Fixes for size of StartDependent resource descriptor
Fixed a couple of size calculation issues with the variable-length
Start Dependent resource descriptor.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 19:09:25 -04:00
Bob Moore d8846574ed ACPICA: Updates for Debug object output
Implemented several improvements for the output of the ASL "Debug"
object to clarify and keep all data for a given object on one
output line.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 19:09:16 -04:00
Bob Moore cd0b224824 ACPICA: Fixes for external Reference Objects
All Reference Objects returned via the AcpiEvaluteObject interface
are now marked as type "REFERENCE" instead of "ANY". The type ANY
is now reservered for NULL objects - either NULL package elements
or unresolved named references.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 19:08:51 -04:00
Lin Ming 7a5bb99645 ACPICA: Fix to handle NULL package elements correctly
Fixed problem where NULL package elements were not returned to
the AcpiEvaluateObject interface correctly. Instead of returning a
NULL ACPI_OBJECT package element, the element was simply ignored,
potentially causing a buffer overflow and/or confusing the caller
who expected a fixed number of elements.

http://bugzilla.kernel.org/show_bug.cgi?id=10132

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 15:35:19 -04:00
Bob Moore 0ba7d25c70 ACPICA: Fix for extraneous debug message for packages
Fixed a problem where an extraneous debug message was produced for
package objects (when debugging enabled). The message "Package
List length larger than NumElements count" is now produced in
the correct case, and is also an error message rather than a
debug message. Added a debug message for the opposite case, where
NumElements is larger than the Package List, and the package has
been padded out with NULL elements.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 15:34:41 -04:00
Bob Moore 24a3157a90 ACPICA: Fix for possible error when packages/buffers are passed to methods externally
Fixed a problem where buffer and package objects passed as
arguments to a control method via the external AcpiEvaluateObject
interface could cause an AE_AML_INTERNAL exception depending on the
order and type of operators executed by the target control method.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:31 -04:00
Lin Ming a3df4dadd4 ACPICA: Update behavior of CopyObject to match ACPI spec
Fixed a problem where a CopyObject to RegionField, BankField, and
IndexField objects did not perform an implicit conversion as it
should. These types must retain their initial type permanently as
per the ACPI specification. However, a CopyObject to all other
object types should not perform an implicit conversion, as per
the ACPI specification.

http://www.acpica.org/bugzilla/show_bug.cgi?id=388

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:31 -04:00
Bob Moore 1d5b285da1 ACPICA: Fix for resource descriptor optimization issues for _CRS/_SRC
Fixed a problem where resource descriptor size optimization
could cause a problem when a _CRS resource template is passed
to a _SRS method. The _SRS resource template must use the same
descriptors (with the same size) as returned from _CRS. This
change affects the following resource descriptors: IRQ/IRQNoFlags
and StartDependendentFn/StartDependentFnNoPri.

http://bugzilla.kernel.org/show_bug.cgi?id=9487

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:31 -04:00
Bob Moore b1dd9096fe ACPICA: Added new error messages
New messages for the 2 AE_SUPPORT cases.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:31 -04:00
Bob Moore 507f046c4d ACPICA: Add va_end statements as appropriate
Added missing va_end statements that should correspond with each
va_start statement.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:31 -04:00
Lin Ming bc7a36ab74 ACPICA: Fixes for Unload and DDBHandles
Implemented support for the use of DDBHandles as an Indexed
Reference, as per the ACPI spec.

http://www.acpica.org/bugzilla/show_bug.cgi?id=486.

Implemented support for UserTerm (Method invocation) for the Unload operator
as per the ACPI spec.

http://www.acpica.org/bugzilla/show_bug.cgi?id=580

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:30 -04:00
Lin Ming 47c08729bf ACPICA: Fix for LoadTable operator, input strings
Fixed a problem with the LoadTable operator where the OemId
and OemTableId input strings could cause unexpected failures if
they were shorter than the maximum lengths allowed.

http://www.acpica.org/bugzilla/show_bug.cgi?id=576

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:29 -04:00
Lin Ming 200cce6a75 ACPICA: Fix for Load operator
Fixed a problem with the Load operator where an exception was not
returned in the case where the table is already loaded.

http://www.acpica.org/bugzilla/show_bug.cgi?id=463

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:29 -04:00
Lin Ming 9accd46459 ACPICA: Methods now implicitly return 0 in slack mode
Implemented an enhancement to the interpreter "slack mode". In the
absence of an explicit return or an implicitly returned object from
the last executed opcode, a control method will now implicitly
return an integer of value 0 for Microsoft compatibility.

http://www.acpica.org/bugzilla/show_bug.cgi?id=392

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:29 -04:00
Lin Ming 8246934b7c ACPICA: Fix for SizeOf when used with Buffers and Packages
Fixed a problem with the SizeOf operator when used with Package
and Buffer objects. These objects have deferred execution for some
arguments, and the execution is now completed before the SizeOf is
executed. This problem caused unexpected AE_PACKAGE_LIMIT errors
on some systems.

http://bugzilla.kernel.org/show_bug.cgi?id=9558

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:29 -04:00
Lin Ming ef805d9563 ACPICA: Implemented full argument resolution support for the BankValue argument to BankField
Previously, only constants were supported, now any TermArg may
be used.

http://www.acpica.org/bugzilla/show_bug.cgi?id=387
http://www.acpica.org/bugzilla/show_bug.cgi?id=393

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:28 -04:00
Bob Moore 57345ee6b8 ACPICA: Undo accidental checkin of not-fully-tested mutex changes
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:28 -04:00
Lin Ming 941f48bb46 ACPICA: Implemented full support for deferred execution for the TermArg string arguments for DataTableRegion
This enables forward references and full operand resolution for
the three string arguments. Similar to OperationRegion deferred
argument execution.)

http://www.acpica.org/bugzilla/show_bug.cgi?id=430

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:28 -04:00
Bob Moore 9aa6169f47 ACPICA: Fixed a problem with Index Fields where the Index register was incorrectly limited to a maximum of 32 bits
Now any size may be used.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:28 -04:00
Bob Moore 549f46044e ACPICA: Fixed a problem with AcpiGetDevices where the search of a branch of the device tree could be terminated prematurely
In accordance with the ACPI specification, the search is terminated
if a device is both not present and not functional (instead of
just not present.) Yakui Zhao.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:28 -04:00
Lin Ming 1cb2ef6606 ACPICA: Fixed a problem with CopyObject used in conjunction with the Index operator
The reference was incorrectly dereferenced before the copy. The
reference is now correctly copied.

http://bugzilla.kernel.org/show_bug.cgi?id=5391

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:28 -04:00
Lin Ming e5bcc811f7 ACPICA: Fixed a problem with Index references passed as method arguments
References passed as arguments to control methods were dereferenced
immediately (before control was passed to the called method). The
references are now correctly passed directly to the called
method.

http://bugzilla.kernel.org/show_bug.cgi?id=5389

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:27 -04:00
Bob Moore 1f549a240c ACPICA: Fixed a problem with FromBCD and ToBCD with some compilers
On some compilers, the ShortDivide function worked incorrectly,
causing problems with the BCD functions with large input
values. (Truncation from 64-bit to 32-bit occurred.) Internal
http://www.acpica.org/bugzilla/show_bug.cgi?id=435

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:27 -04:00
Bob Moore b160987df7 ACPICA: Fixes a problem with control method references within packages
Completes the package changes started with version 20071019.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:27 -04:00
Bob Moore f2d69559b3 ACPICA: Cleanup of debug output
Improved output of object dump routine.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:27 -04:00
Bob Moore b7f9f04228 ACPICA: Cosmetic changes only, no functional changes
Lint changes, fix compiler warnings, etc.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:27 -04:00
Bob Moore 1d18c05825 ACPICA: Cosmetic changes only, no functional changes
Lint changes, fix compiler warnings, etc.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:27 -04:00
Lin Ming 49718b1741 ACPICA: Added additional parameter validation for LoadTable
Implemented additional parameter validation for the LoadTable
operator. The length of the input strings SignatureString,
OemIdString, and OemTableId are now checked for maximum
lengths.

http://www.acpica.org/bugzilla/show_bug.cgi?id=582

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:26 -04:00
Bob Moore 9e41d93c97 ACPICA: Fixed a memory leak when Device or Thermal objects referenced in packages
Problem introduced in fix for Package references.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:26 -04:00
Bob Moore 7f4ac9f913 ACPICA: Fix for Load/LoadTable to specify load location
Fixed a problem with the Load and LoadTable operators where
the table location within the namespace was ignored. Instead,
the table was always loaded into the root or current scope.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:26 -04:00
Bob Moore d8841647de ACPICA: Add error checks to prevent faults
Added additional error checking to prevent run-time faults.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:26 -04:00
Bob Moore 98af37fba9 ACPICA: Add a table checksum verify for Load operator
Added a table checksum verification for the Load operator, in
the case where the load is from a buffer.

http://www.acpica.org/bugzilla/show_bug.cgi?id=578

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:25 -04:00
Bob Moore a13b8460c5 ACPICA: Fix for memory leak related to DdbHandle objects
Fixed a memory leak where DdbHandle objects were not deleted
automatically at control method exit.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:25 -04:00
Bob Moore 61ce421bb7 ACPICA: Fix a fault when storing DdbHandle to Debug object
Fixed a problem with the Debug object where a store of a DdbHandle
reference object to the Debug object could cause a fault.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:25 -04:00
Bob Moore 5eb691805f ACPICA: Fix for fault if Load() fails
Fixed a problem with the Load operator when loading a table from
a buffer object. The input buffer was prematurely zeroed and/or
deleted.

http://www.acpica.org/bugzilla/show_bug.cgi?id=577

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:24 -04:00
Bob Moore 53cf174409 ACPICA: Fix for Alias operator to see target child objects
Fixed a problem with the Alias operator when the target of the
alias is a named ASL operator that opens a new scope -- Scope,
Device, PowerResource, Processor, and ThermalZone. In these cases,
any children of the original operator could not be accessed via
the alias, potentially causing unexpected AE_NOT_FOUND exceptions.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:24 -04:00
Lin Ming 14808822a9 ACPICA: Fix for namespace lookup problem
Fixed a problem where objects of certain types (Device,
ThermalZone, Processor, PowerResource) can be not found if they
are declared and referenced from within the same control method

http://www.acpica.org/bugzilla/show_bug.cgi?id=341.

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:24 -04:00
Lin Ming 3e08e2d2d6 ACPICA: New interfaces for table event handlers
Designed and implemented new external interfaces to install and
remove handlers for ACPI table-related events. Current events that
are defined are LOAD and UNLOAD. These interfaces allow the host to
track ACPI tables as they are dynamically loaded and unloaded. See
AcpiInstallTableHandler and AcpiRemoveTableHandler.

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:24 -04:00
Bob Moore e20a679b4a ACPICA: Support for iASL - multiple files and wildcards
Implemented support to allow multiple files to be
compiled/disassembled in a single invocation. This includes
command line wildcard support for both the Windows and Unix
versions of the compiler. This feature simplifies the disassembly
and compilation of multiple ACPI tables in a single directory.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:23 -04:00
Bob Moore 6deb65dd9d ACPICA: Updated error message for dynamic method serialization
Added more information to make the message clearer.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:23 -04:00
Bob Moore e5567afa5c ACPICA: Fix for update of the Global Lock Handle
Fixed a problem where the global lock handle was not properly
updated if a thread that acquired the global lock via
executing AML code then attempted to acquire the lock via the
AcpiAcquireGlobalLock interface.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:23 -04:00
Bob Moore 91d02132fe ACPICA: Fix for package reference counts
Prevents infinite loop of 'Large Reference Count' messages in
aslts-bdemo-b286 test.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:22 -04:00
Bob Moore 422f4f90a2 ACPICA: Increase maximum buffer size dumped to screen in buffer object dump
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:22 -04:00
Bob Moore f02e9fa1ce ACPICA: Misc fixes for recent global lock code update
Fixes as a result of running full validation test suite.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:22 -04:00
Bob Moore a69c77c720 ACPICA: Removed extraneous code
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:22 -04:00
Bob Moore 91e38d10b2 ACPICA: Update comments for acquire/release mutex interfaces
pdate comments for acquire/release mutex interfaces

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:22 -04:00
Bob Moore 4b6e16cf2b ACPICA: Avoid use of invalid pointers in returned object field
During operand evaluation, ensure that the ReturnObj field is
cleared on error and only valid pointers are stored there.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:21 -04:00
Bob Moore 4e3156b183 ACPICA: changed order of interpretation of operand objects
The interpreter now evaluates operands in the order that they
appear (both in the
 AML and ASL), instead of in reverse order. This previously
 caused subtle incompatibilities with the MS interpreter as well
 as being non-intuitive.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:21 -04:00
Bob Moore ba886cd4ac ACPICA: Update for mutiple global lock acquisitions by same thread
Allows AcpiAcquireGlobalLock external interface to be called
multiple times by the
 same thread. Allows use of AML fields that require the global
 lock while the running AML is already holding the global lock.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:21 -04:00
Bob Moore f654ecbfac ACPICA: Removed unused code
Handling of AML_NAME_OP as a Reference.Opcode is no longer
needed. Kernel bugzilla 2874

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:20 -04:00
Bob Moore 773069d480 ACPICA: Several fixes for internal method result stack
fixes STACK_OVERFLOW exception on nested method calls. internal
bugzilla 262 and 275.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-22 14:29:20 -04:00
Linus Torvalds e9b62693ae Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/juhl/trivial
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/juhl/trivial: (24 commits)
  DOC:  A couple corrections and clarifications in USB doc.
  Generate a slightly more informative error msg for bad HZ
  fix typo "is" -> "if" in Makefile
  ext*: spelling fix prefered -> preferred
  DOCUMENTATION:  Use newer DEFINE_SPINLOCK macro in docs.
  KEYS:  Fix the comment to match the file name in rxrpc-type.h.
  RAID: remove trailing space from printk line
  DMA engine: typo fixes
  Remove unused MAX_NODES_SHIFT
  MAINTAINERS: Clarify access to OCFS2 development mailing list.
  V4L: Storage class should be before const qualifier (sn9c102)
  V4L: Storage class should be before const qualifier
  sonypi: Storage class should be before const qualifier
  intel_menlow: Storage class should be before const qualifier
  DVB: Storage class should be before const qualifier
  arm: Storage class should be before const qualifier
  ALSA: Storage class should be before const qualifier
  acpi: Storage class should be before const qualifier
  firmware_sample_driver.c: fix coding style
  MAINTAINERS: Add ati_remote2 driver
  ...

Fixed up trivial conflicts in firmware_sample_driver.c
2008-04-21 16:36:46 -07:00
Tobias Klauser b299c22c8c acpi: Storage class should be before const qualifier
The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the
beginning of the declaration specifiers in a declaration is an
obsolescent feature.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
2008-04-21 22:24:53 +00:00
Mike Travis f70316dace generic: use new set_cpus_allowed_ptr function
* Use new set_cpus_allowed_ptr() function added by previous patch,
    which instead of passing the "newly allowed cpus" cpumask_t arg
    by value,  pass it by pointer:

    -int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
    +int set_cpus_allowed_ptr(struct task_struct *p, const cpumask_t *new_mask)

  * Modify CPU_MASK_ALL

Depends on:
	[sched-devel]: sched: add new set_cpus_allowed_ptr function

Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-19 19:44:58 +02:00
Matthew Wilcox f1241c87a1 Add down_timeout and change ACPI to use it
ACPI currently emulates a timeout for semaphores with calls to
down_trylock and sleep.  This produces horrible behaviour in terms of
fairness and excessive wakeups.  Now that we have a unified semaphore
implementation, adding a real down_trylock is almost trivial.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
2008-04-17 10:42:46 -04:00
Chuck Ebbert f0a37e0087 acpi: bus: check once more for an empty list after locking it
List could have become empty after the unlocked check that was made earlier,
so check again inside the lock.

Should fix https://bugzilla.redhat.com/show_bug.cgi?id=427765

Signed-off-by: Chuck Ebbert <cebbert@redhat.com>
Cc: <stable@kernel.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>
2008-04-15 19:35:41 -07:00
Zhao Yakui 729b2bdbfa ACPI : Disable the device's ability to wake the sleeping system in the boot phase
In some machines some GPE is shared by several ACPI devices, for example:
sleep button, keyboard, mouse. At the same time one of them is
non-wake(runtime) device and the other are wake devices. In such case OSPM
should call the _PSW object to disable the device's ability to
wake the sleeping system in the boot phase.
Otherwise there will be ACPI interrupt flood triggered by the GPE input.

The _PSW object is depreciated in ACPI 3.0 and is replaced by _DSW.
So it is necessary to call _DSW object first. Only when it is not
present will the _PSW object used.

http://bugzilla.kernel.org/show_bug.cgi?id=10224

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Zhang Rui  <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-09 21:57:22 -04:00
Alok Kataria ba62b07787 acpi: fix "buggy BIOS check" when CPUs are hot removed
Fixes a BUG in ACPI hotplugging.

processor_device_array[pr->id] needs to be set to NULL when removing a CPU.
Else the "buggy BIOS check" in acpi_processor_start mistakenly fires when a
CPU is removed from the system and then later re-added.

Signed-off-by: Alok N Kataria <akataria@vmware.com>
Signed-off-by: Dan Arai <arai@vmware.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>
2008-04-08 18:25:53 -07:00
Krzysztof Helt bb070e4349 acpi thermal: fix result check
thermal_zone_device_register() uses the ERR_PTR macro on its return values.  A
correct check is to use the IS_ERR() macro.

The 2.6.25 kernels panic on Compaq AP550 without this patch as it has more
then 10 (THERMAL_MAX_TRIPS) trip points (there are 12).

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Len Brown <lenb@kernel.org>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-08 18:25:52 -07:00
Linus Torvalds 797de7bdb2 Revert "ACPI: Ignore _BQC object when registering backlight device"
This reverts commit 7c0ea45be4 which
caused a regression with the backlight being set to off when a laptop
doesn't have a _BQC entry to query the actual backlight value.  The code
blindly then falls back on a value of 0.

See
	http://bugzilla.kernel.org/show_bug.cgi?id=10387
	http://lkml.org/lkml/2008/4/2/366

for details.

Bisected-and-reported-by: Andrey Borzenkov <arvidjaar@mail.ru>
Cc: Zhao Yakui <yakui.zhao@intel.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Len Brown <len.brown@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-05 12:14:13 -07:00
Rafael J. Wysocki 7731ce63d9 ACPI PM: Restore the 2.6.24 suspend ordering
Some time ago it turned out that our suspend code ordering broke some
NVidia-based systems that hung if _PTS was executed with one of the PCI
devices, specifically a USB controller, in a low power state.

Then, it was noticed that the suspend code ordering was not compliant
with ACPI 1.0, although it was compliant with ACPI 2.0 (and later), and
it was argued that the code had to be changed for that reason (ref.
http://bugzilla.kernel.org/show_bug.cgi?id=9528).

So we did, but evidently we did wrong, because it's now turning out that
some systems have been broken by this change. Refs:
	http://bugzilla.kernel.org/show_bug.cgi?id=10340
	https://bugzilla.novell.com/show_bug.cgi?id=374217#c16

[ I said at that time that something like this might happend, but the
  majority of people involved thought that it was improbable due to the
  necessity to preserve the compliance of hardware with ACPI 1.0. ]

This actually is a quite serious regression from 2.6.24.

Moreover, the ACPI 1.0 ordering of suspend code introduced another issue
that I have only noticed recently.  Namely, if the suspend of one of
devices fails, the already suspended devices will be resumed without
executing _WAK before, which leads to problems on some systems (for
example, in such situations thermal management is broken on my HP
nx6325).  Consequently, it also breaks suspend debugging on the affected
systems.

Note also, that the requirement to execute _PTS before suspending
devices does not really make sense, because the device in question may
be put into a low power state at run time for a reason unrelated to a
system-wide suspend.

For the reasons outlined above, the change of the suspend ordering
should be reverted, which is done by the patch below.

[ Felix Möller: "I am the reporter from the original Novell Bug:

	https://bugzilla.novell.com/show_bug.cgi?id=374217

  I just tried current git head (two hours ago) with the patch (the one
  from the beginning of this thread) from Rafael and without it.  With
  the patch my MacBook does suspend without it does not." ]

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Tested-by: Felix Möller <felix@derklecks.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-01 11:21:08 -07:00
Ingo Molnar 48d3d8263c revert "ACPI: drivers/acpi: elide a non-zero test on a result that is never 0"
Revert commit 1192aeb957 ("ACPI:
drivers/acpi: elide a non-zero test on a result that is never 0")
because it turns out that thermal_cooling_device_register() does
actually return NULL if CONFIG_THERMAL is turned off (then the routine
turns into a dummy inline routine in the header files that returns NULL
unconditionally).

This was found with randconfig testing, causing a crash during bootup:

  initcall 0x78878534 ran for 13 msecs: acpi_button_init+0x0/0x51()
  Calling initcall 0x78878585: acpi_fan_init+0x0/0x2c()
  BUG: unable to handle kernel NULL pointer dereference at 00000000
  IP: [<782b8ad0>] acpi_fan_add+0x7d/0xfd
  *pde = 00000000
  Oops: 0000 [#1]
  Modules linked in:

  Pid: 1, comm: swapper Not tainted (2.6.25-rc7-sched-devel.git-x86-latest.git #14)
  EIP: 0060:[<782b8ad0>] EFLAGS: 00010246 CPU: 0
  EIP is at acpi_fan_add+0x7d/0xfd
  EAX: b787c718 EBX: b787c400 ECX: b782ceb4 EDX: 00000007
  ESI: 00000000 EDI: b787c6f4 EBP: b782cee0 ESP: b782cecc
   DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068
  Process swapper (pid: 1, ti=b782c000 task=b7846000 task.ti=b782c000)
  Stack: b787c459 00000000 b787c400 78790888 b787c60c b782cef8 782b6fb8 ffffffda
         b787c60c 00000000 78790958 b782cf0c 783005d7 b787c60c 78790958 78790584
         b782cf1c 783007f6 b782cf28 00000000 b782cf40 782ffc4a 78790958 b794d558
  Call Trace:
   [<782b6fb8>] ? acpi_device_probe+0x3e/0xdb
   [<783005d7>] ? driver_probe_device+0x82/0xfc
   [<783007f6>] ? __driver_attach+0x3a/0x70
   [<782ffc4a>] ? bus_for_each_dev+0x3e/0x60
   [<7830048c>] ? driver_attach+0x14/0x16
   [<783007bc>] ? __driver_attach+0x0/0x70
   [<7830006a>] ? bus_add_driver+0x9d/0x1b0
   [<783008c3>] ? driver_register+0x47/0xa3
   [<7813db00>] ? timespec_to_ktime+0x9/0xc
   [<782b7331>] ? acpi_bus_register_driver+0x3a/0x3c
   [<78878592>] ? acpi_fan_init+0xd/0x2c
   [<78863656>] ? kernel_init+0xac/0x1f9
   [<788635aa>] ? kernel_init+0x0/0x1f9
   [<78114563>] ? kernel_thread_helper+0x7/0x10
   =======================
  Code: 6e 78 e8 57 44 e7 ff 58 e9 93 00 00 00 8b 55 f0 8d bb f4 02 00 00 80 4b 2d 10 8b 03 e8 87 cb ff ff 8d 83 18 03 00 00 80 63 2d ef <ff> 35 00 00 00 00 50 68 e8 9c 6e 78 e8 22 44 e7 ff b9 b6 9c 6e
  EIP: [<782b8ad0>] acpi_fan_add+0x7d/0xfd SS:ESP 0068:b782cecc
  ---[ end trace 778e504de7e3b1e3 ]---
  Kernel panic - not syncing: Attempted to kill init!

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-03-28 10:16:53 -07:00
Julia Lawall 1192aeb957 ACPI: drivers/acpi: elide a non-zero test on a result that is never 0
The function thermal_cooling_device_register always returns either a valid
pointer or a value made with ERR_PTR, so a test for non-zero on the result
will always succeed.

The problem was found using the following semantic match.
(http://www.emn.fr/x-info/coccinelle/)

//<smpl>
@a@
expression E, E1;
statement S,S1;
position p;
@@

E = thermal_cooling_device_register(...)
... when != E = E1
if@p (E) S else S1

@n@
position a.p;
expression E,E1;
statement S,S1;
@@

E = NULL
... when != E = E1
if@p (E) S else S1

@depends on !n@
expression E;
statement S,S1;
position a.p;
@@

* if@p (E)
  S else S1
//</smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-27 01:48:22 -04:00
Len Brown 86d9fc1293 Merge branches 'release', 'idle', 'redhat-bugzilla-436589', 'sbs' and 'video' into release 2008-03-26 22:50:09 -04:00
Venki Pallipadi 8e92b6605d cpuidle: fix 100% C0 statistics regression
commit 9b12e18cdc
'ACPI: cpuidle: Support C1 idle time accounting'
was implicated in a 100% C0 idle regression.
http://bugzilla.kernel.org/show_bug.cgi?id=10076

It pointed out a potential problem where the menu governor
may get confused by the C-state residency time from poll
idle or C1 idle, where this timing info is not accurate.
This inaccuracy is due to interrupts being handled
before we account for C-state exit.

Do not mark TIME_VALID for CO poll state.
Mark C1 time as valid only with the MWAIT (CSTATE_FFH) entry method.

This makes governors use the timing information only when it is correct and
eliminates any wrong policy decisions that may result from invalid timing
information.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-26 00:58:19 -04:00
Venki Pallipadi 996520c1fd ACPI: fix mis-merge -- invoke acpi_unlazy_tlb() only on C3 entry
This original patch
http://ussg.iu.edu/hypermail/linux/kernel/0712.2/1451.html
was intending to add acpi_unlazy_tlb() to acpi_idle_enter_bm(),
which is used for C3 entry.

But it was merged incorrectly as commmit

bde6f5f59c
'x86: voluntary leave_mm before entering ACPI C3'

so the call was instead added to acpi_idle_enter_simple()
(which is C2 entry routine), probably due to identical
context in that function.

Move the call back to acpi_idle_enter_bm().

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-26 00:40:41 -04:00
Zhang Rui 5c9fcb5dee ACPI: fix a regression of ACPI device driver autoloading
commit 3620f2f2f3 sets the cid of
ACPI video/dock/bay device and leaves the hid empty.
As a result, "modalias" should export the cid for
devices which don't have a hid.

ACPI Video driver is not autoloaded with
commit 3620f2f2f3 applied.
"cat /sys/.../device:03(acpi video bus)/modalias" shows nothing.

ACPI Video driver is autoloaded after revert that commit.
"cat /sys/.../LNXVIDEO:0x/modalias" shows "acpi:LNXVIDEO:"

ACPI Video driver is autoloaded with commit
3620f2f2f3 and this patch applied.
"cat /sys/.../device:03(acpi video bus)/modalias"
shows "acpi:LNXVIDEO:"

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-25 22:48:37 -04:00
Bjorn Helgaas b97d480340 ACPI: fix Medion _PRT quirk (use "ISA_", not "ISA")
This fixes the builtin RTL8139 NIC on the Medion MD9580-F laptop.  The
BIOS reports the interrupt routing incorrectly.  I recently added a
quirk to work around this, and this patch fixes a typo in the quirk.

We pad every ACPI pathname component to four characters, so ".ISA." will
never match anything.  We need ".ISA_." instead.

Thank you Johann-Nikolaus Andreae <johann-nikolaus.andreae@nacs.de>
for patiently testing this patch.

See http://bugzilla.kernel.org/show_bug.cgi?id=4773

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-03-25 15:21:30 -07:00
Alexey Starikovskiy ce52ddf58c ACPI: EC: Don't delete boot EC
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-24 20:52:04 -04:00
Alexey Starikovskiy 6d9e112063 ACPI: EC: Use default setup handler
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-24 20:51:29 -04:00
Alexey Starikovskiy fa95ba04e6 ACPI: EC: Detect irq storm
Problem seems to be that hw fails to clear GPE after we service it and write 1
into corresponding bit. Thus, as soon as we get interrupts enabled again, we
receive a new one. Google gives too many results for "acer interrupt storm" for
this being one-broken-machine case.

Reference: http://bugzilla.kernel.org/show_bug.cgi?id=9998

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-24 20:50:59 -04:00
Alexey Starikovskiy 223883b7aa ACPI: EC: Switch off GPE mode during suspend/resume
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-24 20:50:36 -04:00
Alexey Starikovskiy b77d81b267 ACPI: EC: Replace broken controller workarounds with poll mode.
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-24 20:49:48 -04:00
Alexey Starikovskiy dc0e8490fe ACPI: EC: Improve debug output
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-24 20:48:46 -04:00
Alexey Starikovskiy 845625cdcb ACPI: EC: Add poll timer
If we can not use interrupt mode of EC for some reason, start polling
EC for events periodically.

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-24 20:48:10 -04:00
Alexey Starikovskiy e6e82a3087 ACPI: EC: Restore udelay in poll mode
This fixes keyboard event handling on some systems.

Note that this delay was thought unnecessary, and removed
from linux-2.6.20 with 50c1e1138c
'ACPI: ec: Drop udelay() from poll mode. Loop by reading status field instead.'

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-24 20:47:35 -04:00
Alexey Starikovskiy d7a0e1f564 Revert "ACPI: EC: Handle IRQ storm on Acer laptops"
This reverts commit 2c81ce4c9c.

It caused several new troubles (eg suspend slowdown bisected down to
this patch by Pavel Machek), so just revert it for now.

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Cc: Pavel Machek <pavel@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-03-18 21:32:24 -07:00
Len Brown 13d93924f1 Merge branches 'release' and 'dock' into release 2008-03-18 05:17:15 -04:00
Holger Macht 9171f83488 ACPI: Set flag DOCK_UNDOCKING when triggered via sysfs
begin_undock() is only called when triggered via a acpi notify handler
(pressing the undock button on the dock station), but complete_undock() is
always called after the eject. So if a undock is triggered through a sysfs
write, the flag DOCK_UNDOCKING has to be set for the dock station,
too. Otherwise this will freeze the system hard.

Signed-off-by: Holger Macht <hmacht@suse.de>
Acked-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-18 05:16:38 -04:00
Alexey Starikovskiy 7642d21130 ACPI: SBS: remove typo from sbchc.c
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-18 05:13:14 -04:00
Len Brown d9ea1364d3 Merge branches 'release', 'asus', 'bugzilla-8573', 'bugzilla-9995', 'bugzilla-10272', 'lockdep' and 'thermal' into release 2008-03-18 04:52:57 -04:00
Len Brown 77321e624b Revert "ACPI: video: Ignore devices that aren't present in hardware"
This reverts commit 0119509c4f.

http://bugzilla.kernel.org/show_bug.cgi?id=9995

Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-18 04:04:35 -04:00
Julia Lawall abc5a87f4e asus_acpi: remove misleading mask
led_out is boolean, so there is no functional change here,
but apparently an extra mask with 1 caused some style checkers
to flag this as logic bug.

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Luca Tettamanti <kronos.it@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-18 02:31:34 -04:00
Len Brown f0d6752c9f Revert "ACPI: video: Ignore ACPI video devices that aren't present in hardware"
This reverts commit 3fa2cdcc45.

http://bugzilla.kernel.org/show_bug.cgi?id=9995

Signed-off-by: Len Brown <len.brown>
2008-03-18 01:43:53 -04:00
Alexey Starikovskiy b8a1bdb149 ACPI: battery: Don't return -EFAIL on broken packages.
Acer BIOS has a bug which is exposed when a dead battery is present.

The package template that is used to describe battery status is
over-written with sane values when the battery is live.
But when the batter is dead, a bogus reference in the template
is used.  In this case, Linux returns a fault, when instead
it should simply return that it doesn't know the missing value.

http://bugzilla.kernel.org/show_bug.cgi?id=8573
http://bugzilla.kernel.org/show_bug.cgi?id=10202

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-17 22:37:42 -04:00
Linus Torvalds 9a9e0d6855 ACPI: Remove ACPI_CUSTOM_DSDT_INITRD option
This essentially reverts commit 71fc47a9ad
("ACPI: basic initramfs DSDT override support"), because the code simply
isn't ready.

It did ugly things to the init sequence to populate the rootfs image
early, but that just ended up showing other problems with the whole
approach.  The fact is, the VFS layer simply isn't initialized this
early, and the relevant ACPI code should either run much later, or this
shouldn't be done at all.

For 2.6.25, we'll just pick the latter option.  We can revisit this
concept later if necessary.

Cc: Dave Hansen <haveblue@us.ibm.com>
Cc: Tilman Schmidt <tilman@imap.cc>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Thomas Renninger <trenn@suse.de>
Cc: Eric Piel <eric.piel@tremplin-utc.net>
Cc: Len Brown <len.brown@intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Markus Gaugusch <dsdt@gaugusch.at>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-03-15 11:58:04 -07:00
Venki Pallipadi 71e93d1561 ACPI: lockdep warning on boot, 2.6.25-rc5
This avoids the harmless WARNING by lockdep in acpi_processor_idle().

The reason for WARNING is because at the depth of idle handling code,
some of the idle handlers disable interrupts, some times, while returning from
the idle handler. After return, acpi_processor_idle and few other routines
in the file did an unconditional local_irq_enable(). With LOCKDEP, enabling
irq when it is already enabled generates the below WARNING.

> > [    0.593038] ------------[ cut here ]------------
> > [    0.593267] WARNING: at kernel/lockdep.c:2035 trace_hardirqs_on+0xa0/0x115()
> > [    0.593596] Modules linked in:
> > [    0.593756] Pid: 0, comm: swapper Not tainted 2.6.25-rc5 #8
> > [    0.594017]
> > [    0.594017] Call Trace:
> > [    0.594216]  [<ffffffff80231663>] warn_on_slowpath+0x58/0x6b
> > [    0.594495]  [<ffffffff80495966>] ? _spin_unlock_irqrestore+0x38/0x47
> > [    0.594809]  [<ffffffff80329a86>] ? acpi_os_release_lock+0x9/0xb
> > [    0.595103]  [<ffffffff80337840>] ? acpi_set_register+0x161/0x173
> > [    0.595401]  [<ffffffff8034c8d4>] ? acpi_processor_idle+0x1de/0x546
> > [    0.595706]  [<ffffffff8020a23b>] ? default_idle+0x0/0x73
> > [    0.595970]  [<ffffffff8024fc0e>] trace_hardirqs_on+0xa0/0x115
> > [    0.596049]  [<ffffffff8034c6f6>] ? acpi_processor_idle+0x0/0x546
> > [    0.596346]  [<ffffffff8034c8d4>] acpi_processor_idle+0x1de/0x546
> > [    0.596642]  [<ffffffff8020a23b>] ? default_idle+0x0/0x73
> > [    0.596912]  [<ffffffff8034c6f6>] ? acpi_processor_idle+0x0/0x546
> > [    0.597209]  [<ffffffff8020a23b>] ? default_idle+0x0/0x73
> > [    0.597472]  [<ffffffff8020a355>] cpu_idle+0xa7/0xd1
> > [    0.597717]  [<ffffffff80485fa1>] rest_init+0x55/0x57
> > [    0.597957]  [<ffffffff8062fb49>] start_kernel+0x29d/0x2a8
> > [    0.598215]  [<ffffffff8062f1da>] _sinittext+0x1da/0x1e1
> > [    0.598464]
> > [    0.598546] ---[ end trace 778e504de7e3b1e3 ]---

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-14 00:05:48 -04:00
Len Brown b4de123a0b Merge branches 'release', 'ejd', 'sony' and 'wmi' into release 2008-03-13 01:59:52 -04:00
Len Brown c523aef0f7 Merge branches 'release', 'button-sysfs', 'misc', 'mismatch', 'randconfig' and 'toshiba' into release 2008-03-13 01:59:49 -04:00
Len Brown 160ff06b18 Merge branches 'release' and 'thermal' into release 2008-03-13 01:59:46 -04:00
Len Brown 1ca721cdb7 Merge branches 'release', 'bugzilla-8570', 'bugzilla-9966', 'bugzilla-9998', 'bugzilla-10100', 'bugzilla-10132', 'bugzilla-10138' and 'bugzilla-10206' into release 2008-03-13 01:59:45 -04:00
Zhang, Rui 5e012760df ACPI: thermal: show temperature in millidegree Celsius
as now required by the generic thermal I/F

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-13 01:49:11 -04:00
Johann Felix Soden c8dc9de109 ACPI: buffer array too short in drivers/acpi/system.c
Since "ff_gbl_lock" has a length of 11 chars and is copied with sprintf
to char buffer[10], there is a problem. We need char buffer[12] because
of the closing zero byte.

Signed-off-by: Johann Felix Soden <johfel@users.sourceforge.net>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-12 17:57:22 -04:00
Thomas Renninger b6a1638759 ACPICA: Warn if packages with invalid references are evaluated
And return an error to avoid NULL pointer access by the caller
Lin Ming's patch avoids corrupted mem access when
BIOS has invalid references included, the handle is now zero
instead of corrupted.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-11 23:57:20 -04:00
Bjorn Helgaas 391df5dce3 ACPI: add _PRT quirks to work around broken firmware
This patch works around incorrect _PRT (PCI interrupt routing)
information from firmware.  This does not fix any regressions
and can wait for the next kernel release.

On the Medion MD9580-F laptop, the BIOS says the builtin RTL8139
NIC interrupt at 00:09.0[A] is connected to \_SB.PCI0.ISA.LNKA, but
it's really connected to \_SB.PCI0.ISA.LNKB.  Before this patch,
the workaround was to use "pci=routeirq".  More details at
http://bugzilla.kernel.org/show_bug.cgi?id=4773.

On the Dell OptiPlex GX1, the BIOS says the PCI slot interrupt
00:0d[A] is connected to LNKB, but it's really connected to LNKA.
Before this patch, the workaround was to use "pci=routeirq".
Pierre Ossman tested a previous version of this patch and confirmed
that it fixed the problem.  More details at
http://bugzilla.kernel.org/show_bug.cgi?id=5044.

On the HP t5710 thin client, the BIOS says the builtin Radeon
video interrupt at 01:00[A] is connected to LNK1, but it's really
connected to LNK3.  The previous workaround was to use a custom
DSDT.  I tested this patch and verified that it fixes the problem.
More details at http://bugzilla.kernel.org/show_bug.cgi?id=10138.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-11 23:41:08 -04:00
Zhao Yakui 7c0ea45be4 ACPI: Ignore _BQC object when registering backlight device
According to acpi spec , the objects of  _BCL and _BCM are required if
integrated LCD is present and supports brightness level .The _BQC is
the optional object. So the _BQC object is ignored when the backlight device
is registered in ACPI video driver.

http://bugzilla.kernel.org/show_bug.cgi?id=10206

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Zhang Rui  <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-11 22:20:19 -04:00
Carlos Corbacho a527f2d7fe ACPI: WMI: Clean up handling of spec violating data blocks
Acer violate the ACPI-WMI spec by declaring some of their data blocks as
expensive, but with no corresponding WCxx method. There is already some
workaround code in to handle the initial WCxx call (we just ignore a
failure here); but we need to properly check if the second, "clean up",
WCxx call is actually needed or not, rather than fail simply because it
isn't there.

Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-11 17:59:05 -04:00
Glauber Costa d6f882e104 ACPI: use ACPI_DEBUG_PRINT instead of printk in acpi_processor_hotplug_notify()
For consistency, use ACPI_DEBUG_PRINT instead of printk in
acpi_processor_hotplug_notify() for BUS_CHECK and DEVICE_CHECK events

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-11 13:40:43 -04:00
Andrey Borzenkov 3b34e5232f ACPI: button: make real parent for input devices in device tree
Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-11 13:38:49 -04:00
arvidjaar@mail.ru 4db42c51ce toshiba_acpi: Enable autoloading
This adds aliases to enable autoloading of toishiba_acpi.  Two aliases are
defined - TOS6200 (for \\_SB_.VALD.GHCI) and TSO1900 (for \\_SB_.VALZ.GHCI).
This allows toishiba_acpi to be autoloaded on systems that provide those
devices.

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
Cc: Olivier Blin <blino@mandriva.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-11 13:35:08 -04:00
Alexey Starikovskiy 2c81ce4c9c ACPI: EC: Handle IRQ storm on Acer laptops
On some Acer systems, the HW fails to clear the GPE source,
causing an interrupt storm.

So in EC interrupt mode, we count how many interrupts we
receive when waiting.  If we get more than 5, we give
up on interrupt mode and revert to polling mode.

Also, for polling mode to work on Acers, we need
to insert a delay.

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-11 13:30:00 -04:00
Harvey Harrison 96b2dd1f1f ACPI: replace remaining __FUNCTION__ occurrences
__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-11 01:58:41 -04:00
Jean Delvare bd12935f04 ACPI: Fix a duplicate log level
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-11 00:52:19 -04:00
Len Brown 4af8e10a6c Revert "ACPI: EC: Use proper handle for boot EC"
This reverts commit 208c70a456.

http://bugzilla.kernel.org/show_bug.cgi?id=10100

Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-11 00:27:16 -04:00
Lin Ming c8d16e27a3 ACPI: fix boot oops regression in thermal
Fix a memory overflow bug when copying
NULL internal package element object to external.

http://bugzilla.kernel.org/show_bug.cgi?id=10132

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-11 00:15:19 -04:00
Zhang Rui d0ce46f550 ACPI Exception (): AE_NOT_FOUND, Processor Device is not present (update)
update cfaf3747ff
ACPI: ACPI Exception (): AE_NOT_FOUND, Processor Device is not present

is_processor_present is only called in the processor hotplug case,
and _STA method is mandatory at this time.

We should ignore those processors that are disabled in the MADT
and don't have _STA methods.
Because they will never exist in this system.
For the processors that don't physically exist but can be
hot plugged later, we still need this debug info.

http://bugzilla.kernel.org/show_bug.cgi?id=8570

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-23 01:53:09 -05:00
David Brownell 1071695f17 ACPI: crosslink ACPI and "real" device nodes
Add cross-links between ACPI device and "real" devices in sysfs,
exposing otherwise-hidden interrelationships between the various
device nodes for ACPI stuff.  As a representative example, one
hardware device is exposed as two logical devices (PNP and ACPI):

  .../pnp0/00:06/
  .../LNXSYSTM:00/device:00/PNP0A03:00/device:15/PNP0B00:00/

The PNP device gets a "firmware_node" link pointing to the ACPI device,
and is what a Linux device driver binds to.  The ACPI device has instead
a "physical_node" link pointing back to the PNP device.  Other firmware
frameworks, like OpenFirmware, could do the same thing to couple their
firmware tables to the rest of the system.

(Based on a patch from Zhang Rui.  This version is modified to not
depend on the patch makig ACPI initialize driver model wakeup flags.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-23 01:32:56 -05:00
Randy Dunlap 7ce9573e09 ACPI: prevent randconfig build failure on empty ACPI_CUSTOM_DSDT_FILE
Make ACPI_CUSTOM_DSDT boolean config symbol a hidden and derived
value, based on the value of ACPI_CUSTOM_DSDT_FILE (string).
Only the latter is presented to the user as a config option.

This fixes problems with "make randconfig" setting ACPI_CUSTOM_DSDT
but leaving ACPI_CUSTOM_DSDT_FILE empty/blank.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-23 00:15:11 -05:00
Holger Macht 3b5fee5952 ACPI: Do not pass NULL to acpi_get_handle() when looking for _EJD
When trying to get the acpi_handle from an acpi_buffer, pass
ACPI_ROOT_OBJECT instead of NULL to acpi_get_handle(). This fixes the
detection of dock dependent bays.

Signed-off-by: Holger Macht <hmacht@suse.de>
Tested-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-21 07:25:47 -05:00
Sam Ravnborg b5678a3476 ACPI: fix section mismatch in acpi_pci_root_add
Fix following warning:
WARNING: vmlinux.o(.text+0x550e85): Section mismatch in reference from the function acpi_pci_root_add() to the function .devinit.text:pci_acpi_scan_root()

acpi_pci_root_add uses a __devinit annotated function and
it looks like annotating it __devinit too is the correct fix.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-21 02:56:32 -05:00
Sam Ravnborg b95e9e8d94 ACPI: fix section mismatch in processor_core.c:acpi_processor_hotplug_notify
Fix following warning:
WARNING: vmlinux.o(.text+0x55586c): Section mismatch in reference from the function acpi_processor_hotplug_notify() to the function .cpuinit.text:acpi_processor_start()

acpi_processor_hotplug_notify() may safely reference __cpuinit
stuff as it ids defined inside an ACPI_HOTPLUG_CPU block.
So annotate it __ref to silence the warning.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-21 02:55:26 -05:00
Len Brown 1f1519ef59 Merge branches 'release', 'bugzilla-9916', 'bugzilla-9982', 'bugzilla-9989', 'misc', 'suspend', 'thermal', 'thinkpad' and 'tsc' into release 2008-02-21 02:41:58 -05:00
Ming Lin 1186974f3f ACPI: fix build warning
CC      drivers/acpi/executer/exregion.o
drivers/acpi/executer/exregion.c: In function
‘acpi_ex_pci_config_space_handler’:
drivers/acpi/executer/exregion.c:369: attention : passing argument 3 of
‘acpi_os_read_pci_configuration’ from incompatible pointer type

exposed by 10270d4838

http://bugzilla.kernel.org/show_bug.cgi?id=9989

Signed-off-by: Ming Lin <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-21 02:01:30 -05:00
Pavel Machek 6133116849 ACPI: TSC breaks atkbd suspend
TSC is used even on machines when CONFIG_X86_TSC is not set (X86_TSC
means _require_ TSC), but it is not properly disabled when it is
unusable, because ACPI code understood the config switch as "may use
TSC".

This actually fixes suspend problems on my x60.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-19 20:05:06 -05:00
Glauber Costa e85ff4b53e ACPI: remove is_processor_present prototype
The function itself is defined just below, so this prototype is not really
useful.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-16 01:01:13 -05:00
Harvey Harrison 4fd7f5188c ACPI: sparse fix, replace macro with static function
replace acpi_util_eval_error macro with static function.

Avoid these sparse warnings due to using buffer within the macro.
drivers/acpi/utils.c:273:3: warning: symbol 'buffer' shadows an earlier one
drivers/acpi/utils.c:259:21: originally declared here
drivers/acpi/utils.c:279:3: warning: symbol 'buffer' shadows an earlier one
drivers/acpi/utils.c:259:21: originally declared here
drivers/acpi/utils.c:368:3: warning: symbol 'buffer' shadows an earlier one
drivers/acpi/utils.c:348:21: originally declared here
drivers/acpi/utils.c:375:3: warning: symbol 'buffer' shadows an earlier one
drivers/acpi/utils.c:348:21: originally declared here
drivers/acpi/utils.c:382:3: warning: symbol 'buffer' shadows an earlier one
drivers/acpi/utils.c:348:21: originally declared here
drivers/acpi/utils.c:402:4: warning: symbol 'buffer' shadows an earlier one
drivers/acpi/utils.c:348:21: originally declared here

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-16 00:40:28 -05:00
Thomas Sujith 43ff39f2f6 ACPI video: check for error from thermal_cooling_device_register
Need to check whether thermal_cooling_device_register
returned ERROR or not.

Signed-off-by: Thomas Sujith <sujith.thomas@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-15 18:29:18 -05:00
Thomas Sujith d76628c67c ACPI thermal: extract return values using PTR_ERR
Need to extract errors using PTR_ERR macro and
process accordingly.thermal_cooling_device_register
returning NULL means that CONFIG_THERMAL=n and in that
case no need to create symbolic links.

Signed-off-by: Thomas Sujith <sujith.thomas@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-15 18:26:54 -05:00
Zhao Yakui f28bb45e28 ACPI: thermal: Check whether cooling device exists before unregistering
OS should check whether the cooling device exists before it is unregistered.
If it doesn't exists, it is unnecessary to remove the sysfs link
and call the function of thermal_cooling_device_unregister.

http://bugzilla.kernel.org/show_bug.cgi?id=9982

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Tested-by    : Dhaval Giani <dhaval@linux.vnet.ibm.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-15 18:23:50 -05:00
Thomas Sujith 19b36780ee ACPI fan: extract return values using PTR_ERR
Need to extract errors using PTR_ERR macro and
process accordingly.  thermal_cooling_device_register
returning NULL means that CONFIG_THERMAL=n and in that
case no need to create symbolic links.

Signed-off-by: Thomas Sujith <sujith.thomas@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-15 18:21:30 -05:00
Alexey Starikovskiy 208c70a456 ACPI: EC: Use proper handle for boot EC
Fall back to ACPI_ROOT_HANDLE only in case of error.

ACPI: EC: EC description table is found, configuring boot EC
ACPI Error (evregion-0316): No handler for Region [ECOR] (ffff81007a651620) [EmbeddedControl] [20070126]
ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no handler [20070126]

http://bugzilla.kernel.org/show_bug.cgi?id=9916

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-14 15:58:47 -05:00