git: pc64 - First hacky attempt at implementing a deep MWAIT sleep inhibitor.
Imre Vadasz
ivadasz at crater.dragonflybsd.org
Fri Jan 23 10:47:16 PST 2026
commit be6979ca3620cf623ad35c61a21dff68eafa0ebd
Author: Imre Vadász <imre at vdsz.com>
Date: Fri Jan 23 15:27:44 2026 +0100
pc64 - First hacky attempt at implementing a deep MWAIT sleep inhibitor.
This is needed by i915(4), to make its DisplayPort code reliable when deep
MWAIT C-States might be used. Since the i915(4) code is not aware of the
CPU core that its interrupt is routed to, we have to pessimistically inhibit
deep MWAIT sleeps on all cores.
This adds a very basic cpu_inhibit_deep_sleep() function to the pc64 platform.
cpu_inhibit_deep_sleep(1) increments a counter by 1, and
cpu_inhibit_deep_sleep(0) decrements that counter. And a positive value in
the counter inhibits deep MWAIT C-States on Intel hardware. Since modern AMD
hardware uses fully autonomous power-saving state selection, and no MWAIT
for idling, this function has no effect on AMD right now.
Summary of changes:
sys/dev/drm/drm/Makefile | 1 +
sys/dev/drm/i915/intel_dp.c | 1 +
sys/dev/drm/include/linux/pm_qos.h | 5 +++-
sys/dev/drm/{linux_printf.c => linux_pm_qos.c} | 19 +++++++--------
sys/platform/pc64/include/cpu.h | 2 ++
sys/platform/pc64/x86_64/machdep.c | 32 +++++++++++++++++++++++++-
6 files changed, 49 insertions(+), 11 deletions(-)
copy sys/dev/drm/{linux_printf.c => linux_pm_qos.c} (81%)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/be6979ca3620cf623ad35c61a21dff68eafa0ebd
--
DragonFly BSD source repository
More information about the Commits
mailing list