snapshot: serialize the hpc3 pdma latched flags - #64
Merged
Conversation
save_pdma_channel dropped eox, eop, xie, rown, width_16, even_high and endian, so a restored channel came up with no completion interrupt, no chain terminator and the wrong transfer width.
mach-kernel
force-pushed
the
snapshot-restore-3
branch
from
July 30, 2026 14:13
a91b73e to
5d24012
Compare
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.
Changes
save_pdma_channel/load_pdma_channel. Additive, so older snapshots lack the keys and keep their current values.Hpc3::power_on:eox,eop,xie,rownHpc3::power_on:width_16,even_high,endianfetch_descriptordoes deriveeox/eop/xie/rownfrombc, which is serialized, but a raw BC register write updates onlyeoxandxieand leaveseopandrownstale.endianis not derivable at all.PDMA_CTRL_LITTLE(hpc3.rs:132) andPDMA_CTRL_ACT(hpc3.rs:139) are both1 << 1, andPbusDmaOps::write(hpc3.rs:723) consumes the written value intochan.endianwithout assigningchan.ctrl, so deriving it fromctrlon channels 0-7 is exactlyis_active().width_16splits the same way:ScsiDmaOpswritesdmacfgalone athpc3.rs:822and writesdmacfgwithwidth_16at827, sodmacfg & SCSI_DMACFG_DMA16does not reproduce the live value.Coverage / needs eyes
hpc3::tests::latched_flags_reach_a_fresh_devicefails with the production hunks reverted:chan 0 lost eox.save_load_round_trippasses there, since a round-trip cannot see a field dropped from both halves.PbusDmaOpsScsiDmaOpsEnetRxDmaOpsEnetTxDmaOpscargo test --release --features lightning,rex-jit,chd: 357 passed.cargo test hpc3previously ran zero tests.PdmaChannel::miscis also unserialized and also untouched bypower_on. It gatesfetch_descriptorathpc3.rs:919.