Commit Graph

1161 Commits

Author SHA1 Message Date
jruoho
aa705fc95d Move the function that finds a device_t for the corresponding ACPI device
node from ACPIVERBOSE to the ACPI PCI code.
2010-12-31 10:23:44 +00:00
jruoho
b99cdd8ef8 Move the ACPI sleep-specific sysctl variables to hw.acpi.sleep. The old
machdep-variables are provided for backwards compatibility (eventually these
should be removed). All ACPI sysctl variables are now under hw.acpi.
2010-12-31 09:19:43 +00:00
jruoho
77f707c929 Use "temperature #" and "fan speed #" rather than "TMP#" and "FAN#" for the
sensor names. Remove white space. No functional change.
2010-12-31 08:17:54 +00:00
jruoho
3dc9396c46 Regen. 2010-12-30 19:38:03 +00:00
jruoho
47c7d9897b Add IBM0079. 2010-12-30 19:37:39 +00:00
jruoho
a5a73b2a05 Change the default behavior to enforce the maximum frequency when the
firmware requests to do so. This cures severe overhating (> 120 C) observed
on many laptops, being also on par with the specification(s). This can be
reverted by using the new "hw.acpi.cpu.dynamic" sysctl variable.
2010-12-30 12:05:02 +00:00
jruoho
82e1351b37 Regen. 2010-12-22 22:29:19 +00:00
jruoho
e3cfc8ab23 Add IPI0001, an identifier for ipmi(4). From Dell M710. 2010-12-22 22:28:35 +00:00
jruoho
8e53b1ce30 Use branch annotations in couple of places. Add two comments. 2010-12-20 08:13:04 +00:00
jruoho
e1de74391b Add AMD C1E quirk. Tested by cegger@.
(a) This should be removed once C-states are supported.

  (b) As there seems to be no reliable way to detect whether C1E is present,
      the quirk blindly assumes that C1E is used on families 10h and 11h.
2010-11-30 04:31:00 +00:00
gsutre
4e1e5c3604 Replace ACPI_UINT64 by ACPICA's ACPI_INTEGER. Remove superfluous casts.
No functional change.
2010-11-07 16:36:26 +00:00
gsutre
64448b4070 Hm, the warning sign was not big enough. 2010-11-05 10:35:00 +00:00
gsutre
e0b5016656 Merge ACPI Fujitsu Driver. Provides support for hotkeys and other
built-in components through vendor-specific ACPI devices.

ok jruoho@
2010-11-05 10:28:20 +00:00
jruoho
01720ae0de Initialize pointers to NULL to avoid accidentally free(9)'ing garbage.
Should address the panic reported by Alan Bueno in PR # 44042. The root
cause (an empty _DOD) is yet to be determined.
2010-11-04 20:08:12 +00:00
gsutre
678179dfe4 acpi_eval_integer: check that the evaluation produced a result.
ok jruoho@
2010-11-02 16:45:48 +00:00
gsutre
027c57ec40 Lock the _DGS values (desired output state) during the display
output switch.

ok jruoho@
2010-10-29 09:04:38 +00:00
gsutre
a9f3b6413d Simplify the sysctl variable for BIOS switch policy, and document it
in acpivga(4).  The previous hw.acpi.acpivga0.policy variable is
renamed into bios_policy for consistency, and is for ACPI_DEBUG only.

ok jruoho@
2010-10-28 21:45:02 +00:00
jruoho
b6050c6897 Be silent if we get a notification to tell us that we woke up the system. 2010-10-28 18:03:11 +00:00
jruoho
639d1b9782 Install EC space handler and pass everything to acpiec(4).
Should fix PR # 43659.
2010-10-28 15:55:04 +00:00
jruoho
fcd284181f Fix a comment typo. 2010-10-28 04:28:29 +00:00
jruoho
a4915ab4db Only override data from XPSS if the conventional _PSS did not contain the
required information. Problem found and diagnosed by jakllsch@; on some AMD
systems vendors fill _PSS correctly, but do not duplicate the data in XPSS.
2010-10-28 04:27:40 +00:00
gsutre
f32ca0cfec Make acpi(4) debug aware of ACPI_DISPLAY_COMPONENT. 2010-10-27 14:39:26 +00:00
gsutre
af565a28d4 An _ADR object is not required for PCI root bridges. To solve
this, the structure acpi_pciinfo now tells whether the ACPI
device node is a PCI bridge, a regular PCI device, or both.

