summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica
Commit message (Collapse)AuthorAgeFilesLines
* Do not hold the ACPI A/C adapter lock when changing the power profile.jhb2009-09-301-2/+3
| | | | MFC after: 2 weeks
* Split the 'video' ACPI lock up into two locks to resolve a LOR with thejhb2009-09-301-10/+26
| | | | | | | | | | sysctl lock. The 'video' lock now protects the 'bus' of video output devices attached to a graphics adapter. It is used when iterating over the list of outputs, etc. The 'video_output' lock is used to lock the output-specific data similar to a driver lock for the individual video outputs. MFC after: 2 weeks
* Copy apm(4) emulation from sys/i386/acpica/acpi_machdep.c andjkim2009-09-271-7/+1
| | | | install apm(8) and apm_bios.h on amd64.
* Extract the code to find and map the MADT ACPI table during early kerneljhb2009-09-232-0/+27
| | | | | | | | | startup and genericize it so it can be reused to map other tables as well: - Add a routine to walk a list of ACPI subtables such as those used in the APIC and SRAT tables in the MI acpi(4) driver. - Move the routines for mapping and unmapping an ACPI table as well as mapping the RSDT or XSDT and searching for a table with a given signature out into acpica_machdep.c for both amd64 and i386.
* Uninline an instance of STAILQ_FOREACH_SAFE().jhb2009-09-231-2/+1
|
* Catch up with ACPICA 20090903.jkim2009-09-114-126/+84
|
* Tweak the way that the ACPI and ISA bus drivers match hint devices tojhb2009-08-241-2/+18
| | | | | | | | | | | | | | | BIOS-enumerated devices: - Assume a device is a match if the memory and I/O ports match even if the IRQ or DRQ is wrong or missing. Some BIOSes don't include an IRQ for the atrtc device for example. - Add a hack to better match floppy controller devices. Many BIOSes do not include the starting port of the floppy controller listed in the hints (0x3f0) in the resources for the device. So far, however, all the BIOS variations encountered do include the 'port + 2' resource (0x3f2), so adjust the matching for "fdc" devices to look for 'port + 2'. Reviewed by: imp MFC after: 3 days
* Temporarily revert the new-bus locking for 8.0 release. It will bejhb2009-08-205-26/+16
| | | | | | reintroduced after HEAD is reopened for commits by re@. Approved by: re (kib), attilio
* Make the newbus subsystem Giant free by adding the new newbus sxlock.attilio2009-08-025-16/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The newbus lock is responsible for protecting newbus internIal structures, device states and devclass flags. It is necessary to hold it when all such datas are accessed. For the other operations, softc locking should ensure enough protection to avoid races. Newbus lock is automatically held when virtual operations on the device and bus are invoked when loading the driver or when the suspend/resume take place. For other 'spourious' operations trying to access/modify the newbus topology, newbus lock needs to be automatically acquired and dropped. For the moment Giant is also acquired in some key point (modules subsystem) in order to avoid problems before the 8.0 release as module handlers could make assumptions about it. This Giant locking should go just after the release happens. Please keep in mind that the public interface can be expanded in order to provide more support, if there are really necessities at some point and also some bugs could arise as long as the patch needs a bit of further testing. Bump __FreeBSD_version in order to reflect the newbus lock introduction. Reviewed by: ed, hps, jhb, imp, mav, scottl No answer by: ariff, thompsa, yongari Tested by: pho, G. Trematerra <giovanni dot trematerra at gmail dot com>, Brandon Gooch <jamesbrandongooch at gmail dot com> Sponsored by: Yahoo! Incorporated Approved by: re (ksmith)
* Match PCI Express root bridge _HID directly instead ofjkim2009-07-131-1/+1
| | | | | | | relying on _CID. Reviewed by: jhb Approved by: re (kib)
* Add a missing return in NULL mutex case.jkim2009-06-221-1/+3
| | | | Submitted by: Pawel Worach (pawel dot worach at gmail dot com)
* - Remove unnecessary read memory barriers from atomic operations[1].jkim2009-06-111-2/+4
| | | | | | - Define a macro to make my intention more clearer. Submitted by: jhb [1]
* Catch up with r193750 (OsdSynch.c locking changes):jkim2009-06-102-16/+97
| | | | | | | | | | - Preallocate some memory for ACPI tasks early enough. We cannot use malloc(9) any more because spin mutex may be held here. The reserved memory can be tuned via debug.acpi.max_tasks tunable or ACPI_MAX_TASKS in kernel configuration. The default is 32 tasks. - Implement a custom taskqueue_fast to wrap the new memory allocation. This implementation is not the fastest in the world but we are being conservative here.
* Rework the _BBN handling for Host-PCI bridges. Previously we only trustedjhb2009-06-091-18/+25
| | | | | | | | | | | | | | a _BBN value of 0 if it was for the first bridge encountered since some older systems returned _BBN of 0 for all bridges. However, some newer systems enumerate bridges with non-zero _BBN before bus 0 which is perfectly valid. Handle both cases by trusting the first bridge that has a _BBN of 0 and falling back to reading from non-standard config registers only for subsequent bridges with a _BBN of 0. We also only perform this check for segment (domain) 0. We assume that _BBN is always correct for segments other than 0. Tested by: Josef Moellers josef.moellers at fujitsu MFC after: 1 week
* Remove redundant checks for ACPI_WAIT_FOREVER cases.jkim2009-06-081-4/+0
|
* Rewrite OsdSynch.c to reflect the latest ACPICA more closely:jkim2009-06-081-267/+445
| | | | | | - Implement ACPI semaphore (ACPI_SEMAPHORE) with condvar(9) and mutex(9). - Implement ACPI mutex (ACPI_MUTEX) with mutex(9). - Implement ACPI lock (ACPI_SPINLOCK) with spin mutex(9).
* Import ACPICA 20090521.jkim2009-06-0535-157/+120
|
* We no longer need to use d_thread_t, migrate to struct thread *.imp2009-05-201-3/+3
|
* Make dev.cpu.X.cx_usage sysctl also report current average of sleep time.mav2009-05-031-1/+2
|
* Remove unused variable and fix spelling in comment.mav2009-05-031-2/+1
|
* Avoid comparing negative signed to positive unsignad values. It wasmav2009-05-021-41/+11
| | | | | | | | | | leading to a bug, when C-state does not decrease on sleep shorter then declared transition latency. Fixing this deprecates workaround for broken C-states on some hardware. By the way, change state selecting logic a bit. Instead of last sleep time use short-time average of it. Global interrupts rate in system is a quite random value, to corellate subsequent sleeps so directly.
* Fix off-by-one bug. S5 state must be checked as well.jkim2009-04-301-1/+1
|
* Fix style(9).jkim2009-04-301-2/+2
|
* Prefer device_printf() over printf() where ever possible.jkim2009-04-301-25/+29
|
* General sleep state change clean up.jkim2009-04-301-68/+110
| | | | | | | | | | | | | | | | | | | | - Probe supported sleep states from acpi_attach() just once and do not call AcpiGetSleepTypeData() again. It is redundant because AcpiEnterSleepStatePrep() does it any way. - Treat UNKNOWN sleep state as NONE, i.e., "do nothing", and remove obscure NONE state (ACPI_S_STATES_MAX + 1) to avoid confusions. - Do not set unsupported sleep states as default button/switch events. If the default sleep state is not supported, just set it as UNKNOWN/NONE. - Do not allow sleep state change if the system is not fully up and running. This should prevent entering S5 state multiple times, which causes strange behaviours later. - Make sleep states case-insensitive when they are used with sysctl(8). For example, sysctl hw.acpi.lid_switch_state=s1 sysctl hw.acpi.sleep_button_state=none are now legal and equivalent to the uppercase ones.
* acpi: do not run resume/backout code when entering S0/S5 statesavg2009-04-281-73/+66
| | | | | | | | | | | | | | | | | This change adds (possibly redundant) early check for invalid state input parameter (including S0). Handling of S5 request is reduced to simply calling shutdown_nice(). As a result control flow of acpi_EnterSleepState is somewhat simplified and resume/backout half of the function is not executed for S5 (soft poweroff) request and invalid state requests. Note: it seems that shutdown_nice may act as nop when initproc is already initialized (to grab pid of 1), but init process is in "pre-natal" state. Tested by: Fabian Keil <fk@fabiankeil.de> Reviewed by: njl, jkim Approved by: rpaulo
* Move the code to update cpu_cx_count out of acpi_cpu_generic_cx_probe() andjhb2009-03-261-4/+2
| | | | | | | | | | | into acpi_cpu_startup() which is where all the other code to update this global variable lives. This fixes a bug where cpu_cx_count was not updated correctly if acpi_cpu_generic_cx_probe() returned early. PR: kern/108581 Debugged by: Bruce Cran Reviewed by: avg, njl, sepotvin MFC after: 3 days
* Add a function to reset system time after resuming, which will be usedjkim2009-03-232-4/+22
| | | | | by amd64 shortly. It can be turned off by setting "debug.acpi.reset_clock" tunable to zero.
* Check whether devd is running before calling resume notifier andjkim2009-03-231-19/+34
| | | | reshuffle code to reduce unnecessary locking coverage.
* Initial suspend/resume support for amd64.jkim2009-03-172-13/+42
| | | | | | This code is heavily inspired by Takanori Watanabe's experimental SMP patch for i386 and large portion was shamelessly cut and pasted from Peter Wemm's AP boot code.
* acpi_cpu: fixup for PIIX4E PCI config related to C2avg2009-02-191-1/+11
| | | | | | | | | | | | | | | | | This is triggered only if BIOS configures ACPI_BITREG_BUS_MASTER_RLD aka BRLD_EN_BM to 1. Rationale: 1. we do not support C3 on PIIX4E 2. bus master activity need not break out of C2 state 3. because of CPU_QUIRK_NO_BM_CTRL quirk we may reset bus master status which would result in immediate break out from C2 So if you have seen cpu0: too many short sleeps, backing off to C1 with this chipset before you may want to try cx_lowest of C2 again. Reviewed by: rpaulo (mentor), njl Approved by: rpaulo (mentor)
* pcib_read_config and pcib_write_config take u_int params.imp2009-02-051-8/+9
|
* Convert battery capacity/rate from mA to mW only when summary is requested.mav2009-01-171-1/+1
| | | | | | Unconditional conversion causes incorrect rate units reported by acpiconf. MFC after: 2 weeks
* Quick change to r186026. One of the conditionals was:silby2008-12-131-1/+1
| | | | | | | | | | | | | | | | if (batt_sleep_ms) AcpiOsSleep(1); where the rest are all: if (batt_sleep_ms) AcpiOsSleep(batt_sleep_ms); I can't recall why that one was different, so change it to match the rest. Pointed out by: Christoph Mallon MFC after: 2 weeks
* Add the sysctl debug.acpi.batt.batt_sleep_ms.silby2008-12-131-0/+34
| | | | | | | | | | | | | | | On some laptops with smart batteries, enabling battery monitoring software causes keystrokes from atkbd to be lost. This has also been reported on Linux, and is apparently due to the keyboard and I2C line for the battery being routed through the same chip. Whether that's accurate or not, adding extra sleeps to the status checking code causes the problem to go away. I've been running this for nearly six months now on my laptop, it works like a charm. Reviewed by: Nate Lawson (in a previous revision) MFC after: 2 weeks
* Remove unused variable.ganbold2008-11-251-2/+1
| | | | | | | Found with: Coverity Prevent(tm) CID: 3678 Approved by: njl
* Make sure legacy replacement route is turned off when enbling HPET.jkim2008-11-191-2/+5
| | | | Reviewed by: jhb
* Allow device hints to wire the unit numbers of devices.jhb2008-11-181-0/+86
| | | | | | | | | | | | | | | | | | | | - An "at" hint now reserves a device name. - A new BUS_HINT_DEVICE_UNIT method is added to the bus interface. When determining the unit number of a device, this method is invoked to let the bus driver specify the unit of a device given a specific devclass. This is the only way a device can be given a name reserved via an "at" hint. - Implement BUS_HINT_DEVICE_UNIT() for the acpi(4) and isa(4) bus drivers. Both of these busses implement this by comparing the resources for a given hint device with the resources enumerated by ACPI/PnPBIOS and wire a unit if the hint resources are a subset of the "real" resources. - Use bus_hinted_children() for adding hinted devices on isa(4) busses now instead of doing it by hand. - Remove the unit kludging from sio(4) as it is no longer necessary. Prodding from: peter, imp OK'd by: marcel MFC after: 1 month
* Remove " + 1".mav2008-11-031-1/+1
| | | | Thread ID can't be zero anyway while increment may give owerflow.
* Make the no driver stuff an ifdef.imp2008-11-021-4/+9
|
* As soon as we have several threads per process now, it is not correct tomav2008-11-021-5/+1
| | | | | | | | use process ID as ACPI thread ID. Concurrent requests with equal thread IDs broke ACPI mutexes operation causing unpredictable errors including AE_AML_MUTEX_NOT_ACQUIRED that I have seen. Use kernel thread ID instead of process ID for ACPI thread.
* Clean up DSDT and XSDT correctly instead of FADT when the tables are bad.jkim2008-09-191-2/+2
| | | | | | Submitted by: jhb Tested by: olli MFC after: 3 days
* Handle errors from device_get_children.imp2008-08-231-4/+9
|
* Extend the support for PCI-e memory mapped configuration space access:jhb2008-08-221-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | - Rename pciereg_cfgopen() to pcie_cfgregopen() and expose it to the rest of the kernel. It now also accepts parameters via function arguments rather than global variables. - Add a notion of minimum and maximum bus numbers and reject requests for an out of range bus. - Add more range checks on slot/func/reg/bytes parameters to the cfg reg read/write routines. Don't panic on any invalid parameters, just fail the request (writes do nothing, reads return -1). This matches the behavior of the other cfg mechanisms. - Port the memory mapped configuration space access to amd64. On amd64 we simply use the direct map (via pmap_mapdev()) for the memory mapped window. - During acpi_attach() just after loading the ACPI tables, check for a MCFG table. If it exists, call pciereg_cfgopen() on each subtable (memory mapped window). For now we only support windows for domain 0 that start with bus 0. This removes the need for more chipset-specific quirks in the MD code. - Remove the chipset-specific quirks for the Intel 5000P/V/Z chipsets since these machines should all have MCFG tables via ACPI. - Updated pci_cfgregopen() to DTRT if ACPI had invoked pcie_cfgregopen() earlier. MFC after: 2 weeks
* Fix a typo.jhb2008-08-041-1/+1
|
* Further refine the probe order of devices to more closely match the previousjhb2008-07-231-9/+4
| | | | | | | | behavior. Specifically, probe Host-PCI bridges in the order they are encountered in the tree. For CPUs, just use an order of 100000 and assume that no Host-PCI bridges will be more than 10000 levels deep in the namespace. This fixes an issue on some boxes where the HPET timer stopped attaching.
* Initialize tz_active to a new constant TZ_ACTIVE_UNKNOWN and make norpaulo2008-04-251-1/+20
| | | | | | | | assumptions about the state of the cooling devices. Instead, switch them off on init and, only after that, we are in TZ_ACTIVE_NONE. Submited by: Andriy Gapon <avg at icyb.net.ua> Reviewed by: njl
* Update the list of Cx states when ACPICA notifies us. Usually, thisrpaulo2008-04-121-4/+24
| | | | | | | | notification is sent when the AC plug is plugged in/out. This is required on some laptops, namely the MacBooks. Silence on: freebsd-acpi
* Revert back to probing Host-PCI bridges in the order we encounter them injhb2008-04-071-18/+11
| | | | | | the tree rather than sorting them by their address on PCI bus 0. Reported by: kan
* GPE lock may recurse on resume path.takawata2008-04-051-1/+1
|
OpenPOWER on IntegriCloud