Files
RedBear-OS/local/recipes/system/redbear-quirks/source/quirks.d/35-clocksource.toml
T
vasilito 57778e7898 quirks: ClocksourceQuirkFlags + 3-entry PMTMR blacklist (R15)
Phase R15 (2026-06-07) — timekeeping / TSC sync. The
data side lands now; TSC sync itself is algorithmic
(mark_tsc_unstable in the kernel) and is not represented.

Changes:

  1. ClocksourceQuirkFlags (mod.rs:415) with 4 bits:
     PMTMR_BLACKLIST, PMTMR_GRAYLIST, TSC_UNSTABLE,
     HPET_BROKEN. Only PMTMR bits fire today; TSC_UNSTABLE
     and HPET_BROKEN are reserved for future kernel-side
     use.

  2. ClocksourceQuirkEntry (mod.rs:445) — vendor / device /
     revision_lo / revision_hi / flags. matches() handles
     vendor / device wildcards (0xFFFF) and revision range
     (lo..=hi, with lo=0, hi=0xFF as the wildcard).

  3. CLOCKSOURCE_FLAG_NAMES + parse_clocksource_toml +
     load_clocksource_flags (toml_loader.rs) — new
     [[clocksource_quirk]] TOML table type with vendor +
     device + revision_lo + revision_hi + flags.

  4. 1 new unit test: phase_r15_clocksource_quirk_entry_matches
     exercises the range match + 4 wildcard combinations
     (vendor, device, revision out of range, revision
     wildcard). 126/126 tests pass.

  5. quirks.d/35-clocksource.toml (44 lines) — 3 entries
     sourced from Linux 7.1
     drivers/clocksource/acpi_pm.c:
       - Intel 82371AB_3 (PIIX4) 0x7113 rev 0..=2 → blacklist
       - Intel 82801DB_0 (ICH4) 0x24C0 → graylist
       - ServerWorks LE 0x0009 → graylist

cargo test: 126/126 (was 125, +1 for the new test).
cargo check: clean.

The kernel-side clocksource engine (R15 consumer) will
call load_clocksource_flags() at PMTMR probe time and
select / reject the PMTMR clocksource accordingly.
2026-06-07 21:59:22 +03:00

43 lines
1.3 KiB
TOML

# Clocksource / timekeeping quirks — PCI device-based.
# Mined from Linux 7.1
# `drivers/clocksource/acpi_pm.c` `DECLARE_PCI_FIXUP_EARLY`
# entries (3 total):
# - Intel 82371AB_3 (PIIX4) — blacklisted
# - Intel 82801DB_0 (ICH4) — graylisted
# - ServerWorks LE — graylisted
#
# The PMTMR workaround switches the kernel's clocksource
# choice. `blacklist` means PMTMR is rejected; `graylist`
# means PMTMR is allowed at a downgraded rating (120).
#
# Phase R15 (2026-06-07). The compiled-in table is empty
# (`clocksource_table.rs`); runtime TOML is the data
# surface. TSC sync detection is algorithmic in the
# kernel (mark_tsc_unstable), not table-driven, so it
# is not represented here.
# Intel 82371AB_3 (PIIX4) — blacklist, revisions 0..=2
# "Has a bug so severe that it causes random time jumps
# of up to 5 seconds." (Linux comment)
[[clocksource_quirk]]
vendor = 0x8086
device = 0x7113
revision_lo = 0
revision_hi = 2
flags = ["pmtmr_blacklist"]
# Intel 82801DB_0 (ICH4) — graylist
# "The chipset may have PM-Timer Bug. We can fall back to
# the slower read." (Linux comment)
[[clocksource_quirk]]
vendor = 0x8086
device = 0x24C0
flags = ["pmtmr_graylist"]
# ServerWorks LE — graylist
# Same as ICH4; degraded PMTMR rating 120.
[[clocksource_quirk]]
vendor = 0x1166
device = 0x0009
flags = ["pmtmr_graylist"]