summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
AgeCommit message (Collapse)Author
2014-09-08Clear the PME Status bit on PCI devices in response to Device Wake events.Mark Kettenis
Fixes the interrupt storm on the 2009 Mac mini with WOL enabled on its nfe(4) interface. ok mlarkin@
2014-08-21Set the sensor's status when docking and undocking, not just its value.kspillner
With this change sensorsd(8) now correctly detects state changes when docking and undocking. ok mlarkin@
2014-07-20Support hibernating to softraid crypto volumes.Mike Larkin
much help and ok from deraadt@
2014-07-20Skip reading bits from a region marked as "Preserve" if all bits will beMark Kettenis
modified. Some Sony and Asus laptops don't like this; the read seems to trigger an unwanted SMI that makes the machine hang. Diagnosed by mpi@ ok mpi@
2014-07-16Reenable hibernate RLE support and flush+zero all memory after unpack.Mike Larkin
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-07-12Add a function to drop all clean pages on the page daemon queues and callMark Kettenis
it when we hibernate. ok mlarkin@, miod@, deraadt@
2014-07-12Preread the thermal zone trip points before reading the temperature value.Mike Larkin
This is needed on some (specifically HP) machines to avoid _TMP reporting a bogus temperature value (temperatures > 4,000 degC), which causes acpitz to automatically shut down the machine because it thinks it's floating in lava. Also ensure that we can accept a temperature reading of 0 degC - we were previously interpreting 0 degC as "bad temperature data" and not attaching the thermal zone device. Some machines have ephemeral temperature sensors that come and go (eg in docks) and we want to make sure we attach those even if they report back 0 degC on initialization. Fixes some machines with "failed to read _TMP" errors. ok deraadt, tested and verified by a few folks on tech@ who were seeing the thermal zone shutdown isue.
2014-07-11Fix invocation of _OSC. We were passing the capabilities in the wrong DWORDMark Kettenis
and specifyig the wrong DWORD count. Moreover we should not evaluate _PDC if _OSC is present. Might not be perfect yet, but what we had previously was uterrly and totally wrong. ok guenther@
2014-07-11It's init as a process that's special, not init's original thread.Philip Guenther
Remember initprocess instead of initproc. ok matthew@ blambert@
2014-07-11Flush the buffercache to 16MB on hibernate and restore its previous maxMike Larkin
size (kern.bufcachepercent) on resume, for better hibernate performance. ok beck@
2014-07-10remove unneeded headerBret Lambert
ok mlarkin@
2014-07-08Recognize (and ignore) ``black button'' presses. ok beck@Miod Vallat
2014-07-06If we find a bogus interrupt (undefined polarity or trigger) don't panic butMark Kettenis
print a message and ignore the interrupt. There are BIOSen out there with random garbage in NMI entries for the non-BP CPUs.
2014-07-01Adding an additonal delay after each access to SystemMemory or SystemIOMark Kettenis
during autoconf makes no sense. ok deraadt@
2014-06-25So it turns out that there is AML out there that asks for an accessMark Kettenis
width that isn't compatible with the alignment of the region: OperationRegion (SATC, SystemMemory, 0xE008800A, 0x04) Field (SATC, DWordAcc, NoLock, Preserve) { STCL, 16 } DWordAcc means 4-byte access, but 0xE008800A is only 2-byte aligned. Moreover, the region itself is 4 bytes long. From this I conclude that 4-byte wide access to a 2-byte aligned address is really wanted in cases like this. ok deraadt@
2014-06-25If the Embedded Contoller device has a _STA method, evaluate it and bail outMark Kettenis
early during attach if it signals that the device isn't present. Reduces the noise on machines where the AML provides an (incomplete) description of the Embedded Controller but doesn't actually have one. ok mlarkin@, deraadt@
2014-06-23SystemMemory is used to access memory mapped registers on some machines, so weMark Kettenis
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@
2014-05-23Expose bif_capacity as the 'design capacity' through an acpibat sensor,Landry Breuil
giving you the original capacity of the battery: hw.sensors.acpibat0.watthour0=64.07 Wh (last full capacity) hw.sensors.acpibat0.watthour4=84.24 Wh (design capacity) hw.sensors.acpibat0.amphour0=2.03 Ah (last full capacity) hw.sensors.acpibat0.amphour4=4.40 Ah (design capacity) Diff from Fabian Raetz on tech@, thanks! ok mlarkin@ zhuk@ armani@ kettenis@
2014-05-21Fix invalid / missing format specifiers in several dnprintf statementsMike Larkin
(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.
2014-05-18_PIC is an optional method, so we shouldn't be aborting the rest of theMike Larkin
MADT processing if it is missing. This, combined with an earlier diff from kettenis@ to fix MADT interrupt polarity processing, should resolve the issues reported with QEMU/KVM ACPI power button presses when using OpenBSD guests. ok kettenis@, pirofti@ tested by myself and kettenis for the past few weeks
2014-05-02Make acpiprt(4) handle interrupts with non-standard polarity and trigger modeMark Kettenis
correctly. Tested by nobody.
2014-05-02Make acpi_mutex_acquire/release actually grab the global lock if it should.Mark Kettenis
Get rid of the fake global lock code that these functions were using before. ok pirofti@, mlarkin@
2014-04-26Get rid of duplication of the global lock code. Allow recursion in allMark Kettenis
code paths. ok pirofti@
2014-04-25Defer the free of the hibernate structures until later, when it is safe toMike Larkin
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
2014-04-13Fix a badly worded debug message that implied the entire machine was goingMike Larkin
to sleep, instead of just the acpi thread going to sleep.
2014-04-13perform the same ACPITZ_INIT operation as attach does, at DVACT_WAKEUPTheo de Raadt
time also. Let's commit this idea since it is sound, and keep an eye for reports. discussed months ago with kettenis and mlarkin
2014-03-31Change the order of operations during a suspend/resume cycle andMartin Pieuchot
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@
2014-03-24add support for aux button strip on newer thinkpads like the 2ndjoshua stein
generation x1 carbon that have done away with regular F1-F12 keys from rivo nurges <rix at estpak.ee> and reportedly tested on x1 carbon, x220, and x61s
2014-03-13Update the _OSI list to include newer Redmond products which may be requestedBryan Steele
by newer firmware. May cause problems with brightness control on some systems. "lets see what happens" kettenis@, and.. deraadt@ agrees (..hopefully).
2014-03-13get rid of the assumption that the head of the alldevs list is theDavid Gwynne
"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.
2014-03-05force cfattach decl to same form as othersTheo de Raadt
2014-02-21Do the lid control further on in the resume sequence, since this isTheo de Raadt
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
2014-02-21these two drivers should be doing their repair at DVACT_WAKEUP timeTheo de Raadt
rather than DVACT_RESUME in snapshots for a long time, looked at by pirofti kettenis mlarkin
2014-02-21remove stray printf; ok piroftiTheo de Raadt
2014-01-30The activate function was registered as a detach function.Paul Irofti
Put the activate function in the proper place in cfattach. Tested by jasper@ on eeepc-900 Okay kettenis@
2014-01-20Instead of checking sc->sc_revision <= 1 check that theClaudio Jeker
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@
2014-01-05Don't use the first 64KB for anything, including tramps. Move tramps andMike Larkin
hibernate goo up after 64KB to avoid posible corruption by buggy BIOS SMM code. Diff also ensures the first 64KB doesn't get handed to UVM either. ok deraadt@, tested by many with no regressions reported
2013-12-24If the FADT has its SMI_CMD set to zero, assume we're only ACPI-only hardwareMark Kettenis
and don't need to disable SMI ownership of the ACPI hardware registers. ok mlarkin@
2013-12-23Revert previous commit. It makes resume hang on some MP systems runningMark Kettenis
GENERIC.MP.
2013-12-22Bail out early if the PCI bus number is -1. This means the hardware isn'tMark Kettenis
there and the AML might reference stuff that isn't there.
2013-12-21save/restore hpet configuration. Perhaps a little more than weTheo de Raadt
need to do, since we do not use many hpet features. ok kettenis millert
2013-12-19be more careful during suspend/resume cycles, as roughly detailed in theTheo de Raadt
spec. More might be required. ok jordan matthew mlarkin
2013-12-17do not put a second : in a dmesg line, use , insteadTheo de Raadt
2013-12-16Restore hw.setperf upon resume like we do for apm(4) on i386. Seems we needMark Kettenis
to do this fairly late in the resume to avoid hangs. ok deraadt@, mlarkin@
2013-12-12Add db_vprintf(), and then use it in ACPI's db_disprint() instead ofPhilip Guenther
formatting into a local buffer. ok miod@
2013-12-12printf(variable) --> printf("%s", variable)Philip Guenther
ok deraadt@
2013-12-06Add a DVACT_WAKEUP op to the *_activate() API. This is called after theTheo de Raadt
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
2013-11-18format string cleanupTheo de Raadt
2013-11-06Add support for Power Resources for Dx states and the necessary hookMartin Pieuchot
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@