summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica
Commit message (Collapse)AuthorAgeFilesLines
* 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
* During SMP startup there is time window, when SMP started, but interruptsmav2010-09-081-1/+26
| | | | | | | are still bound to BSP. It confuses timer management logic in per-CPU mode and may cause timer not being reloaded. Check such cases on interrupt arival and reload timer to give system some more time to manage proper binding.
* Several improvements to HPET driver:mav2010-09-051-22/+55
| | | | | | | | | | | | | | | | | - Add special check for case when time expires before being programmed. This fixes interrupt loss and respectively timer death on attempt to program very short interval. Increase minimal supported period to more realistic value. - Add support for hint.hpet.X.allowed_irqs tunable, allowing manually specify which interrupts driver allowed to use. Unluckily, many BIOSes program wrong allowed interrupts mask, so driver tries to stay on safe side by not using unshareable ISA IRQs. This option gives control over this limitation, allowing more per-CPU timers to be provided, when FSB interrupts are not supported. Value of this tunable is bitmask. - Do not use regular interrupts on virtual machines. QEMU and VirtualBox do not support them properly, that may cause problems. Stay safe by default. Same time both QEMU and VirtualBox work fine in legacy_route mode. VirtualBox also works fine if manually specify allowed ISA IRQs with above.
* acpi: update stale comments about order of cpu devices probingavg2010-09-031-6/+5
| | | | | | | | These comments should have been updated in r203776 when the order was changed. Pointyhat to: avg MFC after: 3 days
* Add a new method to the PCI bridge interface, PCIB_POWER_FOR_SLEEP(). Thisjhb2010-08-176-3/+18
| | | | | | | | | | method is used by the PCI bus driver to query the power management system to determine the proper device state to be used for a device during suspend and resume. For the ACPI PCI bridge drivers this calls acpi_device_pwr_for_sleep(). This removes ACPI-specific knowledge from the PCI and PCI-PCI bridge drivers. Reviewed by: jkim
* When EC burst mode is activated and multiple bytes are accessed, do notjkim2010-08-061-54/+27
| | | | | disable and enable repeatedly, just do it once per call. It also reduces code duplication. Check all parameters early and fail immediately.
* Merge ACPICA 20100806.jkim2010-08-062-7/+1
|
* - Retire acpi_pcib_resume(). It is has just been an alias forjhb2010-08-054-46/+5
| | | | | | | | | bus_generic_resume() since the pci_link(4) driver was added. - Change the ACPI PCI-PCI bridge driver to inherit most of its methods from the generic PCI-PCI bridge driver. In particular, this will now restore PCI config registers for ACPI PCI-PCI bridges. Tested by: Oleg Sharoyko osharoiko of gmail
* Fix several un-/signedness bugs of r210290 and r210293. Add one more check.mav2010-07-201-3/+3
|
* Extend timer driver API to report also minimal and maximal supported periodmav2010-07-201-5/+11
| | | | | | lengths. Make MI wrapper code to validate periods in request. Make kernel clock management code to honor these hardware limitations while choosing hz, stathz and profhz values.
* Simplify AcpiOsReadPort() and AcpiOsWritePort() with iodev_read_*() andjkim2010-07-161-22/+7
| | | | | iodev_write_*(). This removes unnecessary uses of temporary macros as well. There is no functional change after this (verified with md5(1) on amd64).
* Use pmap_mapdev()/pmap_unmapdev() to map device memory instead of usingjkim2010-07-161-4/+4
| | | | | | | AcpiOsMapMemory()/AcpiOsUnmapMemory() (-> pmap_mapbios()/pmap_unmapbios()) for AcpiOsReadMemory() and AcpiOsWriteMemory(). Although they do not sound too obvious, these functions are exclusively used to access memory mapped IO in ACPICA.
* If there is any pending sleep request, disallow entering S5 state.jkim2010-07-151-14/+12
| | | | Otherwise, bad things may happen. ;-)
* - AcpiOsReadPciConfiguration() needs similar fixes as r209965 and r210129.jkim2010-07-151-26/+9
| | | | | | | | | According to ACPICA User Guide and Programmer Reference, the read data must be zero extended to fill the 64-bit return value even if the bit width of the location is less than 64. - Return error when 64-bit access is requested as we do not support 64-bit PCI register access (yet). XXX We may have to split it up into two 32-bit accesses if it is really required.
* - AcpiOsReadMemory() needs similar fixes as r209965. [1]jkim2010-07-151-18/+6
| | | | | | | | | | | | According to ACPICA User Guide and Programmer Reference, the read data must be zero extended to fill the 32-bit return value even if the bit width of the port is less than 32. - Remove 64-bit read/write from AcpiOsReadMemory() and AcpiOsWriteMemory(). These functions do not support 64-bit access (yet). Clean up style nits and unnecessary bit masking while I am here. Reported by: Liu, Jinsong (jinsong dot liu at intel dot com) via Lin Ming (ming dot m dot lin at intel dot com) [1]
* Make SMP code path conditional at run-time.jkim2010-07-131-12/+10
|
OpenPOWER on IntegriCloud