Problem reported by jmcneill@, who also suggested the solution.

ok jmcneill@, jruoho@
2010-10-26 22:27:44 +00:00
jruoho
85aafab84b Add LEN0014. (And to the previous commit; a driver for this, not PNP0C32, is
possibly coming.)
2010-10-26 09:13:54 +00:00
jruoho
4e313088ed Regen. 2010-10-26 08:59:06 +00:00
jruoho
91c0c3fd42 Add more identifiers for ATM chips.
Also add PNP0C32 for "quickstart buttons". A driver for this comes later.
2010-10-26 08:57:46 +00:00
jruoho
6fdfbe79c2 Add support for module(9). 2010-10-26 05:28:29 +00:00
jruoho
8eae6f006a Bump WARNS to 4. 2010-10-26 04:37:33 +00:00
jruoho
a953788eba Use kmem(9) instead of malloc(9). 2010-10-26 04:24:21 +00:00
jruoho
6b1e267f66 Refactor slightly and bump WARNS to 4. 2010-10-26 03:11:10 +00:00
jruoho
9fad28a567 Add support for module(9). 2010-10-25 17:06:58 +00:00
jruoho
a60aadf22e Fix build failure. 2010-10-25 15:38:05 +00:00
jruoho
70e14dc983 Bump WARNS to 4. 2010-10-25 07:48:03 +00:00
jmcneill
9750ca2f9c add support for building as a module 2010-10-24 18:26:29 +00:00
jmcneill
4e44999554 add support for building as modules 2010-10-24 16:25:31 +00:00
jmcneill
5991cdfeba add rescan support 2010-10-24 15:07:20 +00:00
jruoho
117351d1b6 Add acpiwmi(4) mappings for MSI laptops.
XXX: It may be necessary to fix PR # 43659 before this works on all models.
2010-10-24 08:54:14 +00:00
jruoho
c99562cb83 Simplify acpi_enter_sleep_state() and guard it against NULL pointer
dereferences. Try to avoid referencing the global acpi_softc, which should
really be static or at least internal to acpi(4).
2010-10-24 07:53:04 +00:00
gsutre
e28e04ce32 Merge ACPI display driver. Provides generic support for brightness
control and output switching, through ACPI video extensions.

TODO: use wsconsctl(8) instead of sysctl(8) for brightness control.

ok jruoho@
also discussed with cegger@ and jmcneill@
2010-10-12 19:10:49 +00:00
gsutre
646cb7e223 Store sysctl MIBs instead of a pointer to the root of the sysctl
sub-tree (because the pointer may be invalid at the time we use it).

ok jruoho@
2010-10-08 07:04:31 +00:00
gsutre
92e792e4a4 Drop _HID requirement for attachment under acpi(4). From now on,
drivers attaching to the acpinodebus interface should not assume
that the passed acpi_devnode has a valid _HID.

ok jruoho@
2010-10-02 18:06:47 +00:00
gsutre
a9c0568376 Do not discard ACPI PCI addresses with function number 0xFFFF: the
ACPI specification allows them (ACPI 4.0a, p. 200).

ok jruoho@
2010-09-24 07:48:59 +00:00
jmcneill
eb0e82d870 Add support for blacklisting ACPI BIOS implementations by year. By default,
don't use ACPI on BIOS which advertise release years <= 2000. This
can be changed by setting option ACPI_BLACKLIST_YEAR=0 or by setting
acpi_force_load=1.
2010-09-06 15:54:26 +00:00
jakllsch
eb044d2951 Remove quirk added in rev 1.14. Even after the change of 1.16, it
still matches more boards that just the one with the problem.

Interrupts from the SATA controllers on my MSI K8N Neo3 boards
(which both versions of this quirk matched) are broken when ACPI
is disabled.  My board does not exhibit AE_AML_INFINITE_LOOP
problems.

If we want to avoid manually specifying RB_MD2 in boothowto on
pgoyette@'s board, we're going to have to find another way; perhaps
with the DMI strings available from pmf(9).

