Record: Kernel failure behavior spike โ 2026-08-23
Outcome
Studied what the Linux kernel and the amdgpu driver do when hwmon sysfs reads or writes fail at runtime, and defined the service failure policy.
Findings (verified against kernel sources and live on beast.lan):
- -EBUSY during GPU reset, suspend, or before full initialization (amdgpu_pm_dev_state_check, amdgpu_pm.c).
- -ENODEV after device removal (kernfs active-ref, drm_dev_unplug).
- -EINVAL on pwm1 writes unless manual mode is active.
- pp_power_profile_mode writes require manual level; verified live that profile 5 fails with -EINVAL under forced-high and auto, succeeds under manual.
- The bNoFan path silently no-ops pwm1 writes; inactive on this card.
Decisions
- The service retries on transient -EBUSY and keeps its last good PWM.
- The service exits nonzero on -ENODEV and lets systemd restart.
- The service re-asserts pwm1_enable=1 and retries on -EINVAL.
- The service treats a silent no-op write as a control failure.
- The service writes manual + COMPUTE profile at startup.
Verification
- Live writes to pp_power_profile_mode on beast.lan, then restored: verified 2026-08-23.
- All kernel facts cited from the local mainline tree and the DKMS source.
- make test passes.
Commits
- (recorded in git history for this episode)