Commit Graph

901 Commits (60262e58e305f27d05eefeda172117521514f364)

Author SHA1 Message Date
Len Brown 40d07080e5 Revert "Execute AML Notify() requests on stack."
This reverts commit 5f7748cf91.

While that change fixed the HP
http://bugzilla.kernel.org/show_bug.cgi?id=5534

it broke the ACER:
http://bugzilla.kernel.org/show_bug.cgi?id=8385
which as AML that caused Linux go recursive
and stack fault.

So this commit by itself will restore the ACER
and again break the HP, which we'll fix another way.

Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-09 22:59:38 -04:00
Len Brown 4d2acd9ea5 Revert "ACPICA: revert "acpi_serialize" changes"
This reverts commit a8f4af6dc6.
Thus restoring ACPICA's new acpi_serialize code.

This commit by itself may cause a regression, but
it is reverted in this order so that subsequent
reverts reverts under this one can be made
without conflict.

Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-09 22:56:38 -04:00
Luming Yu 23b0f015bf ACPI: video: output switch sysfs support
Requires CONFIG_VIDEO_OUTPUT_CONTROL and CONFIG_ACPI_VIDEO.

After loading output.ko and video.ko, you would have
/sys/class/video_output and several device acpi_videoNum there.

For example, I got acpi_video0, acpi_video1,acpi_video2,and acpi_video3
under /sys/class/video_output on my T40.
I can query the status of  output device0 by running " cat
/sys/class/video_output/acpi_video0
" The return value is defined in ACPI SPEC B.5.5 _DCS(Return the
Status of Output Device).  Also you can turn off video1 and turn on
video0  by " echo 0 > acpi_video1; echo 0x80000000 > acpi_video0".
Please reference ACPI SPEC  B.5.7 _DSS for the parameter definition.

Please note that it may or may NOT works purely depending on if
your vendor providing correct ACPI video extension support in bios.
the driver output.ko and video.ko just works like a interface to
invoke BIOS.

Signed-off-by: Luming Yu <Luming.yu@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-09 22:44:38 -04:00
Rafael J. Wysocki a3d25c275d PM: Separate hibernation code from suspend code
[ With Johannes Berg <johannes@sipsolutions.net> ]

Separate the hibernation (aka suspend to disk code) from the other suspend
code.  In particular:

 * Remove the definitions related to hibernation from include/linux/pm.h
 * Introduce struct hibernation_ops and a new hibernate() function to hibernate
   the system, defined in include/linux/suspend.h
 * Separate suspend code in kernel/power/main.c from hibernation-related code
   in kernel/power/disk.c and kernel/power/user.c (with the help of
   hibernation_ops)
 * Switch ACPI (the only user of pm_ops.pm_disk_mode) to hibernation_ops

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Greg KH <greg@kroah.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Nigel Cunningham <nigel@nigel.suspend2.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-09 12:30:48 -07:00
Yasunori Goto 7e81ab9d3d Fix unnecesary meminit
This is to fix unnecessary __meminit definition.  These are exported for
kernel modules.

I compiled on ia64/x86-64 with memory hotplug on/off.

Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-08 20:41:14 -07:00
David Brownell 19bfe37caa workaround rtc-related acpi table bugs
This works around a bug seen in some RTC-related ACPI table entries, and
tweaks related diagnostics to follow the ACPI convention.

The bug prevents misleading boot-time messages: platforms affected by this
bug wrongly report they can support alarms up to one year in the future,
when in fact the longest alarm is just 24 hours.  That will surprise anyone
trying to use those extended alarms.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
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-08 11:15:18 -07:00
David Brownell f5f72b46c3 ACPI wakeup hooks for rtc-cmos
Remove /proc/acpi/alarm file when the rtc-cmos "wakealarm" file is available.
Instead, provide hooks that rtc-cmos will use.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
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-08 11:15:18 -07:00
David Brownell 55955aad7c PNPACPI sets pnpdev->dev.archdata
Teach PNPACPI how to hook up its devices to their ACPI nodes, so that
pnpdev->dev.archdata points to the parallel acpi device node.  Previously
this only worked for PCI, leaving a notable hole.

Export "acpi_bus_type" so this can work.

Remove some extraneous whitespace.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-08 11:15:08 -07:00
Randy Dunlap e63340ae6b header cleaning: don't include smp_lock.h when not used
Remove includes of <linux/smp_lock.h> where it is not used/needed.
Suggested by Al Viro.

Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc,
sparc64, and arm (all 59 defconfigs).

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-08 11:15:07 -07:00
Yasunori Goto a3142c8e1d Fix section mismatch of memory hotplug related code.
This is to fix many section mismatches of code related to memory hotplug.
I checked compile with memory hotplug on/off on ia64 and x86-64 box.

Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-08 11:14:57 -07:00
Johannes Berg ab3bfca7ab remove software_suspend()
Remove software_suspend() and all its users since
pm_suspend(PM_SUSPEND_DISK) should be equivalent and there's no point in
having two interfaces for the same thing.

The patch also changes the valid_state function to return 0 (false) for
PM_SUSPEND_DISK when SOFTWARE_SUSPEND is not configured instead of
accepting it and having the whole thing fail later.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-07 12:12:59 -07:00
Linus Torvalds ea62ccd00f Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6
* 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6: (231 commits)
  [PATCH] i386: Don't delete cpu_devs data to identify different x86 types in late_initcall
  [PATCH] i386: type may be unused
  [PATCH] i386: Some additional chipset register values validation.
  [PATCH] i386: Add missing !X86_PAE dependincy to the 2G/2G split.
  [PATCH] x86-64: Don't exclude asm-offsets.c in Documentation/dontdiff
  [PATCH] i386: avoid redundant preempt_disable in __unlazy_fpu
  [PATCH] i386: white space fixes in i387.h
  [PATCH] i386: Drop noisy e820 debugging printks
  [PATCH] x86-64: Fix allnoconfig error in genapic_flat.c
  [PATCH] x86-64: Shut up warnings for vfat compat ioctls on other file systems
  [PATCH] x86-64: Share identical video.S between i386 and x86-64
  [PATCH] x86-64: Remove CONFIG_REORDER
  [PATCH] x86-64: Print type and size correctly for unknown compat ioctls
  [PATCH] i386: Remove copy_*_user BUG_ONs for (size < 0)
  [PATCH] i386: Little cleanups in smpboot.c
  [PATCH] x86-64: Don't enable NUMA for a single node in K8 NUMA scanning
  [PATCH] x86: Use RDTSCP for synchronous get_cycles if possible
  [PATCH] i386: Add X86_FEATURE_RDTSCP
  [PATCH] i386: Implement X86_FEATURE_SYNC_RDTSC on i386
  [PATCH] i386: Implement alternative_io for i386
  ...