Anyhow, some boards needing RB_MD2 during boot(8) is in my opinion
better than others needing to set acpi_force_load in ddb or gdb.
2010-09-06 14:09:54 +00:00
jruoho
40ac1b9f62 Use FADT instead of DSDT in the quirk added in the revision 1.14. 2010-09-04 17:48:26 +00:00
jruoho
a8cdc50f5d Fix PR kern/43765 from Scott Ellis.
Note that the solution is not optimal. If ichlpcib(4) provides SpeedStep
support, possible I/O resource conflicts may occur with acpicpu(4). Ideally,
as noted for instance in Windows design documents, ichlpcib(4) should never
expose SpeedStep when ACPI is being used. The probability for potential race
conditions is however very small, being limited to few P4-era machines and
being dependent on user actions.
2010-08-27 03:05:26 +00:00
jruoho
9d3272e78a From jmcneill@: fix and rework the obscure _OSC evaluation. 2010-08-27 02:44:05 +00:00
jruoho
8c53a12242 Bypass ACPI_NOTIFY_DEVICE_WAKE also in acpilid(4). Use aprint_debug_dev(9)
for an unknown notify. (The ACPI drivers should really not print anything
as we now have a global notify handler that can catch the debug information.)
2010-08-24 15:03:34 +00:00
jruoho
22be5f8eda Remove phony spl(9). XXX: This driver needs to be cleaned up. 2010-08-24 14:53:45 +00:00
jruoho
42a7d04b04 Add native support for AMD family 0Fh processors. This is the furthest we
will go backwards; K7 will not be supported already due doubts about
availability and reliability of ACPI during that era. Some unfortunate code
duplication is present (but not overly much). Thanks to cegger@ and jakllsch@
for patiently testing this.
2010-08-24 07:27:59 +00:00
pgoyette
4cbc14d2b2 Initialize acpi_force_load so that it gets allocated in the data segment
rather than BSS.  This lets you change its value with 'gdb --write'.

OK jruoho@
2010-08-24 04:36:02 +00:00
jruoho
4f4a7a5d46 Other entry points beyond x86_cpu_idle_halt() may use HLT as the
idle-mechanism. Send an IPI also for these in cpu_need_resched().
2010-08-23 16:20:44 +00:00
jruoho
f0bf6761b2 Use acpi_timer_read_fast() instead of acpi_timer_read_safe(). 2010-08-22 17:45:48 +00:00
jmcneill
49c09edb54 Don't put devices in the ignored IDs list just because no driver exists. 2010-08-22 00:39:08 +00:00
jruoho
22b91511fc After discussion with jakllsch@ and jmcneill@, revert the previous and only
do the status-check when the comparison value reported by BIOS is not zero.
The uncertainty noted in the previous commit still applies. But if we ever
see a timeout again, it will likely be either a firmware bug or a special
case like the Intel Turbo Boost.
2010-08-21 18:25:45 +00:00
jmcneill
c5ec9c2c52 in acpibut_notify_handler, suppress 'unknown event' messages for
ACPI_NOTIFY_DEVICE_WAKE. Control method power and sleep buttons can
generate this event upon waking from G1 sleep to indicate that it was
responsible for waking the system.
2010-08-21 16:36:15 +00:00
pgoyette
f05cff10bd Update the various xxx_verbose modules to conform to the module subsystem's
new locking protocol.
2010-08-21 13:18:35 +00:00
jmcneill
0b3fb1fe44 - don't clobber the data found by _PSS if XPSS validation fails
- XPSS spec says that Status{,Mask} and Control{,Mask} buffers are 8 bytes
- use ACPI_GET64 macros instead of memcpy when reading from buffers

