How I Contributed to My First Linux Kernel Bug Fix
Описание и применение
Пользователь исправил баг драйвера i915, который вызывал длительные задержки при переходе в спящий режим и предупреждения о runtime‑pm, улучшив производительность системы и внес вклад в ядро Linux.
Задача
The Intel i915 display driver caused a 33‑second suspend/resume stall and repeated runtime‑pm warnings on an HP Victus laptop.
Результат
The user successfully identified and fixed a kernel bug that caused long suspend/resume stalls and runtime‑pm warnings, improving system responsiveness and contributing a patch to the i915 driver.
Рабочий процесс
- 1. Filed detailed bug report on freedesktop GitLab with hardware specs and dmesg logs.
- 2. Added kernel parameters (drm.debug=0xe) via GRUB and captured full kernel logs during a suspend/resume cycle.
- 3. Ran Intel sleepgraph to identify the i915 driver as the culprit.
- 4. Built a debug kernel (CONFIG_DRM_I915_DEBUG=y, etc.) to enable wakeref tracking.
- 5. Analyzed ref_tracker output to locate orphaned wakeref from boot.
- 6. Applied Arun Raghavendra Murthy’s patch that reuses existing wakeref instead of overwriting it.
- 7. Rebuilt, installed the patched kernel, and tested across multiple suspend/resume cycles to confirm the fix.
Доказательства
After building and installing the patched kernel, I tested across 3 suspend/resume cycles: Before: i915 raw-wakerefs=1 wakelocks=1 on cleanup WARNING: intel_runtime_pm.c:531 After: [DPRX] Link Training passed (no warnings)
The i915 was the only device with an abnormal suspend time — 35ms vs 0.001ms for everything else.
- Дата записи: 2026-09-05T16:36:29.456Z