summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpi/acpi.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Release the acpi lock around calls to wsdisplay_suspend() andkettenis2014-09-231-1/+9
| | | | | | | | | | | | | | wsdisplay_resume(). The X server may adjust the display brightness just before/after the VT switch when suspending/resuming. In fact, it may already be blocked adjusting the display brightness for some reason unrelated to the suspend request. The VT switch request will eventually time out, but the delay is annoying and the failed VT switch will lead to problems after resume. Needed for a future update of the xf86-video-intel driver. ok mlarkin@
* Use config_suspend_all(9).kettenis2014-09-191-6/+5
|
* Clear the PME Status bit on PCI devices in response to Device Wake events.kettenis2014-09-081-1/+27
| | | | | | | Fixes the interrupt storm on the 2009 Mac mini with WOL enabled on its nfe(4) interface. ok mlarkin@
* Support hibernating to softraid crypto volumes.mlarkin2014-07-201-2/+2
| | | | much help and ok from deraadt@
* Reenable hibernate RLE support and flush+zero all memory after unpack.mlarkin2014-07-161-2/+8
|
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-8/+8
| | | | after discussions with beck deraadt kettenis.
* Add a function to drop all clean pages on the page daemon queues and callkettenis2014-07-121-2/+4
| | | | | | it when we hibernate. ok mlarkin@, miod@, deraadt@
* It's init as a process that's special, not init's original thread.guenther2014-07-111-2/+2
| | | | | | Remember initprocess instead of initproc. ok matthew@ blambert@
* Flush the buffercache to 16MB on hibernate and restore its previous maxmlarkin2014-07-111-1/+7
| | | | | | size (kern.bufcachepercent) on resume, for better hibernate performance. ok beck@
* remove unneeded headerblambert2014-07-101-2/+1
| | | | ok mlarkin@
* Adding an additonal delay after each access to SystemMemory or SystemIOkettenis2014-07-011-9/+1
| | | | | | during autoconf makes no sense. ok deraadt@
* SystemMemory is used to access memory mapped registers on some machines, so wekettenis2014-06-231-27/+22
| | | | | | | must use the bus_space(9) API to access it instead of memcpy(9). Also make sure we properly align access to fields that need more than byte alignment. ok guenther@
* Fix invalid / missing format specifiers in several dnprintf statementsmlarkin2014-05-211-4/+4
| | | | | | | (used only when ACPI_DEBUG is enabled) From a diff on tech@ by Fabian Raetz, with a minor change by me, tested on i386 and amd64 with ACPI_DEBUG enabled and disabled.
* Defer the free of the hibernate structures until later, when it is safe tomlarkin2014-04-251-1/+9
| | | | | | | | | | do so. Freeing the hibernate structures too early leads to inadvertent calls into splx when we aren't ready for them yet. Found when trapping splx calls in the resume path. discussed with deraadt@ at m2k14
* Fix a badly worded debug message that implied the entire machine was goingmlarkin2014-04-131-2/+2
| | | | to sleep, instead of just the acpi thread going to sleep.
* Change the order of operations during a suspend/resume cycle andmpi2014-03-311-3/+4
| | | | | | | | | | | | | | call bufq_quiesce() after executing the DVACT_QUIESCE handlers. This should be safe since no disk nor controller drivers have such handler but it will allow us to detach sd(4) devices attached to a USB bus. Another benefit pointed out by kettenis@ is that drivers that need to read a firmware from the disk should be able to do it at resume time in a DVACT_WAKEUP handler. ok kettenis@, deraadt@
* get rid of the assumption that the head of the alldevs list is thedlg2014-03-131-5/+6
| | | | | | | | | | | "mainbus" device. this breaks when mpath is enabled because it attaches before mainbus and therefore takes the head position. have autoconf provide device_mainbus() which looks up mainbus_cd, and use that instead. discussed with deraadt who just wants mpath stuff to move forward despite there being many ways to shine this particular turd.
* Do the lid control further on in the resume sequence, since this isderaadt2014-02-211-2/+2
| | | | | | | AML, and will do WAITOK operations. While cold, that is a bad idea. We seem to be safe with respect to the spec, I do not see any event debounce issues here. ok kettenis, tested by many
* Instead of checking sc->sc_revision <= 1 check that theclaudio2014-01-201-2/+2
| | | | | | | | fadt->hdr_revision <= 1. This is a better check since it checks the version of the proper descriptor. This allows the alix APU to reboot since those boards have currently a wrong sc->sc_revision. Committing this now so that it can be tested easier. With and OK jsg@ also fine by derradt@
* If the FADT has its SMI_CMD set to zero, assume we're only ACPI-only hardwarekettenis2013-12-241-8/+22
| | | | | | and don't need to disable SMI ownership of the ACPI hardware registers. ok mlarkin@
* Revert previous commit. It makes resume hang on some MP systems runningkettenis2013-12-231-7/+1
| | | | GENERIC.MP.
* Restore hw.setperf upon resume like we do for apm(4) on i386. Seems we needkettenis2013-12-161-1/+7
| | | | | | to do this fairly late in the resume to avoid hangs. ok deraadt@, mlarkin@
* Add a DVACT_WAKEUP op to the *_activate() API. This is called after thederaadt2013-12-061-1/+4
| | | | | | | | kernel resumes normal (non-cold, able to run processes, etc) operation. Previously we were relying on specific DVACT_RESUME op's in drivers creating callback/threads themselves, but that has become too common, indicating the need for a built-in mechanism. ok dlg kettenis, tested by a sufficient amount of people
* Add support for Power Resources for Dx states and the necessary hookmpi2013-11-061-8/+84
| | | | | | | | | | | | | | | | for PCI devices. This hook should be called twice, before and after changing the power state of a PCI device. Before setting the device to the new state, the ACPI layer will notify every power resources linked to the device for that state and make sure they are turned "_ON". After changing the state of the device, it will decrement the reference of every power resources linked to that device for the old state and turn them "_OFF" if they are no longer referenced. This fixes the no-USB after resume problem seen on various ThinkPad, problem initialy diagnosed with Alexander Polakov. ok kettenis@, deraadt@
* Stop printing ACPI wakeup devices in dmesg after the 16th wakeup device.mlarkin2013-06-011-3/+9
| | | | | | Helps with VMware VMs that report hundreds of wakeup devices. ok reyk@, deraadt@
* Fix the build for a kernel without wd and pciide in its config.bluhm2013-05-311-1/+6
| | | | OK deraadt@ tedu@
* Enforce ca_activate tree-walks over the entire heirarchy for all events,deraadt2013-05-301-3/+2
| | | | | | cleaning up some shutdown-hook related code on the way. (A few drivers related to sparc are still skipped at kettenis' request) ok kettenis mlarkin, tested by many others too
* pin the acpi thread to the BSP, because AML and SMI cannot be trusted. Ideraadt2013-04-181-1/+4
| | | | was certain we were doing this already, but it turns out no...
* In acpiioctl(), Return though the splx() path if suser() returns an errorguenther2012-12-241-3/+3
| | | | ok deraadt@
* Revamp the sequences for suspend/hibernate -> resume so that the codederaadt2012-10-081-255/+176
| | | | | | | | | | paths are reflexive. It is now possible to fail part-way through a suspend sequence, and recover along the resume code path. Split DVACT_SUSPEND by adding a new DVACT_POWERDOWN method is used after hibernate (and suspend too) to finish the job. Some drivers must be converted at the same time to use this instead of shutdown hooks (the others will follow at a later time) ok kettenis mlarkin
* Use information provided by ACPI to attach secondary PCI host bridges.ehrhardt2012-10-041-1/+21
| | | | ok kettenis@
* Add a new function called acpi_pci_min_powerstate() that returns the lowestkettenis2012-09-071-1/+54
| | | | | | | | power state for a PCI device for the power state (currently S3 or S4) we're transitioning into. This function is probably too simplistic; there is a lot of (silly) complexity in the ACPI spec. ok deraadt@
* Disable acpivideo(4) on ASUS laptops.pirofti2012-07-131-4/+7
| | | | | | | | There are some models that panic whenever an event is received. Some cope, some don't. In order to get this right acpiec(4) requires major rework. Until then let machines boot. Discussed with deraadt@.
* for now, restrict hibernate to root in the acpi ioctl kernel interface.mlarkin2012-07-111-1/+3
| | | | | | normal rules for controlling this interface through apmd still apply. ok deraadt@
* tiny little oops in untested hibernate blockderaadt2012-07-091-2/+1
|
* clean up ioctl() case statementsderaadt2012-07-091-12/+12
|
* acpi_disable_onegpe() is not used; ok piroftideraadt2012-07-091-18/+1
|
* If _MIN > _MAX consider a WordBus resource to be invalid. Fixes a panic onkettenis2012-05-241-2/+6
| | | | | | the IBM x3550-M4. ok mikeb@
* Missing #ifdef in previous diffmlarkin2012-03-291-1/+4
|
* Prevent hibernation attempts on machines with unsupported disk controllers.mlarkin2012-03-291-3/+9
| | | | | | | The same check is also performed later in the hibernate sequence, but by then it's too late to cleanly unwind (presently). ok deraadt
* simplify conditionals in acpi_sleep_state()deraadt2012-03-261-15/+9
| | | | ok mlarkin
* hook in the hibernate request code; half of this diff is from mlarkinderaadt2012-03-261-7/+29
| | | | ok mlarkin
* Very early in suspend while the clock is still ticking realtime,deraadt2011-09-201-1/+3
| | | | | save the clock back to the rtc. The zaurus already did this. ok phessler miod kettenis
* kqueue attach functions should return an errno or 0, not a plain 1. Fixnicm2011-07-021-3/+3
| | | | | | the obvious cases to return EINVAL and ENXIO. ok tedu deraadt
* machdep.kbdreset enables a shutdown by Ctrl-Alt-Del on amd64 andnaddy2011-06-241-3/+7
| | | | | | | | | | | | | | | i386. Stop abusing it on other archs for controling a shutdown by pressing the soft power button: * Add a MI sysctl hw.allowpowerdown; if set to 1 (the default) it allows a power button shutdown. * Make acpi(4)/acpibtn(4) honor hw.allowpowerdown. * Switch the various power button intercepts on landisk, sgi, sparc64 and zaurus over to hw.allowpowerdown. * Garbage collect the machdep.kbdreset sysctl on all archs other than amd64 and i386. ok miod@
* Import acpitoshiba driver.pirofti2011-06-161-3/+11
| | | | | | | | This is originally written by Hiroyuki Aizu, ported and integrated in our tree by Javier Vazquez <javama4 AT gmail> with tweaks and suggestions by me. Import prodded by deraadt@ and the lack of testers on tech@.
* attach acpithinkpad to newer lenovo models like the x120ejcs2011-04-271-2/+3
| | | | ok deraadt@
* Fix uninitialzied variables and formatting strings (-Wxxx errors)jordan2011-04-221-2/+2
|
* Re-add code for ACPI taskqueue, eliminates need for state vars in acpi softcjordan2011-01-021-76/+139
| | | | | Serialize processing ACPI tasks for sleep/powerdown/GPE event ok deraadt@
* Revert last commit: it breaks resume on Thinkpadsguenther2010-10-311-69/+11
| | | | "then please back it out" deraadt@