This makes acpicpu work again on my VIA C7-M, whose firmware reports
malformed XPSS packages but has a working _PSS
2010-08-21 13:12:15 +00:00
jruoho
497fed0a50 Check from CPUID 0x06 %eax (on Intel) whether we might actually have an
invariant APIC timer or an "ARAT" ("always running APIC timer"). This means
that the APIC timer may keep ticking at the same rate also in deep C-states
with some new or forthcoming Intel CPUs.
2010-08-21 06:45:50 +00:00
jruoho
6cf2f2d125 Detect whether TSC is invariant, which may be the case on both new AMD and
Intel processors. The invariance means that TSC runs at a constant rate
during all ACPI state changes. If it is variant, skew may occur and TSC is
generally unsuitable for wall clock services. This is especially relevant
with C-states; with variant TSC, the whole counter may be stopped with states
larger than C1. All x86 CPUs before circa mid-2000s can be assumed to have a
variant time stamp counter.
2010-08-21 03:55:24 +00:00
jruoho
222d798a76 Add two flags that needs to be dealt with (hardware vs. software
coordination of P-state transitions, and Turbo Boost / Turbo Core).
2010-08-20 12:20:23 +00:00
jruoho
24ca85d180 Give a hint about a driver conflict. 2010-08-20 06:36:40 +00:00
jruoho
ce692d69b0 Check the cached value also when setting a state. 2010-08-20 04:16:00 +00:00
jmcneill
11d8465e82 pull in acpireg.h for ACPI_COMPONENT_RESOURCE 2010-08-19 18:37:38 +00:00
jmcneill
e9887a1821 define _COMPONENT and ACPI_MODULE_NAME() for ACPI_DEBUG 2010-08-19 18:30:33 +00:00
jmcneill
70496e9ae2 add pmf support 2010-08-19 14:59:24 +00:00
jruoho
5ecdb7f351 Deal with autoconfiguration madness by using config_defer(9) to defer
config_interrupts(9) to be executed. This is necessary because: (a) the
initialization routines must be run only once after interrupts are enabled
and (b) all ACPI CPUs have attached.
2010-08-19 05:09:53 +00:00
jruoho
8116cea3d3 Use the idea from cegger@ and fill the (X)PSS structure during initialization. 2010-08-18 18:32:20 +00:00
jruoho
46457f068f Fix fix of a bug: first initialize sc, check sc != NULL, then KASSERT(9). 2010-08-18 02:01:45 +00:00
cegger
63f1e79c2b build fix: first initialize sc then KASSERT 2010-08-17 18:49:28 +00:00
jruoho
6846d4aa28 Adjust locking for previous. 2010-08-17 10:57:30 +00:00
jruoho
99f8ada841 Clarify the initialization of the dynamic maximums/minimums. Reset these to
defaults upon suspend. As we do not know how well the firmware maintains
state, do not run the callbacks that evaluate the maximum/minimum on resume.
2010-08-17 10:35:22 +00:00
jruoho
e70b5284eb Add support for the optional dynamic minimum (in terms of MHz) via _PDL.
Comparable to T-states, this gives effectively a window of available
performance states for passive cooling. An example:

Init:		max = 0, min = Pn.

		Time j.				Time j + 1.
		-----------			-----------
2000 MHz	P0	max			P0
		P1				P1	max
		P2		   ==>		P2
		P3				P3	min
		P4				P4
		P5	min			P5
 500 Mhz	Pn				Pn
		-----------			-----------

Search:		repeat (i = P0; i <= P5)	repeat (i = P1; i <= P3)
2010-08-17 10:17:52 +00:00
jruoho
f3e239e7c7 Fix comments. 2010-08-16 20:20:44 +00:00
jruoho
c1f0324ceb Two changes:
1.	Initialize P-states properly to P0. It is processor-specific
   	what value we might get without initialization. (Some AMD CPUs
	have even specific registers for the state after cold reset.)

  2.	Following design notes for Windows, set the lowest-power P-state
	upon suspend and restore the saved state after resume.
