docs(evidence): task-12 namespace-wide _PRW wake-device enumeration
redbear-ci / check (push) Has been cancelled
redbear-ci / check (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,120 @@
|
||||
Task: todo 12 of ryzen-7000-x670e-compat
|
||||
Title: Namespace-wide _PRW wake-device enumeration in acpid
|
||||
Date: 2026-08-05
|
||||
|
||||
Objective
|
||||
---------
|
||||
Replace the fixed laptop-oriented wake-device candidate list in
|
||||
acpid (drivers/acpid/src/wake.rs:176-280) with a namespace-wide walk
|
||||
that discovers every device exposing a _PRW method, so AMD desktop
|
||||
GPP* paths are discovered alongside legacy Intel laptop paths
|
||||
(PC00/CNVW/lid). All _PRW evaluation continues to flow through the
|
||||
serialized AML executor.
|
||||
|
||||
Implementation
|
||||
--------------
|
||||
- drivers/acpi-rs/src/aml/namespace.rs
|
||||
Added collect_prw_device_paths() which walks the AML namespace
|
||||
recursively and returns every device/object path that has a _PRW
|
||||
method. The walk skips duplicate paths and preserves device
|
||||
ordering within each branch.
|
||||
|
||||
- drivers/acpid/src/acpi.rs
|
||||
Added AcpiContext::enumerate_prw_device_paths() that exposes the
|
||||
namespace walker to acpid. It returns the full path list and
|
||||
leaves actual _PRW evaluation to the existing serialized AML
|
||||
executor (evaluate_acpi_method / aml_eval), so the serialized
|
||||
executor requirement (todo 10) is honored.
|
||||
|
||||
- drivers/acpid/src/wake.rs
|
||||
Replaced the fixed candidate list in WakeRegistry::enumerate()
|
||||
with a call to enumerate_prw_device_paths() plus a HashSet guard
|
||||
to collapse any duplicates. Arm/disarm semantics and the LG Gram
|
||||
wake-device paths are preserved because the namespace walk
|
||||
includes them when _PRW is present.
|
||||
|
||||
Tests
|
||||
-----
|
||||
Host-runnable tests added in drivers/acpi-rs/src/aml/namespace.rs:
|
||||
1. collect_prw_discovers_intel_and_amd_devices_with_no_duplicates
|
||||
- Builds a synthetic namespace with:
|
||||
\PC00.CNVW._PRW (Intel laptop Wi-Fi / Bluetooth wake)
|
||||
\GPP0.GPP7._PRW (AMD desktop PCIe root port / device wake)
|
||||
\_SB.PCI0.LPCB.EC0.LID0._PRW (legacy lid wake)
|
||||
- Verifies all three are discovered and no path appears twice.
|
||||
|
||||
2. collect_prw_ignores_devices_without_prw
|
||||
- Builds a namespace where some devices have _PRW and sibling
|
||||
devices do not.
|
||||
- Verifies only _PRW-bearing paths are returned.
|
||||
|
||||
RED/GREEN
|
||||
---------
|
||||
RED (before implementation): the two new tests failed to compile
|
||||
because collect_prw_device_paths() and the AcpiContext wrapper did
|
||||
not exist; the fixed candidate list in wake.rs also could not
|
||||
produce the AMD GPP0/GPP7 paths.
|
||||
|
||||
GREEN (after implementation):
|
||||
|
||||
$ cargo test -p acpi
|
||||
...
|
||||
test aml::namespace::tests::collect_prw_discovers_intel_and_amd_devices_with_no_duplicates ... ok
|
||||
test aml::namespace::tests::collect_prw_ignores_devices_without_prw ... ok
|
||||
...
|
||||
test result: ok. 22 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
|
||||
|
||||
$ cargo check -p acpid
|
||||
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.10s
|
||||
(54 pre-existing warnings, none related to the new code)
|
||||
|
||||
Build verification
|
||||
------------------
|
||||
Ran the canonical check-sweep:
|
||||
|
||||
$ ./local/scripts/build-redbear.sh --allow-dirty --check-sweep redbear-mini
|
||||
|
||||
- Check-sweep covered all 52 packages in the target; individual logs
|
||||
are under /tmp/redbear-build-state.HkdE2r/logs/check-sweep-*.log.
|
||||
- The base check-sweep log (check-sweep-base.log) shows only
|
||||
pre-existing warnings; no errors were introduced by the _PRW
|
||||
changes.
|
||||
- The subsequent full build phase proceeded past recipe compilation
|
||||
and failed later with:
|
||||
|
||||
installer: failed to install: No space left on device (os error 28)
|
||||
|
||||
This is an environment/disk-space failure unrelated to the acpid
|
||||
change and unrelated to the previously observed malformed-patch
|
||||
issue in rust-native build artifacts.
|
||||
|
||||
Commits
|
||||
-------
|
||||
Base submodule (branch submodule/base):
|
||||
2db58838 feat(acpid): namespace-wide _PRW wake-device enumeration
|
||||
(3 files changed, 156 insertions(+), 38 deletions(-))
|
||||
|
||||
Parent repo (branch 0.3.2):
|
||||
The local/sources/base gitlink already points to commit
|
||||
61d196433ed9e8414eb1bf7a204642d8392639ae, which includes the
|
||||
namespace-wide _PRW commit 2db58838 as its parent. No additional
|
||||
gitlink change was required because the parent HEAD already
|
||||
recorded that submodule hash.
|
||||
|
||||
Constraints honored
|
||||
-------------------
|
||||
- Did not change arm/disarm semantics in wake.rs.
|
||||
- Did not hardcode board-specific paths; all wake candidates are
|
||||
discovered from the AML namespace.
|
||||
- Did not introduce unwrap()/expect() in library code.
|
||||
- Did not edit config/redbear-full.toml or local/cache/pkgar/.
|
||||
- Left the unrelated pcid working-tree changes from another session
|
||||
untouched (they remain uncommitted in the base submodule).
|
||||
|
||||
DoneClaim
|
||||
---------
|
||||
Namespace-wide _PRW wake-device enumeration is implemented,
|
||||
tested, and committed in the base fork. The acpid crate
|
||||
compiles cleanly and the host-runnable acpi tests pass.
|
||||
The change is ready for the next full image build once disk-space
|
||||
is available.
|
||||
Reference in New Issue
Block a user