Stop pci_runtime_pm defaulting to dpv1 devices and surface skipped holds#48
Merged
Conversation
Discovery now matches nothing when no --pattern is given instead of falling back to the baked-in dpv1/Xilinx identifiers, aligning with dau-build's contract that an empty runtime_pm_patterns means no holds. apply now reports each skipped write to stderr and main exits nonzero with an N-of-M count when fewer holds are applied than planned, so a caller can no longer believe PM is held after zero writes landed. Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
dau_utils/pci_runtime_pm.pybaked dpv1/Xilinx board identity into a generic host-op utility and defaulted discovery to those patterns whenever the CLI got no--pattern. It also silently skipped writes to absent sysfs paths and still returned success, so a caller could believe PM was held after zero holds landed.DEFAULT_DEVICE_PATTERNS;discover_pci_devicesnow defaults to()(no patterns -> no devices matched). The dpv1 authoritative pattern set stays only in dau-build's platform config.mainwith neither--devicenor--patternnow matches nothing and returns 0, without shelling out tolspci. This aligns with dau-build's contract that an emptyruntime_pm_patternsproduces zero holds (aholdwith no--patternis a successful no-op).apply_runtime_pm_writesdrops the redundantand write.path.parent.exists()check.mainnow prints a stderr line per skipped write and exits nonzero with anapplied N of M runtime PM writescount when fewer holds are applied than planned.Notes
dau-build already passes
--patternexplicitly per pattern, and the recovery bash scripts use their ownlspcidiscovery, so no consumer relied on the removed default.Tests cover explicit-pattern discovery, empty discovery, the no-pattern no-op, all-missing and partial (1-of-2) skip diagnostics with nonzero exit, and successful writes, using a
tmp_pathfake sysfs.pytest dau_utils/testsgreen (25 passed); ruff check + format clean.