2010-08-16 20:07:57 +00:00
jruoho
2510a0e220 Now that the deferred configuration actually works as expected and documented,
use config_defer(9) instead of config_finalize_register(9), and simplify the
code paths around the initialization.
2010-08-16 17:58:42 +00:00
jmcneill
81c69bbce9 make it compile again 2010-08-16 10:23:25 +00:00
jruoho
c4a7ea78bd If XPSS is used, only invalidate P-states if the control MSR address is zero.
If the status address is zero, we will bluntly bypass the transition check.
2010-08-16 10:07:09 +00:00
jruoho
6c06255cee Add support for Extended PSS ACPI Method Specification from Microsoft.
This will greatly simplify supporting PowerNow! on conforming systems.
2010-08-16 07:38:38 +00:00
jruoho
b5e3d393b9 Do not error out neither in P-states nor in T-states if the method for the
dynamic maximum is nonexistent. Unsurprisingly, there is vagueness in the
standards; in ACPI 3.0 and 4.0 it is clearly indicated that also these methods
must be present, but the earlier standards are less stringent. Without too
much effort, at least one old P4-system was located that lacks _PPC.
2010-08-16 04:31:21 +00:00
jruoho
01066e7b7b Add comments and raise the minimum allowed T-state duty cycle to 10 %. 2010-08-15 08:53:19 +00:00
jruoho
46bba1f374 Properly deal with the previous FADT-issue. 2010-08-15 04:35:16 +00:00
jruoho
1084719e1b Simplify the FADT-based entry by "faking" (overriding) also the address. 2010-08-14 17:50:57 +00:00
jruoho
e04e55946a Do not accidentally write zeros to (PSTATE_CNT and CST_CNT) registers. 2010-08-14 17:27:34 +00:00
jruoho
e9a3c2e517 Check the cold-flag also in the notify handler. 2010-08-14 11:16:14 +00:00
jruoho
7aa250c707 Do not queue functions via sysmon_taskq(9) in the pmf(9) resume hooks.
There is a small and unlikely race when the drivers are loaded as modules;
suspend, resume, queue a function, and immediately unload the module.
2010-08-14 05:41:22 +00:00
jruoho
1f0e85dcbd Move the PIIX4-quirk to the MD file and disable T-states for PIIX4. 2010-08-14 05:13:20 +00:00
jruoho
1a6fcb7e2a Explicitly include <sys/evcnt.h>. 2010-08-13 19:51:54 +00:00
jruoho
25630fd34e Instead of packing structures that do not need to be __packed, remove two
CTASSERT(9) macros.  Fixes build failure on AMD64 noted by cegger@.
2010-08-13 19:48:25 +00:00
jruoho
3d52b10fd5 Remove some unnecessary locking. Mainly a leftover from previous revisions
where the dynamic maximum/minimum was used also when retrieving the current
state. The state-array itself changes only in C-states.
2010-08-13 18:44:24 +00:00
jruoho
6b9ff1079c Merge T-state a.k.a. throttling support for acpicpu(4).
Remarks:

  1.    Native instructions are supported only on Intel. Native support for
        other x86 vendors will be investigated. By assumption, AMD and others
        use the I/O based approach.

  2.    The existing code, INTEL_ONDEMAND_CLOCKMOD, must be disabled in
        order to use acpicpu(4). Otherwise fatal MSR races may occur.
        Unlike with P-states, no attempt is done to disable the existing
        implementation.

  3.    There is no rationale to export controls to user land.

  4.    Throttling is an artefact from the past. T-states will not be used for
        power management per se. For CPU frequency management, P-states are
        preferred in all circumstances. No noticeable additional power savings
        were observed in various experiments. When the system has been scaled
        to the highest (i.e. lowest power) P-state, it is preferable to move
        from C0 to deeper C-states than it is to actively throttle the CPU.

  5.    But T-states need to be implemented for passive cooling via acpitz(4).
        As specified by ACPI and Intel documents, these can be used as the
        last line of defence against critical thermal conditions. Support
        for this will be added later.
2010-08-13 16:21:50 +00:00
jruoho
c4e35077eb Three small things: (1) fix off by one, (2) protect the cached P-state
(required for interaction with T-states), and (3) use aprint_debug(9)
instead of the ACPI_DEBUG_PRINT(x) macro for the dynamic frequency changes
(for the time being, people need easier way to observe the dynamic changes).
2010-08-12 06:17:14 +00:00
jruoho
aa6fdddc15 Properly protect against garbage values. 2010-08-11 18:15:52 +00:00
jruoho
675dfd8bb3 Print the state information only once. The per-CPU information was quite
pointless as identical parameters are expected across processors.
2010-08-11 16:41:19 +00:00
jruoho
7a63961323 Check the 'sc->sc_cold' flag also in P-state code, and set this flag once
we start the detachment routine.
2010-08-11 16:22:18 +00:00
jruoho
33733d6120 Add a small additional check for the validity of the GAS register. 2010-08-11 13:02:59 +00:00
jruoho
0963b3f611 Use a define instead of a magic constant for the arbitrary P-state limit. 2010-08-11 11:48:21 +00:00
jruoho
7598fbdbbd Pretty printing. 2010-08-11 10:44:07 +00:00
gsutre
8e80a0a5b0 acpi_print_tree: print ACPI and PCI autoconf(9) device names.
ok jruoho@
2010-08-11 10:32:42 +00:00
jruoho
69855d87bf Fix xref in a comment. 2010-08-10 05:22:07 +00:00
jruoho
06ea2864c4 Add a XXX-comment as a TODO. From jmcneill@:
/*
         * XXX: The pci_find_device(9) function only deals with
         *      attached devices. Change this to use something like
         *      pci_device_foreach(), and implement it for IA-64.
         */
