oxidecomputer / oxidecomputer/hubris
spi-api `BadTransferSize` error could probably also be reply-fault
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.6k
- Forks
- 239
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 23
Description
PR #1656 changed the SPI driver API so that a majority of error codes previously returned by the SPI IPC interface are now reply-faults. However, we kept the BadTransferSize error. Looking closer at the STM32H7 SPI driver implementation, it looks like this error code is only returned in the following conditions:
- the size of the RX or TX buffer is greater than
u16::MAX - the sum of the RX and TX size is 0
If these requirements were documented clearly by the SPI API, we could probably remove BadTransferSize as well, and reply-fault any clients that give the SPI server a ridiculous transfer size.
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 with the STM32H7 SPI driver implementation in drv/stm32h7-spi-server-core/src/lib.rs, especially the BadTransferSize conditions at lines 334-355, and review PR #1656 for the existing SPI API error changes. Confirm how the RX and TX size limits should be documented, then determine the API changes needed to remove BadTransferSize and treat invalid client requests as reply-faults.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- embedded-iot
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100