summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica
Commit message (Collapse)AuthorAgeFilesLines
* Fix building for the ACPI_DEBUG case.njl2004-08-131-0/+1
|
* Record the new status after checking if it has changed, not before. Thisnjl2004-08-131-1/+1
| | | | | | fixes lost AC line transition events. Bug report: Kevin Oberman
* MPSAFE lockingnjl2004-08-131-38/+9
| | | | | | * Simplify taskqueue locking. * Don't acquire Giant around calls to the taskqueue function. * Remove 4.x compatibility routines.
* MPSAFE lockingnjl2004-08-131-22/+2
| | | | | | | * Remove the interrupt wrapper that locked Giant and call the handler directly. Mark the handler as MPSAFE. * Don't attempt to detect if a handler is installed. Leave that to the bus_alloc_resource() function.
* MPSAFE lockingnjl2004-08-131-24/+48
| | | | | | | | * Serialize operations in acpi_video_bind_outputs(), acpi_video_detach(), acpi_video_notify_handler(), acpi_video_power_profile(), and the sysctls. The main goal is to protect the shared device list and prevent conflicting settings. * Add assertions that the sx lock is held in the leaf functions.
* MPSAFE lockingnjl2004-08-131-120/+108
| | | | | | | | | | | | | * Restructure the event handling path. acpi_tz_thread() now calls acpi_tz_timeout() any time an event occurs. acpi_tz_timeout() checks the flags and calls acpi_tz_power_profile(), acpi_tz_establish(), and acpi_tz_monitor() as appropriate. Notifies only do a wakeup and let acpi_tz_thread() do the actual work. This path is cleaner and allows locking since the call path is now always a D.A.G. * Add the acpi_tz_signal() function to set flags and wake the thread. * Remove the tz_tmp_updating flag since calls are serialized by acpi_tz_thread(). * Remove Giant locking.
* MPSAFE locking: Add a comment that we need resource list and device_tnjl2004-08-131-0/+1
| | | | refcounting/locking.
* MPSAFE lockingnjl2004-08-131-33/+55
| | | | | | | | * Serialize acpi_pwr_switch_consumer() and acpi_pwr_wake_enable(). * Make acpi_pwr_switch_consumer() have a single exit point. * Add assertions to the leaf functions they call. * Fix a memory leak in acpi_pwr_deregister_consumer(). However, it is currently ifdefed out so this code was unused.
* MPSAFE lockingnjl2004-08-131-0/+9
| | | | | * Serialize calls to acpi_pcib_route_interrupt(). * Note that acpi_pcib_attach() should not be called concurrently.
* MPSAFE lockingnjl2004-08-131-6/+27
| | | | | | * Serialize access to acpi_pci_link_config(), acpi_pci_find_prt(), acpi_pci_link_route(), and acpi_pci_link_resume(). * Add lock assertions to all functions called by them.
* MPSAFE lockingnjl2004-08-131-4/+10
| | | | * Serialize access to acpi_pci_set_powerstate_method().
* MPSAFE lockingnjl2004-08-131-15/+33
| | | | | | | * Serialize notifying the user in acpi_lid_notify_status_changed(). This way multiple lid events occur in order. * Add an initialization pass to get the lid status at boot-time. This pass does not notify any apps but gets the initial status.
* MPSAFE lockingnjl2004-08-131-21/+19
| | | | | | * Use the common serialization macros instead of rolling our own. * Increase the coverage of the lock in EcSpaceHandler() to cover the entire loop to avoid dropping the lock when reading more than one byte.
* MPSAFE lockingnjl2004-08-131-15/+14
| | | | | * Hold the ACPI lock over table register writes. * Serialize calls to acpi_cpu_throttle_set() and the sysctls.
* MPSAFE lockingnjl2004-08-131-171/+127
| | | | | | | | | | | | | * Serialize ops in acpi_cmbat_notify_handler(), acpi_cmbat_ioctl(), acpi_cmbat_init_battery(), and acpi_cmbat_get_battinfo(). * Get the softc directly in acpi_cmbat_get_total_battinfo() rather than build an array of them. * Don't queue a _BIF query after receiving a notify. Since we clear the timespec, a _BIF query will be done in the context of the next caller. * Add asserts to leaf functions that operate on shared data. * Remove the bst/bif updating flags now that we hold the lock over the full query. * Explain various comments in more detail.
* MPSAFE lockingnjl2004-08-131-36/+53
| | | | | | | * Serialize acpi_battery_get_battdesc(), acpi_battery_register(), and acpi_battery_remove(). * Assert that the sx lock is held in acpi_batteries_init(). * Remove check for device_get_softc() returning NULL.
* MPSAFE lockingnjl2004-08-131-30/+16
| | | | | | | * Serialize notification of acline changes in acpi_acad_get_status(). * Remove the initializing flag. With the locking, we don't need to push off requests for the acline before initialization is done. * Don't check device_get_softc(), it can't return NULL.
* MPSAFE lockingnjl2004-08-131-35/+79
| | | | | | | | | | | | | | | * Serialize calls to acpi_alloc_resource(), acpi_release_resource(), acpi_Enable(), acpi_Disable(), and acpi_debug_sysctl(). * Acquire the ACPI mutex in acpi_register_ioctl(), acpi_deregister_ioctl(), and acpiioctl(). * Acquire the mutex while disabling subsequent requests to enter a sleep state in acpi_SetSleepState(). * Be sure to re-enable sleep requests and don't run resume methods when the current request fails. * Don't check if sleep requests are disabled in the ACPIIO_SETSLPSTATE ioctl. acpi_SetSleepState() does this for us. * Remove the acquisition of Giant from the struct cdevsw. * Remove the ACPI_USE_THREADS option.
* MPSAFE lockingnjl2004-08-131-28/+33
| | | | | | | | * Add and comment our locking primitives. The mutex primitives use a a static mutex and the serialization ones use a static sx lock. A global acpi_mutex is used for access to global resources (i.e., writes to the SMI_CMD register.) * Remove 4.x compat defines.
* Skip dependent functions when finding the resource from _PRS to use fornjl2004-08-121-4/+8
| | | | | | | later calls to _SRS. Add note that this code should be centralized at some point. Bug from: Jiawei Ye <leafy7382_AT_gmail.com>
* Only print the link name if there is a link. For the hardwired case, don'tnjl2004-08-121-4/+7
| | | | | | | bother printing it. This fixes a panic and acpi_name() has been more robust as well. Bug from: Tai-hwa Liang <avatar-at-mmlab.cse.yzu.edu.tw>
* Allow null handles to be passed into acpi_name().njl2004-08-121-1/+1
|
* Fix the PRT entry code in acpi_pci_link to always add the entry, even ifnjl2004-08-122-42/+44
| | | | | | | | | | | | | there is no irq link. Since we now use the stored copy of PRT, not the one that used to be passed into acpi_pcib_route_interrupt(), we need it in the list. [1] Fix a bug in acpi_pci_find_prt() where we weren't checking the bus, thus choosing the wrong PRT entry to use for routing the link. Also, add a printf for the case where the PRT entry is not found as this should not happen. Tested by: marcel [1]
* Add some more verbose warning/error messages to help with users reportingnjl2004-08-111-17/+12
| | | | problems with irq routing.
* Re-work ACPI PCI IRQ routing (_PRT, link devices). The old approach wasnjl2004-08-115-478/+329
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | incomplete in that the PRT routing was not aware of link programming. Fix this by doing all routing through the link devices. The new algorithm for setting up links is: 1. Read _CRS to get current setting. If invalid (not in _PRS), then set to 0. 2. Attempt to call _DIS on the link. If successful, mark the link as not routed. Otherwise, assume it still is. Then when a routing request occurs: 3. Update weights for all IRQs 4. Attempt to route the initial IRQ if valid 5. If that fails, walk through the sorted list, attempting to route IRQs. 6. Configure the trigger/polarity based on _PRS. Other changes: * Add acpi_pci_find_prt() to look up the PRT entry for a given device and acpi_pci_link_route() to select/route the best IRQ for it. * Remove duplicated code in acpi_pcib_route_interrupt() that picked the first IRQ from _PRS. * Remove unneeded arguments from acpi_pcib_resume() and friends. * Ignore _STA on link devices but report if it seems strange. * Add a prt_source handle to the PRT structure since the ACPI struct ACPI_PCI_ROUTING_TABLE uses a fixed-size entry for it. We'll need to dynamically size this object if we want to use it the same way ACPI-CA does. Null-terminate the source. Tested by: Luo Hong <luohong99_at_mails.tsinghua.edu.cn>, Jeffrey Katcher <jmkatcher_at_yahoo.com> Info from: jhb, Len Brown (Intel)
* Don't call DEVICE_RESUME a second time if DEVICE_SUSPEND fails. Thenjl2004-08-101-11/+10
| | | | | bus_generic_suspend method does this for us. Disable interrupts before entering S1. This may help some systems suspend to S1 successfully.
* Refine updates to PCI irq routing. Check _STA and _CRS but only print anjl2004-08-061-28/+39
| | | | | | message if they are incorrect. Also, remove the hack of allowing the initial irq setting to not be in _PRS. As before, the old behavior can be regained by defining ACPI_OLD_PCI_LINK.
* Add flags for _STA (status) methods and convenience macros for checkingnjl2004-08-062-4/+18
| | | | the presence of batteries and devices.
* Work around non-compliant BIOS PCI link devices. Some systems have thenjl2004-08-051-0/+31
| | | | | | | | | | | | | | | | | | | | | | following behavior: * Link devices return invalid status (_STA) values. The results are very unreliable -- sometimes never present. Just ignore the status and pick the best configuration from _PRS. * Link devices return invalid current settings (_CRS). Even after setting the link value, many systems still return a different setting for _CRS. When setting an IRQ, don't bother to check _CRS to see if we succeeded. Note that we still check _CRS before routing and this should be addressed as well. Since this is a sensitive area, leave the old behavior accessible via uncommenting the define for ACPI_OLD_PCI_LINK at the top of the file. Once this has been thoroughly tested, this option and the code it covers will be removed. Thanks to Len Brown at Intel for informing us of these issues as he worked around them in Linux.
* Fix the ACPI_DEBUG case by removing a now unused variable.njl2004-08-031-3/+0
|
* Initialize variables to fix kernel build on AMD64.obrien2004-08-031-0/+2
|
* /tmp/mnjl2004-08-031-188/+69
|
* Don't force an immediate probe/attach for all devices when compiled withnjl2004-07-261-3/+0
| | | | | | | | ACPI_DEBUG. This upset the ordering that acpi_probe_order() was meant to provide, causing devices to attach before the sysresource object. This debugging feature has been unnecessary for a while so just remove it. Testing by: marcel
* Fix a bug where an item was being removed from a list without usingnjl2004-07-241-34/+29
| | | | | | FOREACH_SAFE. Remove bad cast of retp and instead use an additional arg to pass back the number of valid outputs. Use the package convenience functions for parsing packages.
* Reinsert the bus space handle and tag, they are needed for the timer test.njl2004-07-221-0/+2
|
* Instead of doing everything in identify, do a proper probe/attach. Also,njl2004-07-221-23/+45
| | | | | | | don't add another device if identify is called twice. Minor reworking by myself. Submitted by: marcel
* Remove unused (and bogus) locking, style cleanup, remove unnecessary casts.njl2004-07-221-145/+84
|
* Use ACPI_ALL_NOTIFY instead of registering handlers separately.njl2004-07-162-8/+4
|
* Fix acpi_video loading. When we started cleaning up the duplicate handlesnjl2004-07-161-5/+4
| | | | | | | | | | | | | | | left around after the PCI probe, acpi_video stopped attaching because while it was an acpi child device, it really is a PCI device. Fix this by making it a PCI child. * Remove non-handle ivars accesses since child busses only implement acpi_get_handle(). * Access the acpi softc directly through the devclass instead of through the implied parent. * Clean up a potential panic on unload by freeing the sysctl context before storing NULL in the OID. Found by: marks
* Update the interface for child drivers. Add acpi_scan_children, whichnjl2004-07-152-21/+146
| | | | | | | allows a bus to re-enumerate its child handles and optionally replace them with new children, arranged to the bus's liking. (The current device space is flat with all devices immediately under acpi0). Add comments for each interface.
* Some laptops report the "design-capacity" instead of the "real-capacity"marks2004-07-141-0/+9
| | | | | | | | when the battery is fully charged. That breaks some of the arithmetic in calculating the remaining capacity (ends up with more than 100%). This commit makes sure the max is 100. Approved by: njl
* Follow PnP location string change in acpi.c.takawata2004-07-141-1/+1
|
* Clean up our pnpinfo and location strings.njl2004-07-131-7/+5
|
* Call device_identify routines after doing the namespace walk. This isnjl2004-07-131-8/+6
| | | | | | | | | needed so that sysresource objects are created first to reserve all regions, then other devices can allocate from them. Otherwise, acpi_timer (the only ACPI device with an identify routine), would allocate its resources from the nexus, causing the later sysresource reserve to fail. Debugging by: Taku YAMAMOTO, Andrea Campi
* Add the ability to detach a battery. Now batteries that are detached arenjl2004-07-123-1/+33
| | | | also removed from the battery list.
* Update for the KDB framework:marcel2004-07-101-2/+3
| | | | o Call kdb_enter() instead of Debugger().
* Make the default memory range in the top 2GB of ram in the hopes thatimp2004-07-041-3/+5
| | | | | | | this more accurately reflects what the underlying hardware of most acpi machines that don't have children pci busses. We still need a better way to get this information from acpi/hardware.
* Remove duplicate FreeBSD id.njl2004-07-021-2/+0
|
* Get rid of the strict aliasing error by retrieving the ECDT via a tablenjl2004-07-021-2/+3
| | | | | | header pointer and then casting it to the ecdt pointer. This fixes the -O2 build. I'm unsure what changed recently to reveal this error since this code has been unchanged for months.
* After re-exporting rman, et al, __RMAN_RESOURCE_VISIBLE is no longerimp2004-07-011-1/+0
| | | | | necessary for this file. It just needed the size and guts of struct rman.
OpenPOWER on IntegriCloud