2010-08-10 04:38:06 +00:00
jruoho
afd0718108 Use evcnt(9) for the counters. 2010-08-10 02:42:05 +00:00
jruoho
c832263680 On systems where both the existing EST code and the one provided by ACPI are
functional, the previously loaded EST code may have used frequencies that
are not present in the BIOS. This will cause failures since acpicpu(4) will
treat these unknown frequencies as errors. "Fix" this by initializing the
cached P-state to P0, regardless of what the true state might be.
2010-08-09 15:56:45 +00:00
jruoho
af42249343 Remove a redundant function. 2010-08-09 13:41:38 +00:00
gsutre
474664a934 acpi_pcidev_scan: attach PCI information only to working devices.
ok jruoho@
2010-08-09 09:36:42 +00:00
jruoho
eb3ca71af1 Downgrade the currently supported maximum C-state to C1. There appears to be
timer-related interrupt issues also in C2. With C1 it is guaranteed that
acpicpu(4) will not cause any slowdowns due stalled local APIC timer.
2010-08-09 05:00:24 +00:00
jruoho
c72ee2046d When retrieving the current frequency, scan all available P-states.
Only use the dynamic maximum when setting a frequency.
2010-08-09 04:27:07 +00:00
jruoho
d4f0008ba0 jmcneill@: do not touch the bus_space(9) handle. 2010-08-08 18:47:54 +00:00
jruoho
337dd64961 Improve error and debug messages. 2010-08-08 18:25:06 +00:00
jruoho
5520795ab6 As per jmcneill@'s suggestion, improve error reporting. 2010-08-08 18:10:34 +00:00
jruoho
9f5abae832 Add P-states. (I blame the ease of using modules.) 2010-08-08 17:21:14 +00:00
jruoho
1e80cb5566 Remove bogus check and allow all CPUs to use I/O-based P-states. 2010-08-08 17:05:50 +00:00
jruoho
53e8f6c919 Merge P-state support for acpicpu(4).
Remarks:

  1.    All processors (x86 or not) for which the vendor has implemented
        ACPI I/O access routines are supported. Native instructions are
        currently supported only for Intel's "Enhanced Speedstep". Code for
        "PowerNow!" (AMD) will be merged later. Native support for VIA's
        "PowerSaver" will be investigated.

  2.    Backwards compatibility with existing userland code is maintained.
        Comparable to the case with cpu_idle(9), the ACPI CPU driver
        installs alternative functions for the existing sysctl(8) controls.
        The "native" behavior (if any) is restored upon detachment.

  3.    The dynamic nature of ACPI-provided P-states needs more investigation.
        The maximum frequency induced (but not forced) by the firmware may
        change dynamically. Currently, the sysctl(8) controls error out with
        a value larger than the dynamic maximum. The code itself does not
        however yet react to the notifications from the firmware by changing
        the frequencies in-place. Presumably the system administrator should
        be able to choose whether to use dynamic or static frequencies.
