oxidecomputer / oxidecomputer/hubris
VSC7448 SPI driver recurses
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.6k
- Forks
- 239
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 23
Description
The current SPI driver attempts to read a register, and if that returns a certain value, we call ourselves indirectly again to read a status register.
I noticed this while improving stack analysis, we probably should hoist this check up one level to call read_core twice from read, instead of read -> read_core -> read -> ....
In practice, this will only ever "iterate" twice, but we might want to avoid it entirely to make our lives easier.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in drv/vsc7448/src/spi.rs, lines 35-96, and trace how read and read_core handle the register value that triggers the status-register lookup. Restructure the call path so the lookup does not recurse indirectly, while preserving the existing SPI behavior. Verify that the resulting stack behavior no longer includes the recursive path and that the driver still builds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- embedded-iot
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100