Fix up trivial conflict in include/linux/highmem.h manually.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-05 14:55:20 -07:00
Linus Torvalds ded1504dfa Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
* master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq:
  [CPUFREQ] Report the number of processors in PowerNow-k8 correctly
  [CPUFREQ] do not declare undefined functions
  [CPUFREQ] cleanup kconfig options
  [CPUFREQ] Longhaul - Revert Longhaul ver. 2
  [CPUFREQ] Remove deprecated /proc/acpi/processor/performance write support
  [CPUFREQ] Fix limited cpufreq when booted on battery
  Fix preemption warnings in speedstep-centrino.c
  [CPUFREQ] Longhaul - Correct PCI code
  [CPUFREQ] p4-clockmod: switch to rdmsr_on_cpu/wrmsr_on_cpu
2007-05-04 17:38:48 -07:00
john stultz 5a90cf205c [PATCH] x86: Log reason why TSC was marked unstable
Change mark_tsc_unstable() so it takes a string argument, which holds the
reason the TSC was marked unstable.

This is then displayed the first time mark_tsc_unstable is called.

This should help us better debug why the TSC was marked unstable on certain
systems and allow us to make sure we're not being overly paranoid when
throwing out this troublesome clocksource.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andi Kleen <ak@suse.de>
2007-05-02 19:27:08 +02:00
Len Brown eaca2d3f6c ACPI: delete un-reliable concept of cooling mode
The scheme where the thermal driver displayed the
cooling mode /proc/acpi/thermal_zone/*/cooling_mode
was flawed in two ways.

First, the success of _SCP doesn't actually mean
that the BIOS moved any trip points.
On many BIOS, _SCP is present, but does nothing.
So displaying what _SCP executed actually
was wrong more times than it was right.

Second, examining the relative position of the
trip points when the thermal_zone is added
is insufficient -- as the BIOS reserves the right
to change the trip points at run-time.

The only reliable way for the user to determine if
the thermal zone is in active, passive, or critical
mode is to examine the relative position of the trip points.
The user can do this without the kernel doing it
for them by looking in /proc/acpi/thermal_zone/*/trip_points

New contents for /proc/acpi/thermal_zone/*/cooling_mode:

If _SCP available:
"0 - Active; 1 - Passive\n"

If _SCP unavailable:
"<setting not supported>\n"

Signed-off-by: Len Brown <len.brown@intel.com>
2007-04-30 23:27:43 -04:00
Len Brown 11ccc0f249 ACPI: thermal trip points are read-only
/proc/acpi/thermal_zone/*/trip_points displays
what the kernel reads from the BIOS via ACPI.

If you echo a string of ':' deliminted numbers to this file
then it will change what it displays.

But it shouldn't, since the kernel has no way to communicate
these changes to ACPI thermal zones.  ACPI thermal zone
trip points are read-only.

The kernel does have the opportunity to ask the BIOS to change
the trip points with _SCP - Set Cooling Policy.

Request Active Cooling Mode:
# echo 0 > /proc/acpi/thermal_zone/*/cooling_policy

Request Passive Cooling Mode:
# echo 1 > /proc/acpi/thermal_zone/*/cooling_policy

However, in practice it is quite rare for the BIOS
to support the optional _SCP, and it is even more rare
for the BIOS to export an _SCP that actually changes
the trip points.