2010-08-08 16:58:41 +00:00
gsutre
110cd99be7 acpi_pcidev_scan: discard invalid PCI addresses. 2010-08-08 16:26:47 +00:00
jruoho
6745d5be67 Do not try to disable ACPI if we can not enter to legacy mode. While it is
safe to call AcpiDisable() even if a system operates only in ACPI mode, this
leads to unpleasantly verbose error messages in ACPICA.
2010-08-07 20:07:25 +00:00
jruoho
2146168c62 Allow to dump the basic information at runtime with a flag to modload(8).
This can help when dealing with problem reports, as the user does not need
to reboot nor compile a kernel. Instead: 'modload -b dump=true acpiverbose'.
2010-08-07 18:59:53 +00:00
jruoho
40f2c5cbe7 Fix build failure. 2010-08-07 17:12:55 +00:00
jruoho
3319c9a659 Dump MADT in ACPIVERBOSE. 2010-08-07 14:17:21 +00:00
jruoho
21753466cc Remove the last ACPI driver -specific #ifdef, ACPI_FDC_DEBUG. 2010-08-07 09:55:59 +00:00
jruoho
6e6e026403 Reorganize: also the APIC tables will be dumped in ACPIVERBOSE, and the
callback functions will be modified to be suitable also with other tables.
2010-08-07 09:41:19 +00:00
jruoho
77da05df17 Dump the whole FADT in ACPIVERBOSE. 2010-08-07 08:59:51 +00:00
jruoho
e1035e2b84 Simplify the acpiverbose module. 2010-08-06 23:38:34 +00:00
jruoho
460de0d614 Remove the acpiwmi(4) dump from the ACPIVERBOSE module. Instead of this
complex solution, just use aprint_debug(9) in the driver.
2010-08-06 22:45:00 +00:00
jruoho
2a35c4cf20 Fix prototypes; SYSCTLFN_ARGS -> SYSCTLFN_PROTO.
(These things really only obscure the code.)
2010-08-06 18:10:40 +00:00
jruoho
d8b9e18823 Store the MADT-derived CPU ID to <x86/cpu.h>. This is required to properly
match the ACPI processor object ID with the ID available in the APIC table.
2010-08-04 10:02:11 +00:00
jruoho
87a3551c76 On second thought, rename the mutex so it can be (logically) shared. We will
not need such granularity that different states would require a different lock.
2010-07-30 06:11:14 +00:00
jruoho
988469445d Add a per ACPI CPU mutex for C-states. Protect the _CST update with this:
when the idle-information is being updated (e.g. due acpiacad(4) events),
we can not enter the idle-loop. The lock must run at the same priority
(IPL_NONE) as ACPICA's mutexes obtained via AcpiOsCreateMutex() a.k.a.
AcpiOsCreateSemaphore(). Also check want_resched as the first thing and
clarify the suspend/resume path.

There is still one race condition identified: when the driver is loaded as a
module, we must gracefully kick all CPUs out from the ACPI idle-loop upon
detachment.
2010-07-29 22:42:58 +00:00
jruoho
2ef2de7924 Refactor to make this more readable. No functional change. 2010-07-29 11:03:09 +00:00
jruoho
a240caeadb Add "pnp0c14" to the list of HIDs. Required for LG X110. As valid EISA IDs
should be all upper case, leave this as a onetime quirk specific to acpiwmi(4).
2010-07-29 07:10:39 +00:00
jruoho
cc2aad5da2 Remove also the HIDs from previous. 2010-07-28 16:29:11 +00:00
jruoho
c1b6b639ac Remove the homegrown attempt to match the parent PCI bus. This was only used
for descriptive purposes, and for such purposes the ACPIVERBOSE output is
much better.
2010-07-28 16:26:56 +00:00
jruoho
0df7185e13 Remove leftovers from the aiboost(4) removal. 2010-07-28 16:02:33 +00:00
pgoyette
9e9cac1c34 Use __arraycount(). No functional change. 2010-07-27 15:16:16 +00:00
jruoho
1d37b0a731 Add a quirk for pgoyette@'s old (ACPI 1.0) NVIDIA board.
It was analyzed that this DSDT busy-loops some unknown PCI memory regions in
several places. Because the regions are apparently almost constant, this
causes several conditions where the interpreter might enter into an infinite
loop. Luckily ACPICA detects this and rightly spams AE_AML_INFINITE_LOOP
warnings.

