summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert the removal of the initial_irq hack for now as this code is morejhb2004-06-141-9/+7
| | | | | broken than I thought and doesn't do a good job of routing virgin interrupts at all.
* Remove disable_on_poweroff and our pre-sync shutdown handler. Disablingnjl2004-06-141-30/+1
| | | | | of GPEs is now done in acpi_shutdown() and so we no longer need the option of disabling ACPI in the poweroff case.
* Clean up acpi_probe_order() a bit and clarify some comments.njl2004-06-141-9/+19
|
* Don't probe/attach in the ACPI_DEBUG case.njl2004-06-141-2/+1
|
* Add support to ACPI to manage its own resources. Previously, resourcenjl2004-06-1310-101/+246
| | | | | | | | | | | | | | | | | allocation was passed up to nexus. Now, we probe sysresource objects and manage the resources they describe in a local rman pool. This helps devices which attach/detach varying resources (like the _CST object) and module loads/unloads. The allocation/release routines now check to see if the resource is described in a child sysresource object and if so, allocate from the local rman. Sysresource objects add their resources to the pool and reserve them upon boot. This means sysresources need to be probed before other ACPI devices. Changes include: * Add ordering to the child device probe. The current order is: system resource objects, embedded controllers, then everything else. * Make acpi_MatchHid take a handle instead of a device_t arg. * Replace acpi_{get,set}_resource with the generic equivalents.
* Associate a device_t with an ACPI_HANDLE. This make AcpiWalkNamespace morenjl2004-06-132-0/+21
| | | | | useful. If ACPI-CA allowed null object handlers, we wouldn't need the placeholder function.
* Remove accidental change.njl2004-06-071-1/+1
|
* Avoid printing extraneous warning messages when trying to switch a devicenjl2004-06-072-17/+17
| | | | | | | | which doesn't support ACPI power states. Return AE_NOT_FOUND for these cases and don't print the warning message. Also, print the name of the handle instead of device when unable to switch states. The device is often not attached at this point and so its name is NULL, which doesn't help debugging.
* - Use PCI_INVALID_IRQ macro rather than a magic number.jhb2004-06-071-2/+1
| | | | - Remove obsolete comment about APIC_IO routing.
* Don't forget to pass shutdown events down to children first now that wenjl2004-06-051-0/+3
| | | | handle them at the bus level too.
* Disable wake GPEs in the reboot path as well as poweroff path. This fixesnjl2004-06-051-4/+11
| | | | | | "stray irq 9" messages on my Thinkpad. It may also help with general reboot consistency although the recent hang on reboot was solved by acpi_cpu.c rev 1.39.
* Rework acpi_cpu_idle() to select the next idle state before sleeping, notnjl2004-06-051-109/+78
| | | | | | | | | | | | | | after. Unify the paths for all Cx states. Remove cpu_idle_busy and instead do the little profiling we need before re-enabling interrupts. Use 1 quantum as estimate for C1 sleep duration since the timer interrupt is the main reason we wake. While here, change the cx_history sysctl to cx_usage and report statistics for which idle states were used in terms of percent. This seems more intuitive than counters. Remove the cx_stats structure since it's no longer used. Update the man page. Change various types which do not need explicit size.
* Work around the preemption problem in acpi_cpu.c for shutting down.peter2004-06-041-0/+2
| | | | Submitted by: nate / jhb
* Add missing <sys/module.h> includesphk2004-05-3014-0/+14
|
* Decrease sleep_delay default to 1 second now that the machines thatnjl2004-05-291-2/+2
| | | | required the 5 second delay have been fixed.
* Style cleanups, don't set the device description before the probe routinenjl2004-05-293-49/+37
| | | | has completed successfully.
* Don't assume that the current setting (_CRS) of a PCI link device isjhb2004-05-281-7/+9
| | | | | | | | correct. Instead, check it against the possible settings (_PRS) when the link is probed. This is important when using APIC mode but link devices still have PIC mode settings. This is also what Linux does. Additional prodding by: Len Brown len dot brown at intel dot com
* Style fixes.njl2004-05-281-56/+54
|
* Now that we properly disable GPEs before entering a sleep state, includingnjl2004-05-281-1/+1
| | | | | S5 (soft off), we don't need to disable ACPI when powering off. This may fix some systems that don't power off correctly.
* Style cleanups. "extern" is unneeded for function prototypes.njl2004-05-281-74/+68
|
* Update the new suspend/resume GPE methods to properly limit the GPEnjl2004-05-284-16/+65
| | | | | | | based on the destination sleep state. Add a method to restore the old state on resume. This is needed for the case of suspending to a very low state disabling a GPE (i.e. S4), resuming, and then suspending to a higher state (i.e. S3). This case should now keep the proper GPEs enabled.
* Pass a pointer to the sleep state instead of casting gymnastics to passnjl2004-05-281-4/+4
| | | | the value itself in the pointer.
* Fix paste-o.njl2004-05-281-1/+1
|
* Attach per-device sysctls to allow users to set whether or not a givennjl2004-05-281-0/+52
| | | | | | | | | device can wake the system. For example: dev.root0.nexus0.acpi0.acpi_lid0.wake: 1 dev.root0.nexus0.acpi0.acpi_button0.wake: 1 dev.root0.nexus0.acpi0.pcib0.wake: 0 dev.root0.nexus0.acpi0.sio0.wake: 0
* Fix LP64 environments: cast a pointer type to intptr_t before castingmarcel2004-05-281-2/+2
| | | | to int and vice versa.
* Restructure the wake GPE API. Now there are three functions:njl2004-05-274-186/+285
| | | | | | | | | | | | | | | | | | acpi_wake_init: Evaluate _PRW and set the GPE type acpi_wake_set_enable: Enable or disable a device's GPE. acpi_wake_sleep_prep: Perform any last-minute changes to the device to prepare it for entering the given sleep state. Also, walk the entire namespace when transitioning to a sleep state, disabling any GPEs which aren't appropriate for the given state. Transition acpi_lid and acpi_button to the new API. This clears the way for non-ACPI-aware devices to wake the system (i.e. modems) and fixes a problem where systems power up after shutdown when a GPE is triggered.
* Enable GPE at runtime rather than suspend time. This is to match thenjl2004-05-252-2/+6
| | | | | new behavior in ACPI-CA that defers GPE configuration. This is a temporary measure while reworking the GPE interface.
* Remove call to _INI for thermal devices. ACPI-CA now calls _INI fornjl2004-05-251-6/+0
| | | | Devices, ThermalZones, and Processors.
* Changes to implement 20040514:njl2004-05-255-45/+67
| | | | | | | | | | | | | | | * Add calls to AcpiSetGpeType. We use wake/run as the type for lid and button switches since wake-only causes Thinkpads to immediately wake on the second suspend. Note that with wake/run, some systems return both wake and device-specific notifies so we don't register for system notifies for lid and button switches. * Remove the hw.acpi.osi_method tunable since it is not needed. * Always print unknown notifies for all types. * Add more cleanup for the EC if it fails to attach. * Use the GPE handle now that we parse it. This allows GPEs to be defined in AML GPE blocks. * Always use ACPI_NOT_ISR since it's ok to acquire a mutex in our thread which processes queued requests.
* Revert the previous commit. The bus accessor macros do not check thenjl2004-05-221-3/+56
| | | | | | | return value for BUS_READ_IVAR and thus don't generate the proper NULL in cases where a device (i.e. on PCI) does not have a handle. Found by: peadar, tjr
* Use the simpler __BUS_ACCESSOR macros for ivars instead of defining themnjl2004-05-181-56/+3
| | | | ourselves.
* Add support for GPE being a package of { reference, gpe bit }.njl2004-05-141-40/+86
| | | | | Rework the ECDT probe to pass all the parameters in a temporary struct. Note why we are mostly ok evaluating _GLK so early.
* Add support for retrieving _GLK in the ECDT probe. Now we no longer alwaysnjl2004-05-131-35/+20
| | | | | use the global lock at the beginning of the ECDT probe. Instead, we use the handle from the ECDT to call _GLK. Also, unify the device description.
* If an ACPI PCI-PCI bridge doesn't have a _PRT object, fall back to usingjhb2004-05-101-1/+9
| | | | | | | | | the swizzle method for routing PCI interrupts across the bridge. This fixes problems with motherboards (typically laptops) whose BIOS doesn't provide a PRT for the AGP bridge even though there is a device entry for the bridge in the ACPI namespace. Tested by: Kenneth Culver culverk at sweetdreamsracing dot biz
* Change hw.acpi.cpu.cx_lowest to accept values in the form of C1,njl2004-05-071-9/+12
| | | | | C2, ... Update power_profile to use the new format. Update the man page to reflect this and give more info on Cx states.
* Rename acpi_cpu to cpu. Change the probe routine to early on rejectnjl2004-05-061-42/+90
| | | | | | devices it cannot attach to. This gets rid of extraneous but harmless device_probe_and_attach() errors. While I'm here, make the device description more useful. The !acpi case for cpu is handled by legacy0.
* Select the highest valid (i.e., S3) sleep state for the default for thenjl2004-05-062-11/+16
| | | | | sleep button. Change the default for the lid switch to NONE. This can be overridden in /etc/sysctl.conf as desired.
* Add back sys/reboot.h which is needed.njl2004-05-061-0/+1
|
* Make unnecessary globals static and remove unused includes.njl2004-05-065-7/+1
| | | | Pointed out by: cscout
* Fix setting debug strings via sysctl. Also, clean up the way we printnjl2004-05-061-14/+20
| | | | debug strings.
* Remove extra parentheses.njl2004-05-051-2/+2
|
* Add an MI implementation of the ACPI global lock routines and retire thenjl2004-05-051-0/+44
| | | | | | | | individual asm versions. The global lock is shared between the BIOS and OS and thus cannot use our mutexes. It is defined in section 5.2.9.1 of the ACPI specification. Reviewed by: marcel, bde, jhb
* Fix build breakage.takawata2004-04-261-1/+1
| | | | | Submitted by: Xin LI <delphij@frontfree.net> PR: 65979
* Move the call to AcpiEnterSleepStatePrep() to before we select the BSPnjl2004-04-261-6/+10
| | | | | (cpuid 0) as the processor. It mallocs some data and smp_rendezvous calls functions with locks held.
* Fix two typos from PR: 65694imp2004-04-261-1/+1
| | | | | | | | | | 1) In pci.c, we need to check the child device's state, not the parent device's state. 2) In acpi_pci.c, we have to run the power state change after the acpi method when the old_state is > new state, not the other way around. Submitted by: Dmitry Remesov PR: 65694
* Disable interrupts while testing the timer. Not doing this unnecessarilynjl2004-04-241-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | added an arbitrary delay to our readings, causing us to use the ACPI-safe read method when not necessary. Submitted by: bde Old: ACPI timer looks GOOD min = 3, max = 5, width = 2 ACPI timer looks BAD min = 3, max = 19, width = 16 ACPI timer looks GOOD min = 3, max = 5, width = 2 ACPI timer looks GOOD min = 3, max = 5, width = 2 ACPI timer looks GOOD min = 3, max = 5, width = 2 ACPI timer looks GOOD min = 3, max = 4, width = 1 ACPI timer looks GOOD min = 3, max = 5, width = 2 ACPI timer looks BAD min = 3, max = 19, width = 16 ACPI timer looks GOOD min = 3, max = 5, width = 2 ACPI timer looks GOOD min = 3, max = 4, width = 1 Timecounter "ACPI-safe" frequency 3579545 Hz quality 1000 New: ACPI timer looks GOOD min = 3, max = 4, width = 1 ACPI timer looks GOOD min = 3, max = 4, width = 1 ACPI timer looks GOOD min = 3, max = 4, width = 1 ACPI timer looks GOOD min = 3, max = 4, width = 1 ACPI timer looks GOOD min = 3, max = 4, width = 1 ACPI timer looks GOOD min = 3, max = 4, width = 1 ACPI timer looks GOOD min = 3, max = 4, width = 1 ACPI timer looks GOOD min = 3, max = 4, width = 1 ACPI timer looks GOOD min = 3, max = 4, width = 1 ACPI timer looks GOOD min = 3, max = 4, width = 1 Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000 Also, reduce unnecesary overhead in ACPI-fast by remove the barrier for reads. The timer in the ACPI-fast case is known to increase monotonically so there is no need to serialize access to it.
* Add the ACPI Asus extras driver. Provides support for cool ACPI-controledphilip2004-04-221-0/+1
| | | | | | | | | gadgets (hotkeys, lcd, ...) on Asus laptops. I aim to closely track the acpi4asus project which implements these features in the Linux kernel. If this breaks your laptop, please let me know how it does it :-) Approved by: njl (mentor)
* Fix stepping in ddb by not checking for a maximum interval. The ACPI-safenjl2004-04-221-31/+32
| | | | | | workaround was for hardware where the clock was not latched, not for hardware that was too slow. Also, make variable names more specific for ddb printing.
* Add comments, including restoring the PIIX4 errata comment, to indicatenjl2004-04-211-45/+76
| | | | | | | | | what the ACPI-safe workaround is intended to fix. Requested by phk. Set the bushandle and tag when attaching the timer, don't do it each time in read_counter(). Pointed out by bde. Move test_counter() to the end. Staticize acpi_timer_reg.
* Fix several bugs where 32-bit timers and wraparound were not properlynjl2004-04-211-110/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | supported. Symptoms of this bug included unnecessary use of ACPI-safe and a dmesg that has deltas of about 2^24: ACPI timer looks BAD min = 2, max = 16777206, width = 16777204 ACPI timer looks BAD min = 2, max = 7, width = 5 ACPI timer looks GOOD min = 4, max = 5, width = 1 ACPI timer looks BAD min = 2, max = 16777206, width = 16777204 ACPI timer looks BAD min = 2, max = 7, width = 5 ACPI timer looks BAD min = 2, max = 16777210, width = 16777208 ACPI timer looks BAD min = 4, max = 16777189, width = 16777185 ACPI timer looks GOOD min = 4, max = 5, width = 1 ACPI timer looks BAD min = 2, max = 7, width = 5 ACPI timer looks BAD min = 4, max = 16777189, width = 16777185 To fix this: * Use a 32 bit timecounter mask when the timer is 32 bits. * In test_counter(), use the acpi_TimerDelta function which handles 24/32 bit timers and wraparound. Miscellaneous fixes: * Use C99 initializers for timecounter struct. * Use u_int and uint32_t where appropriate instead of unsigned. * Remove whitespace-only lines * Remove the old PIIX4 PCI workaround. The timecounter testing code has been in use for long enough to prove it's functional.
OpenPOWER on IntegriCloud