← 목록으로

openbsd-nx6310-acpi

OpenBSD ACPI Fan/Thermal Patch Set for HP Compaq nx6310

OpenBSD patch set and source snapshot for HP Compaq nx6310 ACPI fan staging and thermal-zone false-critical handling.

The target is OpenBSD 7.9/amd64 on HP Compaq nx6310-class hardware where ACPI exposes four PNP0C0B fan devices under \_TZ_.

Problem

On the HP Compaq nx6310, the useful fan controls are not simple PWM or RPM controls. They are four ACPI fan devices backed by four ACPI power resources.

Without hardware-specific handling, OpenBSD does not provide a stable operator-facing way to map those resources into usable fan levels.

The same machine can also report a known false-critical acpitz3 thermal event. That event can look like an impossible temperature spike and can trigger an unwanted shutdown path.

Without This Patch

The unpatched system can still boot and expose normal OpenBSD thermal sensors, but these nx6310-specific functions are missing or unreliable:

  • No acpifan attachment for the four nx6310 PNP0C0B fan stages.
  • No validated mapping from fan nodes \_TZ_.C325 through \_TZ_.C328 to power resources \_TZ_.C321 through \_TZ_.C324.
  • No hw.acpifan.level control.
  • No hw.acpifan.default_level control.
  • No simple 0, 1, 2, 3 fan-level interface.
  • No default level 3 fan hold at driver attachment time.
  • No userland sysctl names for ACPI fan level control.
  • No nx6310-specific suppression for the known TZ3_ false-critical shutdown pattern.
  • No added debounce guard for implausible _TMP readings above 200C.

In practice, this means the laptop has thermal sensor visibility but lacks a reliable OpenBSD-native way to force and inspect the four nx6310 fan stages.

After Installation

With the patched kernel and matching sbin/sysctl, the system gains:

  • acpifan attachment for the nx6310 fan devices.
  • Hardware-specific detection by AML node name and _UID.
  • Power-resource hold control for the four fan stages.
  • hw.acpifan.level for runtime fan level changes.
  • hw.acpifan.default_level for the attach-time default level.
  • Default level 3 on detected nx6310 hardware.
  • sysctl(8) name support for the new hw.acpifan node.
  • Guarded handling of implausible ACPI _TMP readings.
  • Suppression of the known HP Compaq nx6310 TZ3_ false-critical shutdown path.

The result is a practical four-level fan control interface for the nx6310.

Fan Levels

hw.acpifan.level and hw.acpifan.default_level accept integer values from 0 through 3.

Level Mode Held nx6310 stages Effect
0 Off none Releases all fan-stage power holds
1 Quiet stage 3 Holds only the lightest stage
2 Balanced stages 2 and 3 Holds two higher stages
3 Performance stages 0, 1, 2, and 3 Holds every detected stage

These values are ACPI power-resource hold levels. They are not direct PWM percentages and not RPM targets.

Expected Device Mapping

The driver treats the machine as nx6310-specific only when the fan node and _UID layout matches the expected hardware pattern.

Fan node _UID Stage Expected power resource
\_TZ_.C325 0 0 \_TZ_.C321
\_TZ_.C326 1 1 \_TZ_.C322
\_TZ_.C327 2 2 \_TZ_.C323
\_TZ_.C328 3 3 \_TZ_.C324

Unexpected mappings are reported and are not held as nx6310 fan stages.

Quick Install

Read docs/APPLY.md before applying the patch to a real system.

If the unpatched kernel shuts down from an acpitz false-critical event before installation, boot once with acpitz disabled from UKC:

boot> boot -c
UKC> disable acpitz
UKC> quit

This is a temporary boot-time workaround. Use that boot only to apply the patch, build the patched kernel, install the matching sbin/sysctl, and reboot into the patched kernel.

cd /usr/src
patch -p1 < /path/to/openbsd-nx6310-acpi/patches/0001-openbsd-nx6310-acpi-combined.diff

Add the driver attachment line from config/GENERIC.MP.NX6310.fragment to a custom amd64 kernel config:

acpifan*	at acpi? flags 0x2

Rebuild and install the kernel, rebuild and install sbin/sysctl, reboot, then verify:

sysctl hw.acpifan.level
sysctl hw.acpifan.default_level
dmesg | grep acpifan

Expected Runtime Checks

A working installation should expose:

hw.acpifan.level
hw.acpifan.default_level

On detected nx6310 hardware, the default level should be:

hw.acpifan.default_level=3

The fan stages should appear in dmesg as four acpifan devices with nx6310 stage numbers and matching pr0 power resources.

For a fuller checklist, use docs/TESTING.md.

Repository Layout

  • patches/0001-openbsd-nx6310-acpi-combined.diff is the canonical apply patch.
  • src/ contains the current source snapshot for every modified OpenBSD source file.
  • config/GENERIC.MP.NX6310.fragment contains the required kernel config line.
  • docs/APPLY.md describes installation.
  • docs/TESTING.md describes runtime checks.
  • docs/ROLLBACK.md describes recovery and rollback.
  • docs/DESIGN.md explains the driver design.
  • tools/check-nx6310-acpi.sh performs read-only status checks and can optionally cycle levels.

Compatibility And Risk

This is an HP Compaq nx6310 patch set. It intentionally validates the nx6310 ACPI namespace before treating devices as fan stages.

Do not apply it blindly to unrelated laptops.

The acpitz guard suppresses only clearly implausible readings and the known nx6310 TZ3_ false-critical pattern. It is not a replacement for real thermal monitoring.

The patch requires a custom kernel and a matching sbin/sysctl binary.

License And Credit

Repository-specific material is distributed under the ISC license.

Credit: itinfra7 from GitHub.

Modified OpenBSD source files retain their upstream copyright and license notices.

글을 불러오고 있습니다.