Not much we can do. Declare as broken beyond repair. Set acpi_force_load=1
to use ACPI or use a custom DSDT.
2010-07-27 06:14:37 +00:00
jruoho
1392a1cea1 Move the GAS definition to the header so it can be shared. Make a basic
sanity check before casting to the GAS. Rename the _CSD structure; the
optional "cross logical processor dependency information" is almost
identical in C, P, and T states. Add some comments to the header.
2010-07-27 05:11:32 +00:00
jruoho
6ba3ba49aa Fix wrong return value. 2010-07-26 15:14:33 +00:00
jruoho
0ad9aaa477 Improve comments. Move the #ifdef around. 2010-07-25 17:44:01 +00:00
jruoho
fe682d3527 Add PNP0B01 and PNP0B02, both variants of the PC/AT RTC. From the spec. 2010-07-25 16:23:51 +00:00
pgoyette
1587dcc60f Move setting of acpi_verbose_loaded flag into the module's init routine.
This ensures that the flag is set even if the module was manually loaded
by the user rather than just auto-loaded.
2010-07-25 12:54:46 +00:00
jruoho
cc774b9046 Remove the currently unnecessary mutex. 2010-07-24 22:44:00 +00:00
jruoho
f534f13d87 Revert the previous partially for the time being. 2010-07-24 21:53:53 +00:00
jruoho
6f76995c42 Move ACPI_FLUSH_CPU_CACHE() (a.k.a. WBINVD on x86) to MD headers where it
belongs to. Let IA-64 define its own function/instruction instead of
requiring a dummy wbinvd() to satisfy the definition in a MI header.
2010-07-24 09:35:36 +00:00
jruoho
cb59d41daa Update and fix a typo. 2010-07-24 06:10:43 +00:00
jruoho
4127064077 Make sure we use MWAIT with MONITOR.
Also clarify when we have interrupts disabled.
2010-07-23 13:54:21 +00:00
jruoho
00ad9caa92 Add a new flag that determines whether we should check for bus master
activity (BM_STS) by reading from the PM1 register. According to the Intel
processor specification for ACPI, the FFH GAS encoding may provide a hint
that the check is not required. This may help some systems to enter C2/C3
even when e.g. usb(4) keeps the BM_STS bit always enabled.
2010-07-23 08:11:49 +00:00
jruoho
44091f0125 Remove the recently added ACPICPU_FLAG_INIT and instead operate with the
existing ACPICPU_FLAG_C, as was intended. Set that flag only after the
idle-loop has been installed, so that the notify handler errors out if an
interrupt is received before the idle-loop is in place.
2010-07-23 05:32:02 +00:00
pgoyette
aabfc9142c Even if there's an error in attaching the device (failure to find IRQ
resource, or I/O mapping), set-up a power management handler so we can
sleep later on.
2010-07-22 16:35:24 +00:00
cegger
d36c53b8ff ACPI enumerates cpus with 0..n.
Fixes panic reported by Patrick Welche on current-users@
Fixes panic on my own HP Pavilion laptop
2010-07-21 14:59:31 +00:00
jakllsch
fb6eaa4e58 correct an obvious typo: acpwmi -> acpiwmi 2010-07-19 18:22:53 +00:00
christos
515e411d3f XXX: If this is not correct, revert or fix.
This makes my laptop boot instead of panic:

panic: kernel diagnostic assertion "native_idle != NULL" failed: file "../../../../arch/x86/acpi/acpi_cpu_md.c", line 155
fatal breakpoint trap in supervisor mode
type 1 code 0 rip ffffffff8022e4ad cs 8 rflags 246 cr2  0 cpl 0 rsp ffff80004c37db10

trace
breakpoint() at netbsd:breakpoint+0x5
panic() at netbsd:panic+0x2ba
kern_assert() at netbsd:kern_assert+0x2d
acpicpu_md_idle_stop() at netbsd:acpicpu_md_idle_stop+0x62
acpicpu_cstate_callback() at netbsd:acpicpu_cstate_callback+0x34
sysmon_task_queue_thread() at netbsd:sysmon_task_queue_thread+0x41

1. ACPI seems to define cpuids 1..n; we define 0..n-1. Adjust for that
2. My laptop is dual core, but ACPI reports 4 cpu nodes. Instead of
   attaching the unmatched ones, make the match fail. Do we want to
   attach and do nothing instead?
3. Create a flag, and only set it after we are completely initialized,
   so the sysmon thread does not try to access unitialized state.
2010-07-19 00:59:32 +00:00