summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica
Commit message (Collapse)AuthorAgeFilesLines
* Add more definitions for vendor-specific CPU capability bits to the lastjkim2011-02-251-11/+13
| | | | revision, which is renamed to "Intel Processor Vendor-Specific ACPI".
* Rework r218685. Copy just enough data for the resource type.jkim2011-02-141-23/+22
| | | | Reviewed by: jhb, mdf
* Prevent reading from the ACPI_RESOURCE past its actual end. Formdf2011-02-141-1/+5
| | | | | | | paranoia limit to the size of the ACPI_RESOURCE as well. Reviewd by: jhb (in spirit) MFC after: 1 week
* Use the preload_fetch_addr() and preload_fetch_size() conveniencemarcel2011-02-131-11/+13
| | | | | | functions to obtain the address and size of the overriding DSDT. Sponsored by: Juniper Networks.
* Fix a few more SYSCTL_PROC() that were missing a CTLFLAG type specifier.mdf2011-01-191-1/+1
|
* Remove bogus check. pcib_get_bus() (like other BUS_ACCESSOR() methods)jhb2011-01-181-2/+0
| | | | | | | | | doesn't "fail", it may merely return garbage if it is not a valid ivar for a given device. Our parent device must be a 'pcib' device, so we can just assume it implements pcib IVARs, and all pcib devices have a bus number. Submitted by: clang via rdivacky
* Work around a witness(4) panic introduced in r217238.jkim2011-01-111-8/+26
| | | | Reported by: jh
* Fix a witness(4) warning introduced in r217238.jkim2011-01-111-13/+18
|
* Remove impossible error conditions.jkim2011-01-101-4/+2
|
* Add forgotten free(9) in the previous commit for an error case.jkim2011-01-101-0/+1
|
* Allow AcpiOsInstallInterruptHandler() and AcpiOsRemoveInterruptHandler() tojkim2011-01-102-84/+149
| | | | | | | | | install or remove non-SCI interrupt handlers per ACPI Component Architecture User Guide and Programmer Reference. ACPICA may install such interrupt handler when a GPE block device is found, for example. Add a wrapper for ACPI_OSD_HANDLER, convert its return values to ours, and make it a filter. Prefer KASSERT(9) over panic(9) as we have never seen those in reality. Clean up some style(9) nits and add my copyright.
* Prefer KASSERT(9) over panic(9) as it was never seen in reality.jkim2011-01-101-2/+1
|
* Clarify the previous commit. AcpiFinishGpe() will not clear GPE for usjkim2011-01-041-1/+3
| | | | because we set it to edge-trigger.
* Clear GPE from a query handler if the task was deferred.jkim2011-01-041-8/+11
|
* Fix parameters for wakeup(9) and tsleep(9).jkim2011-01-031-2/+2
| | | | MFC after: 3 days
* Don't try to reserve a resource that is already allocated. If the ECDTjhb2010-12-231-0/+8
| | | | | | | table is present, then the acpi_ec(4) driver will allocate its resources from nexus0 before the acpi0 device reserves resources for child devices. Reviewed by: jkim
* Use resource_list_reserve() to reserve I/O port and memory resources forjhb2010-12-222-69/+195
| | | | | ACPI devices even if they are not allocated by a device driver since the resources are in use and should not be allocated to another device.
* small cleanup of acpi battery status setting and checkingavg2010-12-174-4/+23
| | | | | | | | | | | | | This is based on the patch submitted by Yuri Skripachov. Overview of the changes: - clarify double-use of some ACPI_BATT_STAT_* definitions - clean up undefined/extended status bits returned by _BST - warn about charging+discharging bits being set at the same time PR: kern/124744 Submitted by: Yuri Skripachov <y.skripachov@gmail.com> Tested by: Yuri Skripachov <y.skripachov@gmail.com> MFC after: 2 weeks
* Small style fixes:jhb2010-12-161-14/+12
| | | | | | | | | - Avoid side-effect assignments in if statements when possible. - Don't use ! to check for NULL pointers, explicitly check against NULL. - Explicitly check error return values against 0. - Don't use INTR_MPSAFE for interrupt handlers with only filters as it is meaningless. - Remove unneeded function casts.
* Spelling fix.jhb2010-12-161-1/+1
|
* Merge ACPICA 20101209.jkim2010-12-153-11/+27
|
* Stop lying about supporting cpu_est_clockrate() when TSC is invariant. Thisjkim2010-12-141-0/+11
| | | | | | | | | function always returned the nominal frequency instead of current frequency because we use RDTSC instruction to calculate difference in CPU ticks, which is supposedly constant for the case. Now we support cpu_get_nominal_mhz() for the case, instead. Note it should be just enough for most usage cases because cpu_est_clockrate() is often times abused to find maximum frequency of the processor.
* Use proper resource ID's for HPET IRQ resources. This mostly consists ofjhb2010-12-071-1/+19
| | | | | | | | looking to see if there is an existing IRQ resource for a given IRQ provided by the BIOS and using that RID if so. Otherwise, allocate a new RID for the new IRQ. Reviewed by: mav (a while ago)
* Various small typos and grammar nits in comments.jhb2010-11-181-2/+2
|
* Create C1 state when _CST is valid but _CST does not have one. Some BIOSesjkim2010-11-121-4/+26
| | | | | | | do not report C1 state in _CST object, probably because it is a mandatory state with or without existence of the optional _CST. Reviewed by: avg
* Make APM emulation look more closer to its origin. Use device_get_softc(9)jkim2010-11-101-1/+1
| | | | instead of hardcoding acpi(4) unit number as we have device_t for it.
* Refactor acpi_machdep.c for amd64 and i386, move APM emulation into a newjkim2010-11-101-0/+3
| | | | file acpi_apm.c, and place it on sys/x86/acpica.
* Consistently use padding `_' in the comment.jkim2010-11-081-1/+1
|
* Add a forgotten change from the previous commit.jkim2010-11-051-1/+1
|
* Fix a use-after-free bug for extended IRQ resource[1]. When _PRS buffer isjkim2010-11-051-44/+34
| | | | | | | | | | | | | | copied as a template for _SRS, a string pointer for descriptor name is also copied and it becomes stale as soon as it gets de-allocated[2]. Now _CRS is used as a template for _SRS as ACPI specification suggests if it is usable. The template from _PRS is still utilized but only when _CRS is not available or broken. To avoid use-after-free the problem in this case, however, only mandatory fields are copied, optional data is removed, and structure length is adjusted accordingly. Reported by: hps[1] Analyzed by: avg[2] Tested by: hps
* Adjust a comment to clarify why \_SB_ and \_TZ_ are defined as device typejkim2010-11-031-16/+14
| | | | | in ACPICA. Reshuffle the code a bit to make sure this kludge only applies to these two specical cases and to make it cleaner.
* Add two new loader tunables 'hw.acpi.install_interface' andjkim2010-10-261-0/+106
| | | | | | | | | | | | | | | | | | | 'hw.acpi.remove_interface'. hw.acpi.install_interface lets you install new interfaces. Conversely, hw.acpi.remove_interface lets you remove OS interfaces from the pre-defined list in ACPICA. For example, hw.acpi.install_interface="FreeBSD" lets _OSI("FreeBSD") method to return 0xffffffff (or success) and hw.acpi.remove_interface="Windows 2009" lets _OSI("Windows 2009") method to return zero (or failure). Both are comma-separated lists and leading white spaces are ignored. For example, the following examples are valid: hw.acpi.install_interface="Linux, FreeBSD" hw.acpi.remove_interface="Windows 2006, Windows 2006.1"
* Introduce a new tunable 'hw.pci.do_power_suspend'. This tunable lets youjkim2010-10-201-1/+1
| | | | | avoid PCI power state transition from D0 to D3 for suspending case. Default is 1 or enabled.
* Remove undocumented and stale debug.acpi.do_powerstate tunable. It wasjkim2010-10-191-12/+0
| | | | | | | added with hw.pci.do_powerstate but the PCI version was splitted into two separate tunables later and now this is completely stale. To make it worse, PCI devices enumerated in ACPI tree ignore this tunable as it is handled by a function in acpi_pci.c instead.
* Remove PCI_SET_POWERSTATE method from acpi.c and eradicate all PCI-specificjkim2010-10-193-96/+68
| | | | | | | | | | | | | | knowledges from the file. All PCI devices enumerated in ACPI tree must use correct one from acpi_pci.c any way. Reduce duplicate codes as we did for pci.c in r213905. Do not return ESRCH from PCIB_POWER_FOR_SLEEP method. When the method is not found, just return zero without modifying the given default value as it is completely optional. As a side effect, the return state must not be NULL. Note there is actually no functional change by removing ESRCH because acpi_pcib_power_for_sleep() always returns zero. Adjust debugging messages and add new ones under bootverbose to help debugging device power state related issues. Reviewed by: jhb, imp (earlier versions)
* Make any PCI devices enumerated in ACPI tree honor do_power_resume as well.jkim2010-10-191-1/+1
|
* Clean up unused headers.jkim2010-10-131-4/+0
|
* Remove acpi_bus_number() completely. It had to be removed in r212761.jkim2010-10-131-55/+0
| | | | Pointed out by: jhb
* Mark acpi_bus_number() as __unused. This allows clang to this filerpaulo2010-10-131-1/+1
| | | | without any warnings.
* Use AcpiReset() from ACPICA instead of rolling our own, which is actuallyjkim2010-10-131-10/+10
| | | | | incomplete. If FADT says the register is available, enable the capability by default. Remove the previous default value from acpi(4).
* acpi_ec: changes in communication with hardwareavg2010-10-121-83/+89
| | | | | | | | | | | | | | | | | | Short description of the changes: - attempt to retry some commands for which it is possible (read, query) - always make a short sleep before checking EC status in polled mode - periodically poll EC status in interrupt mode - change logic for detecting broken interrupt delivery and falling back to polled mode - check that EC is ready for input before starting a new command, wait if necessary This commit is based on the original patch by David Naylor. PR: kern/150517 Submitted by: David Naylor <naylor.b.david@gmail.com> Reviewed by: jkim MFC after: 3 weeks
* Do not use regular interrupts on NVidia HPETs. NVidia MCP5x chipsets havemav2010-09-301-0/+7
| | | | | | number of unexplained interrupt problems. For some reason, using HPET interrupts there breaks HDA sound. Legacy route mode interrupts reported to work fine there.
* Quick fix for unmotivated C2 state usage during boot, introduced at r212541.mav2010-09-221-1/+1
| | | | That caused LAPIC timer failure and huge delays during boot on some systems.
* acpi_attach: do not explicitly install default handlers for defaultavg2010-09-221-23/+0
| | | | | | | | | | | | | | | | | | address spaces There has been no need to do that starting with ACPICA 20040427 as AcpiEnableSubsystem() installs the handlers automatically. Additionaly, explicitly calling AcpiInstallAddressSpaceHandler before AcpiEnableSubsystem is not supported by ACPICA and leads to too early execution of _REG methods in some DSDTs, which may result in problems. Big thanks to Robert Moore of ACPICA/Intel for explaining the above. Reported by: Daniel Bilik <daniel.bilik@neosystem.cz> Tested by: Daniel Bilik <daniel.bilik@neosystem.cz> Reviewed by: jkim Suggested by: "Moore, Robert" <robert.moore@intel.com> MFC after: 1 week
* Merge ACPICA 20100915.jkim2010-09-161-36/+0
|
* acpi_cpu: do not apply P_LVLx_LAT rules to latencies returned by _CSTavg2010-09-131-9/+1
| | | | | | | | | | | | | ACPI specification sates that if P_LVL2_LAT > 100, then a system doesn't support C2; if P_LVL3_LAT > 1000, then C3 is not supported. But there are no such rules for Cx state data returned by _CST. If a state is not supported it should not be included into the return package. In other words, any latency value returned by _CST is valid, it's up to the OS and/or user to decide whether to use it. Submitted by: nork Suggested by: mav MFC after: 1 week
* Refactor timer management code with priority to one-shot operation mode.mav2010-09-132-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main goal of this is to generate timer interrupts only when there is some work to do. When CPU is busy interrupts are generating at full rate of hz + stathz to fullfill scheduler and timekeeping requirements. But when CPU is idle, only minimum set of interrupts (down to 8 interrupts per second per CPU now), needed to handle scheduled callouts is executed. This allows significantly increase idle CPU sleep time, increasing effect of static power-saving technologies. Also it should reduce host CPU load on virtualized systems, when guest system is idle. There is set of tunables, also available as writable sysctls, allowing to control wanted event timer subsystem behavior: kern.eventtimer.timer - allows to choose event timer hardware to use. On x86 there is up to 4 different kinds of timers. Depending on whether chosen timer is per-CPU, behavior of other options slightly differs. kern.eventtimer.periodic - allows to choose periodic and one-shot operation mode. In periodic mode, current timer hardware taken as the only source of time for time events. This mode is quite alike to previous kernel behavior. One-shot mode instead uses currently selected time counter hardware to schedule all needed events one by one and program timer to generate interrupt exactly in specified time. Default value depends of chosen timer capabilities, but one-shot mode is preferred, until other is forced by user or hardware. kern.eventtimer.singlemul - in periodic mode specifies how much times higher timer frequency should be, to not strictly alias hardclock() and statclock() events. Default values are 2 and 4, but could be reduced to 1 if extra interrupts are unwanted. kern.eventtimer.idletick - makes each CPU to receive every timer interrupt independently of whether they busy or not. By default this options is disabled. If chosen timer is per-CPU and runs in periodic mode, this option has no effect - all interrupts are generating. As soon as this patch modifies cpu_idle() on some platforms, I have also refactored one on x86. Now it makes use of MONITOR/MWAIT instrunctions (if supported) under high sleep/wakeup rate, as fast alternative to other methods. It allows SMP scheduler to wake up sleeping CPUs much faster without using IPI, significantly increasing performance on some highly task-switching loads. Tested by: many (on i386, amd64, sparc64 and powerc) H/W donated by: Gheorghe Ardelean Sponsored by: iXsystems, Inc.
* Add tunable 'hint.hpet.X.per_cpu' to specify how much per-CPU timers drivermav2010-09-131-1/+7
| | | | should provide if there is sufficient hardware. Default is 1.
* Instead of storing last event timestamp, store the next event timestamp.mav2010-09-121-19/+28
| | | | It corrects handling of the first event offset in emulated periodic mode.
* bus_add_child: change type of order parameter to u_intavg2010-09-102-4/+4
| | | | | | | | | | This reflects actual type used to store and compare child device orders. Change is mostly done via a Coccinelle (soon to be devel/coccinelle) semantic patch. Verified by LINT+modules kernel builds. Followup to: r212213 MFC after: 10 days
OpenPOWER on IntegriCloud