Signed-off-by: Len Brown <len.brown@intel.com>
2007-04-30 22:36:01 -04:00
Johannes Berg e8c9c50269 power management: implement pm_ops.valid for everybody
Almost all users of pm_ops only support mem sleep, don't check in .valid and
don't reject any others in .prepare so users can be confused if they check
/sys/power/state, especially when new states are added (these would then
result in s-t-r although they're supposed to be something different).

This patch implements a generic pm_valid_only_mem function that is then
exported for users and puts it to use in almost all existing pm_ops.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: David Brownell <david-b@pacbell.net>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: linux-pm@lists.linux-foundation.org
Cc: Len Brown <lenb@kernel.org>
Acked-by: Russell King <rmk@arm.linux.org.uk>
Cc: Greg KH <greg@kroah.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-04-30 16:40:40 -07:00
Len Brown aac60c1113 Pull bugzilla-8346 into release branch 2007-04-28 23:19:25 -04:00
Len Brown 12a5a71212 Pull sbs into release branch 2007-04-28 23:16:59 -04:00
Len Brown 14d2178588 Pull dock into release branch 2007-04-28 23:13:03 -04:00
Len Brown 03feb05246 Pull ec into release branch 2007-04-28 23:12:56 -04:00
Len Brown fb16596997 Pull misc-for-upstream into release branch 2007-04-28 23:12:03 -04:00
Len Brown f188291aec Pull thinkpad into release branch
Conflicts:

	drivers/misc/Kconfig

Signed-off-by: Len Brown <len.brown@intel.com>
2007-04-28 23:11:19 -04:00
Bob Moore 79fff27002 ACPICA: clear fields reserved before FADT r3
Linux-2.6.21 stopped booting on a P4/HT because Linux
wrote the FADT.CST_CNT value to the SMI_CMD.
Apparently this stumbled over some SMM instability,
such as confusing SMM when invoking it from cpu1.

Linux did this because even though the r2 FADT reserves
the CST_CNT field, this BIOS set that field and Linux
used it.

Turns out that up through 2.6.20 we explicitly cleared
cst_control for r2 FADTs.  So here we go back to doing that,
plus also clear some additional fields that are reserved
until FADT r3.

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

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-04-28 20:55:06 -04:00
Thomas Renninger 632786ce9f [CPUFREQ] Remove deprecated /proc/acpi/processor/performance write support
Remove deprecated /proc/acpi/processor/performance write support

Writing to /proc/acpi/processor/xy/performance interferes with sysfs
cpufreq interface. Also removes buggy cpufreq_set_policy exported symbol.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Dave Jones <davej@redhat.com>
2007-04-26 14:32:02 -04:00
David Brownell 8aa55591bf ACPI: make /proc/acpi/wakeup more useful
This updates /proc/acpi/wakeup to be more informative, primarily by showing
the sysfs node associated with each wakeup-enabled device.  Example:

	Device	S-state	  Status   Sysfs node
	PCI0	  S4	 disabled  no-bus:pci0000:00
	PS2M	  S4	 disabled  pnp:00:05
	PS2K	  S4	 disabled  pnp:00:06
	UAR1	  S4	 disabled  pnp:00:08
	USB1	  S3	 disabled  pci:0000:00:03.0
	USB2	  S3	 disabled  pci:0000:00:03.1
	USB3	  S3	 disabled
	USB4	  S3	 disabled  pci:0000:00:03.3
	S139	  S4	 disabled
	LAN	  S4	 disabled  pci:0000:00:04.0
	MDM	  S4	 disabled
	AUD	  S4	 disabled  pci:0000:00:02.7
	SLPB	  S4	*enabled

Eventually this file should be removed, but until then it's almost the only
way we have to tell how the relevant ACPI tables are broken (and cope).  In
that example, two devices don't actually exist (USB3, S139), one can't issue
wakeup events (PCI0), and two seem harmlessly (?) confused (MDM and AUD are
the same PCI device, but it's the _modem_ that does wake-on-ring).

In particular, we need to be sure driver model nodes are properly hooked
up before we can get rid of this ACPI-only interface for wakeup events.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-04-25 15:20:10 -04:00
Borislav Petkov cf6c6045a0 ACPI: word-smith kconfig help
Signed-off-by: <bbpetkov@yahoo.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-04-25 14:29:50 -04:00
Bjorn Helgaas 0c0e892101 ACPI: use _STA bit names rather than 0x0F
Be explicit about what "device->status = 0x0F" really means.

syntax only.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-04-25 14:20:58 -04:00
Bjorn Helgaas a0bd4ac498 ACPI: Remove duplicate definitions for _STA bits
No need to duplicate the existing definitions in include/acpi/actypes.h.

syntax only -- no functional change.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-04-25 14:17:39 -04:00
Ray Lee d8938801d1 ACPI: remove duplicate include
Thomas's patch for including <asm/apic.h> for x86 UP builds came into
Linus's tree from two different directions, both of which were merged.
This reverts the latter, yanking out the duplicate #include and comment.

Signed-off-by: Ray Lee <ray-lk@madrabbit.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-04-25 14:12:00 -04:00
Andrew Morton 94e22e13ad acpi-thermal: fix mod_timer() interval
Use relative time, not absolute.  Discovered by Jung-Ik (John) Lee
<jilee@google.com>.

Cc: Jung-Ik (John) Lee <jilee@google.com>
Acked-by: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-04-24 08:23:08 -07:00
Vladimir Lebedev 6eedeef73e process reading battery status hangs
http://bugzilla.kernel.org/show_bug.cgi?id=8351

Signed-off-by: Vladimir Lebedev <vladimir.p.lebedev@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-04-21 22:41:48 -04:00
Len Brown 4e381a4f06 Revert "ACPI: parse 2nd MADT by default"
This reverts commit 09fe58356d.
http://bugzilla.kernel.org/show_bug.cgi?id=8283

Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-30 14:16:10 -04:00
Randy Dunlap 62a6d7fd9b ACPI: dock: use NULL for pointer
Use NULL instead of 0 for pointers:
drivers/acpi/dock.c:677:75: warning: Using plain integer as NULL pointer

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-28 23:31:43 -04:00
Henrique de Moraes Holschuh 3ede41c718 ACPI: ibm-acpi: move driver to drivers/misc hierarchy
ibm-acpi is not an ACPICA driver, so move it to drivers/misc as per Len
Brown's request.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-25 23:37:55 -04:00
Henrique de Moraes Holschuh a62bc916cf ACPI: ibm-acpi: update copyright notice
Update copyright and license info on the source code comments.  No
functional changes.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-25 23:37:54 -04:00
Henrique de Moraes Holschuh 56b6aeb058 ACPI: ibm-acpi: organize code
Shuffle code around to better organize the driver code inside the
ibm-acpi.c file.

This patch adds no functional changes.  It is pure fluff that will make me
a bit more productive.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-25 23:37:54 -04:00
Henrique de Moraes Holschuh 1406cdd176 ACPI: ibm-acpi: add header file
Add a (private) header file for ibm-acpi, and move type definitions and
ThinkPad driver constants to the new header file.

This patch has no functional changes.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-25 23:37:54 -04:00
Henrique de Moraes Holschuh e062e03438 ACPI: ibm-acpi: rename some identifiers
Rename some identifiers so that they are more in tune with the rest of the
driver code, or less generic.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-25 23:37:54 -04:00
Henrique de Moraes Holschuh 837ca6ddb4 ACPI: ibm-acpi: kill trailing whitespace
I shall protect the ibm-acpi city against the invasion of the barbarian
blanks!  To the unforgiving jaws of sed s/[[:blank:]]\+$// they go!

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-25 23:37:54 -04:00
Thomas Gleixner e585bef815 [PATCH] i386: add command line option "local_apic_timer_c2_ok"
It turned out that it is almost impossible to trust ACPI, BIOS & Co.
regarding the C states. This was the reason to switch the local apic
timer off in C2 state already. OTOH there are sane and well behaving
systems, which get punished by that decision.

Allow the user to confirm that the local apic timer is trustworthy in C2
state. This keeps the default behaviour on the safe side.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-03-23 10:21:02 -07:00
Linus Torvalds 296d93cd02 Revert "ACPI: Only use IPI on known broken machines (AMD, Dothan/BaniasPentium M)"
This reverts commit 25496caec1, which
broke bootup on at least Ingo's ThinkPad T60.  Need to figure out
exactly what is wrong before we can re-do the logic.

Requested-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Thomas Renninger <trenn@suse.de>
Cc: Len Brown <len.brown@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-03-23 08:03:47 -07:00
Len Brown 439a888885 ACPI: sbs: remove i2c_ec.[ch]
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-22 01:21:05 -04:00
Vladimir Lebedev 722062334b ACPI: sbs: Common interface with CM battery
The SBS driver has tne features as CM battery:
SBS update_time variable has tne same definition as CM battery 'update_time' variable.

Signed-off-by: Vladimir Lebedev <vladimir.p.lebedev@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-22 01:15:58 -04:00
Vladimir Lebedev 6845118b3b ACPI: sbs: Debug messages correction/improvement
Debug messages correction/improvement:
Use ACPI_EXCEPTION instead of ACPI_DEBUG_PRINT.

Signed-off-by: Vladimir Lebedev <vladimir.p.lebedev@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-22 01:15:58 -04:00
Vladimir Lebedev 84cb559872 ACPI: sbs: remove I2C Makefile hooks
SBS does not depend on I2C.
i2c_ec.h and i2c_ec.c are not needed

Signed-off-by: Vladimir Lebedev <vladimir.p.lebedev@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-22 01:15:58 -04:00
Vladimir Lebedev b4150fc4ae ACPI: sbs: remove I2C Kconfig dependency
SBS does not depend on I2C.

Signed-off-by: Vladimir Lebedev <vladimir.p.lebedev@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-22 01:15:57 -04:00
Vladimir Lebedev 6d15702cc0 ACPI: sbs: use EC rather than I2C
SBS is based on EC function(ec_read/ec_write).
Not needed using of I2C structures/functions ... is removed.
SBS does not depend on I2C now.

Signed-off-by: Vladimir Lebedev <vladimir.p.lebedev@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-22 01:15:57 -04:00
Len Brown cddece4bec Pull c2 into release branch 2007-03-20 11:06:37 -04:00
Len Brown b25e84425e Pull bugzilla-7465 into release branch 2007-03-20 11:06:18 -04:00
Len Brown f5ea908c8f Pull bugzilla-8171 into release branch 2007-03-20 11:06:00 -04:00
Len Brown 54b8c39fbd Pull misc-for-upstream into release branch 2007-03-20 11:05:41 -04:00
Thomas Renninger 25496caec1 ACPI: Only use IPI on known broken machines (AMD, Dothan/BaniasPentium M)
Use IPI for blacklisted CPUs, add parameter IPI vs LAPIC

Currently, Linux disables lapic timer for all machines with C2 and higher
C-state support.

According to Intel only specific Intel models (Banias/Dothan) are broken
in respect of not waking up from C2 with lapic.

However, I am not sure about the naming of the parameter and how it
could/should get integrated into the dyntick part
(CONFIG_GENERIC_CLOCKEVENTS). There, a more fine grained check (TSC
still running?, ..) is needed? Does this make sense (always use
CLOCK_EVT_NOTIFY_BROADCAST_ON, but use OFF if forced by use_ipi=0:
clockevents_notify(use_ipi ? CLOCK_EVT_NOTIFY_BROADCAST_ON :
CLOCK_EVT_NOTIFY_BROADCAST_OFF, &pr->id);

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-17 00:50:46 -04:00
Henrique de Moraes Holschuh 96e89afe6d ACPI: ibm-acpi: allow module to load when acpi notifiers can't be set (v2)
This patch allows for ibm-acpi to coexist (with diminished functionality) with
other drivers like ACPI_BAY.  ibm-acpi will simply disable the functions it is
not able to register ACPI notifiers for.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Chris Wedgwood <cw@f00f.org>
Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-16 01:07:18 -04:00
Len Brown 09fe58356d ACPI: parse 2nd MADT by default
http://bugzilla.kernel.org/show_bug.cgi?id=7465

Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-15 04:22:18 -04:00
Len Brown a8f4af6dc6 ACPICA: revert "acpi_serialize" changes
This reverts 977a6226fe
and reverts 1ba753acb3
and updates acpi_ev_queue_notify_request()
to restore the previous implementation of the
"acpi_serialize" workaround.

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

Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-15 04:10:36 -04:00
Al Viro 89952d133d [PATCH] misc NULL noise
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-03-14 15:27:49 -07:00
Alexey Starikovskiy 1d99967bad ACPI: resolve HP nx6125 S3 immediate wakeup regression
Moving disable GPEs from enter_sleep up into sleep_prepare fixed
the disabled SCI on S4 on Acer laptops.

However, it caused an immediate S3 resume on the HP nx6125.
Apparently, on the HP, a GPE was getting re-enabled after
the prepare, but before the enter.

Close that window by restoring the GPE disable on enter.
This is redundant in most cases, but closes this window,
where S3 and S4 paths differ.

Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Acked-by: Ray Lee <ray-lk@madrabbit.org>
2007-03-12 14:49:26 -04:00
Len Brown a1fdcc0d27 ACPI: Add support to parse 2nd MADT
When a BIOS bug presents multiple APIC/MADTs,
Linux currently uses the 1st and ignores the 2nd.

But some machines work better if we use the 2nd.

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

Add a warning and boot parameter "acpi_apic_instance=2"
to allow parsing the 2nd.

No change to default behaviour in this patch.

Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-11 03:30:13 -04:00
Alexey Starikovskiy 9fd9f8e8bd ACPI: EC: Block queries until EC is fully initialized
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-09 23:27:29 -05:00
Alexey Starikovskiy 01f2246269 ACPI: EC: Cleanup of EC initialization
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-09 23:27:29 -05:00
Alexey Starikovskiy d033879c98 ACPI: EC: first_ec is better to be acpi_ec than acpi_device.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-09 23:27:28 -05:00
Alexey Starikovskiy d66d969df8 ACPI: EC: Rename ec_ecdt to more informative boot_ec
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-09 23:27:28 -05:00
Alexey Starikovskiy c0900c3512 ACPI: EC: Clean ECDT and namespace parsing.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-09 23:27:28 -05:00
Alexey Starikovskiy e828432104 ACPI: EC: Put install handlers into separate function.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-09 23:27:28 -05:00
Alexey Starikovskiy 3d02b90be2 ACPI: EC: Remove casts to/from void* from ec.c
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-09 23:27:28 -05:00
Alexey Starikovskiy c45aac43fe ACPI: EC: enable burst functionality in EC.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-09 23:27:28 -05:00
Alexey Starikovskiy 33c7a0738c ACPI: EC: "Fake ECDT" workaround is not needed any longer.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-09 23:27:28 -05:00
Alexey Starikovskiy 33d20b6100 ACPI: EC: Make EC to initialize first in ACPI
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-09 23:27:28 -05:00
Alexey Starikovskiy a5f8dee2d3 ACPI: EC: Don't use Global Lock if not asked to do so
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-09 23:27:27 -05:00
Len Brown 63e34ca93a Pull misc-for-upstream into release branch 2007-03-09 23:19:50 -05:00
Len Brown 51e7fff1c2 Pull bugzilla-8110 into release branch 2007-03-09 23:19:25 -05:00
Len Brown bdf3aaf951 Pull bugzilla-8066 into release branch 2007-03-09 23:19:19 -05:00
Len Brown cb2ebc59ff Pull bugzilla-7570 into release branch 2007-03-09 23:18:46 -05:00
Len Brown 3dfb737998 Pull bugzilla-6859 into release branch 2007-03-09 23:18:35 -05:00
Len Brown 5cb69bcace Pull ibm into release branch 2007-03-09 23:17:46 -05:00
Alexey Starikovskiy 9e19721960 ACPI: ec: fix race in status register access
Delay the read of the EC status register until
after the event that caused it occurs -- otherwise
it is possible to read and act on stale status that was
associated with the previous event.

Do this with a perpetually incrementing "event_count" to detect
when a new event occurs and it is safe to read status.

There is no workaround for polling mode -- it is inherently
exposed to reading and acting on stale status, since it
doesn't have an interrupt to tell it the event completed.

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

Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-09 23:16:23 -05:00
Robert P. J. Day 9327f46ee2 ACPI: Kconfig: hide ACPI menu when CONFIG_PM=n
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-09 22:18:04 -05:00
Ilya A. Volynets-Evenbakh ac122bb64b ACPI: dock: add access to ACPI docking station UID
It is useful to know whether your laptop is docked or not,
but it is even more useful to know which docking station it's
docked to. Attached patch adds "uid" file to sysfs.
Tested on Dell Latitude D600 with D/Dock.
Patch is against official 2.6.20 release.

Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-09 21:40:23 -05:00
Julius Volz 98fb8fe10f ACPI: video: Fix spelling and grammar mistakes
Correct some of the most obvious spelling and grammar
mistakes in drivers/acpi/video.c (comments and printk output).

Signed-off-by: Julius Volz <juliusrv@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-09 21:37:07 -05:00
Anthony Godshall, Ampro Computers, Inc 5b27b176da ACPI: make blacklist more verbose
IMHO, ACPI disabled due to DMI failure or blacklisted year should be noted,
as is done with other ACPI blacklisting.

This will help people troubleshoot when ACPI isn't working.  Status quo is
a mysterious "ACPI Disabled" message without explanation on BIOS that
implements ACPI but not DMI.  This is actually fairly common on embedded
x86 boards.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-09 21:19:05 -05:00
Henrique de Moraes Holschuh c9bf296b64 ACPI: ibm-acpi: improve backlight power handling
Improve the backlight code to emulate as much as possible the power
management events, as we are unable to really power on or power off the
backlight.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Acked-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-08 20:24:57 -05:00
Shaohua Li 2f894ef9c8 ACPI: fix boot hang w/o "noapic" on MSI MS-6390-L
This is a workaround to handle a BIOS bug where the
programmer exchanged the name and index fields of
a _PRT entry.  Apparently this BIOS error does not
confuse Windows and thus it lurks in the field
on various machines.

boot with "acpi=strict" to disable this workaround

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

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-08 03:42:42 -05:00
Konstantin Karasyov ff24ba74b6 ACPI: ThinkPad Z60m: usb mouse stops working after suspend to RAM
(http://www.mail-archive.com/linux-acpi@vger.kernel.org/msg05270.html):

References : http://lkml.org/lkml/2007/2/21/413
             http://lkml.org/lkml/2007/2/28/172
Submitter  : Arkadiusz Miskiewicz <arekm@maven.pl>
Caused-By  : Konstantin Karasyov <konstantin.a.karasyov@intel.com>
             commit 0a6139027f

Do not disable power resources on resume even if there are no devices referencing it.

Signed-off-by: Konstantin Karasyov <konstantin.a.karasyov@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-07 03:50:11 -05:00
Vladimir Lebedev 9ea7d57576 ACPI: battery: Lindent
Signed-off-by: Vladimir Lebedev <vladimir.p.lebedev@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-07 01:48:11 -05:00
Vladimir Lebedev b6ce4083ed ACPI: Cache battery status instead of re-evaluating AML
/proc exports _BST in a single file, and _BST is re-evaulated
whenever that file is read.

Sometimes user-space reads this file frequently, and on some
systems _BST takes a long time to evaluate due to a slow EC.

Further, when we move to sysfs, the values returned from _BST
will be in multiple files, and evaluating _BST for each
file read would make matters worse.

Here code is added to support caching the results of _BST.
A new module parameter "update_time" tells how many seconds the
cached _BST should be used before it is re-evaluated.
Currently, update_time defaults to 0, and so the
existing behaviour of re-evaluating on each read retained.

Signed-off-by: Vladimir Lebedev <vladimir.p.lebedev@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-07 01:48:07 -05:00
Vladimir Lebedev a1f0eff21e ACPI: battery: make internal names consistent with battery "state"
Cleanup -- No functional changes.

Battery state is currently exported in a proc "state" file.
Update associated #defines and routines to be consistent.

Signed-off-by: Vladimir Lebedev <vladimir.p.lebedev@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-07 01:48:03 -05:00
Alexey Starikovskiy 610a3d0696 ACPICA: Fix ACPI Global Lock re-entrancy
patch "Delete recursive feature of ACPI Global Lock"
broke re-entrancy of the Global Lock.
The common routine to acquire GL is acpi_ev_acquire_global_lock,
so check for re-entrancy _must_ be there, and not anywhere else.

http://bugzilla.kernel.org/show_bug.cgi?id=8066#c9

Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-07 00:57:30 -05:00
Kristen Carlson Accardi b1a316f6f9 [PATCH] ACPI: make bay depend on dock
Since the bay driver depends on the dock driver for proper notification,
make this driver depend on the dock driver.

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Acked-by: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-03-01 14:53:38 -08:00
Henrique de Moraes Holschuh 2bc808a8c4 ACPI: ibm-acpi: make ibm-acpi bay support optional
Make ibm-acpi bay support optional at kernel compile time.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2007-02-22 16:09:25 -02:00
Henrique de Moraes Holschuh adb005818b ACPI: ibm-acpi: fix initial status of backlight device
The brightness class core does not update the initial status of the
device's brightness at register time.  Do it by ourselves.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Acked-by: Richard Purdie <rpurdie@rpsys.net>
2007-02-22 16:09:25 -02:00
Konstantin Karasyov 7292576043 ACPI: fix S3 fan resume issue
http://bugzilla.kernel.org/show_bug.cgi?id=7570#c14

Signed-off-by: Konstantin Karasyov <konstantin.a.karasyov@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-21 02:05:58 -05:00
Richard Purdie 599a52d126 backlight: Separate backlight properties from backlight ops pointers
Per device data such as brightness belongs to the indivdual device
and should therefore be separate from the the backlight operation
function pointers. This patch splits the two types of data and
allows simplifcation of some code.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
2007-02-20 09:26:53 +00:00
Richard Purdie dfcba20067 backlight: Remove unneeded owner field
Remove uneeded owner field from backlight_properties structure.

Nothing uses it and it is unlikely that it will ever be used. The
backlight class uses other means to ensure that nothing references
unloaded code.

Based on a patch from Dmitry Torokhov <dtor@insightbb.com>

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
2007-02-20 08:37:40 +00:00
Len Brown 255f0385c8 Pull bugzilla-7897 into release branch 2007-02-16 22:12:04 -05:00
Len Brown 902b236c08 Pull bugzilla-7887 into release branch 2007-02-16 22:11:57 -05:00
Len Brown 08e4a10ec8 Pull bugzilla-7570 into release branch 2007-02-16 22:11:50 -05:00
Len Brown 4559b43822 Pull bugzilla-7200 into release branch 2007-02-16 22:11:37 -05:00
Len Brown 1004879f25 Pull bugzilla-7122 into release branch 2007-02-16 22:11:31 -05:00
Len Brown f0e5ed7f32 Pull bugzilla-5534 into release branch 2007-02-16 22:11:21 -05:00
Len Brown 8800c0ebf5 Pull remove-hotkey into release branch 2007-02-16 22:11:02 -05:00
Len Brown c0cd79d114 Pull fluff into release branch
Conflicts:

	arch/x86_64/pci/mmconfig.c
	drivers/acpi/bay.c

Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-16 22:10:32 -05:00
Len Brown 5ee6edbcde ACPI: hotkey: remove driver, per feature-removal-schedule.txt
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-16 21:45:57 -05:00
Len Brown 81450b73dd Pull misc-for-upstream into release branch
Conflicts:

	drivers/usb/misc/appledisplay.c

Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-16 18:52:41 -05:00
Henrique de Moraes Holschuh 0539771d72 ACPI: bay: use IS_ERR for return of register_platform_device_simple
register_platform_device_simple returns ERR_PTR(foo), so test it with
IS_ERR(foo).

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-16 18:35:23 -05:00
John Keller ecb5f7521a ACPI: acpi_unload_table_id() always returns error
acpi_unload_table_id() is always returning an error status.
Also, once the matching table is found, don't bother looking
for another match.

Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-16 18:34:40 -05:00
Alexey Starikovskiy c24e912b61 ACPI: ec: add unlock in error path
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-16 12:51:53 -05:00
Thomas Gleixner e9e2cdb412 [PATCH] clockevents: i386 drivers
Add clockevent drivers for i386: lapic (local) and PIT/HPET (global).  Update
the timer IRQ to call into the PIT/HPET driver's event handler and the
lapic-timer IRQ to call into the lapic clockevent driver.  The assignement of
timer functionality is delegated to the core framework code and replaces the
compile and runtime evalution in do_timer_interrupt_hook()

Use the clockevents broadcast support and implement the lapic_broadcast
function for ACPI.

No changes to existing functionality.

[ kdump fix from Vivek Goyal <vgoyal@in.ibm.com> ]
[ fixes based on review feedback from Arjan van de Ven <arjan@infradead.org> ]
Cleanups-from: Adrian Bunk <bunk@stusta.de>
Build-fixes-from: Andrew Morton <akpm@osdl.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-16 08:13:59 -08:00
Thomas Gleixner 169a0abbe3 [PATCH] ACPI keep track of timer broadcasting
This is a preperatory patch for highres/dyntick:

- replace the big #ifdef ARCH_APICTIMER_STOPS_ON_C3 hackery by functions

- remove the double switch in the power verify function (in the worst case
  we switched ipi to apic and 20usec later apic to ipi)

- keep track of the the state which stops local APIC timer

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Len Brown <len.brown@intel.com>
Cc: <linux-acpi@vger.kernel.org>
Cc: Andi Kleen <ak@suse.de>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-16 08:13:58 -08:00
Thomas Gleixner 3434933b17 [PATCH] ACPI: fix missing include for UP
apic.h does not get included on UP compiles.  That way the
APICTIMER_STOPS_ON_C3 is not there and UP boxen have no support for timer
broadcasting.  This was never noticed, because the lapic timer is only used
for profiling on UP.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-16 08:13:58 -08:00
Konstantin Karasyov b1028c545c ACPI: fix fan after resume from S3
http://bugzilla.kernel.org/show_bug.cgi?id=7570

Signed-off-by: Konstantin Karasyov <konstantin.a.karasyov@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-16 02:23:07 -05:00
Len Brown e8363f3327 ACPI: update acpi_power_resume() per new acpi_op_resume
drivers/acpi/power.c:69: warning: initialization from incompatible pointer type

Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-16 02:05:39 -05:00
Konstantin Karasyov 0a6139027f ACPI: Thermal issues on HP nx6325
The previous reference counting scheme to enable power resources
got confused when multiple devices were present that might
repeatedly enable or disable the resource and throw off the count.

The new code simply lists the referencing devices which
are requesting the resource to be enabled.  When there are none,
then it is off.

Signed-off-by: Konstantin Karasyov <konstantin.a.karasyov@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-16 01:47:06 -05:00
Sanjoy Mahajan 636cedf9df ACPI: thermal: fix units in debug output
http://bugzilla.kernel.org/show_bug.cgi?id=4972

Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-16 01:24:43 -05:00
Thomas Gleixner 5c95d3f578 ACPI: include apic.h in processor driver for benefit of UP kernels
apic.h does not get included on UP compiles.  That way the
APICTIMER_STOPS_ON_C3 is not there and UP boxen have no support for timer
broadcasting.  This was never noticed, because the lapic timer is only used
for profiling on UP.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-15 23:27:13 -05:00
Len Brown 8d4956c201 ACPI: remove non-PNPACPI version of get_rtc_dev()
It isn't needed in ACPI code anymore because
now ACPI always includes PNPACPI.

Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-15 22:46:42 -05:00
Len Brown 243b66e76a ACPI: always enable CONFIG_PNPACPI on CONFIG_ACPI kernels
We removed the ACPI motherboard driver which handled
the ACPI=y, PNP=n case, so now we need to enforce that
PNP & PNPACPI are always enabled for ACPI kernels.

Most major distros ship this way this already.

Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-15 22:38:04 -05:00
Len Brown fc955f670c ACPI: remove acpi_os_readable(), acpi_os_writable()
...which are now unused

Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-15 22:19:17 -05:00
Randy Dunlap 70c0846e43 ACPI: Fix sparse warnings
Use NULL for pointers

drivers/acpi/osl.c:208:10: warning: Using plain integer as NULL pointer
drivers/acpi/tables/tbxface.c:411:49: warning: Using plain integer as NULL pointer
drivers/acpi/processor_core.c:1008:10: warning: Using plain integer as NULL pointer

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-15 22:19:07 -05:00
Alexey Starikovskiy 5f7748cf91 Execute AML Notify() requests on stack.
HP nx6125/nx6325/... machines have a _GPE handler with an infinite
loop sending Notify() events to different ACPI subsystems.

The notify handler in the ACPI thermal driver is a C-routine,
which may invoke the ACPI interpreter again to get access
to some ACPI variables such as temperature.  (acpi_evaluate_xxx)
On these HP machines such an evaluation changes state of an ASL 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 explosion in memory consumption.

Also as GPE handling is blocked, machines overheat because ACPI-based
fan control is stalled.  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 this failure,  Linux must not send notify events to the
kacpid workqueue -- either executing them immediately or putting them
on some other thread.

The 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-based kernel shipped with Ubuntu 6.06 LTS.

Second attempt was done by Alexey Starikovskiy, who 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 2.6.18-rc2.

Alexey 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 this broke Linus' machine
also and was reverted from 2.6.19-rc with much fanfair.

The 4th patch 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).  Then a 5th attempt did a
yield() to every GPE execution.

Finally, this 6th generation patch simply executes the notify handler
on the stack.  Previous attempts to do this simple solution failed
because of issues in AML mutex re-entrancy which are now fixed
by the previous patch in this series.

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

Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-15 16:13:51 -05:00
Alexey Starikovskiy c0d127b569 ACPICA: fix AML mutex re-entrancy
ACPI AML supports "serialized" methods which are protected
by an implicit mutex.  The mutex is re-entrant for that AML thread
to allow recursion.

However, Linux implements notify() by creating a new AML thread.
So for systems where notify() re-enters a serialized method,
deadlock results.

The fix is to use the Linux thread_id as the key to allowing
re-entrancy, not the AML thread pointer.

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

Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-15 16:13:16 -05:00
Linus Torvalds 414f827c46 Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6
* 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6: (94 commits)
  [PATCH] x86-64: Remove mk_pte_phys()
  [PATCH] i386: Fix broken CONFIG_COMPAT_VDSO on i386
  [PATCH] i386: fix 32-bit ioctls on x64_32
  [PATCH] x86: Unify pcspeaker platform device code between i386/x86-64
  [PATCH] i386: Remove extern declaration from mm/discontig.c, put in header.
  [PATCH] i386: Rename cpu_gdt_descr and remove extern declaration from smpboot.c
  [PATCH] i386: Move mce_disabled to asm/mce.h
  [PATCH] i386: paravirt unhandled fallthrough
  [PATCH] x86_64: Wire up compat epoll_pwait
  [PATCH] x86: Don't require the vDSO for handling a.out signals
  [PATCH] i386: Fix Cyrix MediaGX detection
  [PATCH] i386: Fix warning in cpu initialization
  [PATCH] i386: Fix warning in microcode.c
  [PATCH] x86: Enable NMI watchdog for AMD Family 0x10 CPUs
  [PATCH] x86: Add new CPUID bits for AMD Family 10 CPUs in /proc/cpuinfo
  [PATCH] i386: Remove fastcall in paravirt.[ch]
  [PATCH] x86-64: Fix wrong gcc check in bitops.h
  [PATCH] x86-64: survive having no irq mapping for a vector
  [PATCH] i386: geode configuration fixes
  [PATCH] i386: add option to show more code in oops reports
  ...
2007-02-14 09:46:06 -08:00
Tim Schmielau cd354f1ae7 [PATCH] remove many unneeded #includes of sched.h
After Al Viro (finally) succeeded in removing the sched.h #include in module.h
recently, it makes sense again to remove other superfluous sched.h includes.
There are quite a lot of files which include it but don't actually need
anything defined in there.  Presumably these includes were once needed for
macros that used to live in sched.h, but moved to other header files in the
course of cleaning it up.

To ease the pain, this time I did not fiddle with any header files and only
removed #includes from .c-files, which tend to cause less trouble.

Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
configs in arch/arm/configs on arm.  I also checked that no new warnings were
introduced by the patch (actually, some warnings are removed that were emitted
by unnecessarily included header files).

Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-14 08:09:54 -08:00
Jean Delvare 12a917f69d i2c: Declare more i2c_adapter parent devices
Declare the parent device of i2c_adapter devices each time we can
easily do so. It makes the i2c_adapter appear at the right place in
the device tree, rather than as a platform device.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Len Brown <len.brown@intel.com>
Cc: Jordan Crouse <jordan.crouse@amd.com>
Cc: Jody McIntyre <scjody@modernduck.com>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: v4l-dvb-maintainer@linuxtv.org
Cc: Petr Vandrovec <vandrove@vc.cvut.cz>
2007-02-13 22:09:03 +01:00
Ingo Molnar 5d0e600d90 [PATCH] x86: fix laptop bootup hang in init_acpi()
During kernel bootup, a new T60 laptop (CoreDuo, 32-bit) hangs about
10%-20% of the time in acpi_init():

 Calling initcall 0xc055ce1a: topology_init+0x0/0x2f()
 Calling initcall 0xc055d75e: mtrr_init_finialize+0x0/0x2c()
 Calling initcall 0xc05664f3: param_sysfs_init+0x0/0x175()
 Calling initcall 0xc014cb65: pm_sysrq_init+0x0/0x17()
 Calling initcall 0xc0569f99: init_bio+0x0/0xf4()
 Calling initcall 0xc056b865: genhd_device_init+0x0/0x50()
 Calling initcall 0xc056c4bd: fbmem_init+0x0/0x87()
 Calling initcall 0xc056dd74: acpi_init+0x0/0x1ee()

It's a hard hang that not even an NMI could punch through!  Frustratingly,
adding printks or function tracing to the ACPI code made the hangs go away
...

After some time an additional detail emerged: disabling the NMI watchdog
made these occasional hangs go away.

So i spent the better part of today trying to debug this and trying out
various theories when i finally found the likely reason for the hang: if
acpi_ns_initialize_devices() executes an _INI AML method and an NMI
happens to hit that AML execution in the wrong moment, the machine would
hang.  (my theory is that this must be some sort of chipset setup method
doing stores to chipset mmio registers?)

Unfortunately given the characteristics of the hang it was sheer
impossible to figure out which of the numerous AML methods is impacted
by this problem.

As a workaround i wrote an interface to disable chipset-based NMIs while
executing _INI sections - and indeed this fixed the hang.  I did a
boot-loop of 100 separate reboots and none hung - while without the patch
it would hang every 5-10 attempts.  Out of caution i did not touch the
nmi_watchdog=2 case (it's not related to the chipset anyway and didnt
hang).

I implemented this for both x86_64 and i686, tested the i686 laptop both
with nmi_watchdog=1 [which triggered the hangs] and nmi_watchdog=2, and
tested an Athlon64 box with the 64-bit kernel as well. Everything builds
and works with the patch applied.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Andi Kleen <ak@suse.de>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2007-02-13 13:26:24 +01:00
Len Brown 6eb87fed52 ACPI: acpi_table_parse_madt_family() is not MADT specific
acpi_table_parse_madt_family() is also used to parse SRAT entries.
So re-name it to acpi_table_parse_entries(), and re-name the
madt-specific variables within it accordingly.

cosmetic only.

Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-13 02:58:52 -05:00
Len Brown 5a8765a84c ACPI: acpi_madt_entry_handler() is not MADT specific
acpi_madt_entry_handler() is also used for the SRAT,
so re-name it acpi_table_entry_handler().

cosmetic only.

Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-13 02:58:52 -05:00
Len Brown 7f8f97c3cc ACPI: acpi_table_parse() now returns success/fail, not count
Returning count for tables that are supposed to be unique
was useless and confusing.

Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-13 02:58:52 -05:00
Alexey Starikovskiy f3ccb06f3b ACPI: Disable wake GPEs only once.
fixes Suspend/Resume regressions due to recent ACPICA update.

Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-13 02:35:50 -05:00
Len Brown 7cda93e008 ACPI: delete extra #defines in /drivers/acpi/ drivers
Cosmetic only.

Except in a single case, #define ACPI_*_DRIVER_NAME
were invoked 0 or 1 times.

Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-12 23:50:52 -05:00
Len Brown c2b6705b75 ACPI: fix acpi_driver.name usage
It was erroneously used as a description rather than a name.

ie. turn this:

lenb@se7525gp2:/sys> ls bus/acpi/drivers
ACPI AC Adapter Driver  ACPI Embedded Controller Driver  ACPI Power Resource Driver
ACPI Battery Driver     ACPI Fan Driver                  ACPI Processor Driver
ACPI Button Driver      ACPI PCI Interrupt Link Driver   ACPI Thermal Zone Driver
ACPI container driver   ACPI PCI Root Bridge Driver      hpet

into this:

lenb@se7525gp2:~> ls /sys/bus/acpi/drivers
ac  battery  button  container  ec  fan  hpet  pci_link  pci_root  power  processor  thermal

Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-12 23:33:40 -05:00
Len Brown f52fd66d2e ACPI: clean up ACPI_MODULE_NAME() use
cosmetic only

Make "module name" actually match the file name.
Invoke with ';' as leaving it off confuses Lindent and gcc doesn't care.
Fix indentation where Lindent did get confused.

Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-12 22:42:12 -05:00
Alexey Starikovskiy 615d5f235b ACPI: IA64: fix calculation of apic_id
fix regression from recent table re-write

Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-12 10:51:23 -05:00
Vladimir Lebedev e6d0f5622d ACPI: sbs: fix present rate
http://bugzilla.kernel.org/show_bug.cgi?id=7897

Signed-off-by: Vladimir Lebedev <vladimir.p.lebedev@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-10 01:51:13 -05:00
Vladimir Lebedev 4bd35cdb1e ACPI: battery: check for battery present on /proc/battery access
http://bugzilla.kernel.org/show_bug.cgi?id=7200

Signed-off-by: Vladimir Lebedev <vladimir.p.lebedev@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-10 01:43:48 -05:00
Alexey Starikovskiy aafbcd165a ACPI: invoke acpi_sleep_init() earlier
late_initcall() is too late for acpi_sleep_init().
Call it directly from acpi_init code.

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

Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@linux.intel.com>
Signed-off-by: Vladimir Lebedev <vladimir.p.lebedev@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-10 01:32:16 -05:00
Alexey Starikovskiy ed41dab90e ACPI: Disable GPEs in preparation for sleep.
http://bugzilla.kernel.org/show_bug.cgi?id=7887

Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@linux.intel.com>
Signed-off-by: Vladimir Lebedev <vladimir.p.lebedev@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-10 01:30:35 -05:00
Henrique de Moraes Holschuh 3945ac36af ACPI: ibm-acpi: cleanup init and exit paths
Fix a small memory leak on module removal, and other
assorted minor cleanups on the module init codepath.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-09 15:39:47 -05:00
Al Viro a3c94e5c59 ACPI: bay: fix wrong order of kzalloc arguments
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-09 13:04:58 -05:00
Al Viro 35e00fbe48 [PATCH] wrong order of kzalloc arguments
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-09 08:28:48 -08:00
Ahmed S. Darwish b2b7910d5d ACPI: toshiba_acpi: Use ARRAY_SIZE macro when appropriate
Use ARRAY_SIZE macro already defined in kernel.h

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-09 01:22:09 -05:00
David Brownell a74388e21e ACPI: updates rtc-cmos device platform_data
Update ACPI to export its RTC extension information through platform_data
to the PNPACPI or platform bus device node used on the system being set up.

This will need to be updated later to provide a firmware hook to handle
system suspend with an alarm pending.

Len notes that "Eventually we may bundle ACPI/PNP/PNPACPI..." but if/when
that happens, ACPI can simplify this without my help.

And until it does, the separate patch creating a platform_device (on all
X86_PC systems, even without ACPI) will be needed.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-09 00:52:53 -05:00
Matthew C Campbell 1c0f0575fd ACPI: asus_acpi: Add support for Asus Z81SP
Adds support in asus_acpi for the Asus Z81SP laptop.  This preserves all
old functionality when improperly detected as well as enabling Bluetooth
support.

Signed-off-by: Matthew C Campbell <calvinmc@gmail.com>
Acked-by: Corentin Chary <corentincj@iksaif.net>
Cc: Karol Kozimor <sziwan@users.sourceforge.net>
Cc: <acpi4asus-user@lists.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-09 00:41:06 -05:00
Kristen Carlson Accardi c41458aca0 ACPI: bay: remove ACPI driver struct
The bay driver is a platform driver, and doesn't need to also be an acpi
driver.  Remove the acpi driver related structures and callbacks, they didn't
do anything anyway.  Switch to uevent for user space event notification.

Signed-off-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>
2007-02-09 00:38:01 -05:00
Len Brown 76a2e849df Pull acpica into test branch 2007-02-06 15:30:03 -05:00
Len Brown 03c6d130f6 ACPICA: reduce table header messages to fit within 80 columns
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-06 15:28:23 -05:00
Len Brown 6b259707d5 Pull trivial into test branch
Conflicts:

	drivers/acpi/scan.c

Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-03 01:39:07 -05:00
Len Brown a4144e451c Pull asus into test branch 2007-02-03 01:38:30 -05:00
Len Brown eee3c859c4 Pull motherboard into test branch
Conflicts:

	drivers/acpi/motherboard.c

Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-03 01:38:16 -05:00
Zhang Rui 5473526605 ACPI: bay: Convert ACPI Bay driver to be compatible with sysfs update.
Set fake hid for ejectable drive bay.
	Match bay devices by checking the hid.
	Remove .match method of Bay driver.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-03 01:14:56 -05:00