Re: [PATCH RESEND v4 4/4] sample: rust: pci: add tests for config space routines

From: Danilo Krummrich
Date: Tue Nov 04 2025 - 11:47:15 EST


On 11/4/25 5:42 PM, Zhi Wang wrote:
> Should I arrange the traits like below?
>
> Io trait - Main trait + 32-bit access
> |
> | -- Common address/bound checks
> |
> | (accessor traits)
> | -- Io Fallible trait - (MMIO backend implements)
> | -- Io Infallible trait - (MMIO/ConfigSpace backend implements this)
> |
> | -- Io64 trait - For backend supports 64 bit access
> | (accessor traits)
> | -- Io64 Faillable trait (MMIO backend implements this)
> | -- Io64 Infallible trait (MMIO backend implements this)
>
> I am also thinking if we should keep 64-bit access accessor in the
> backend implementation instead in the Io trait (like {read, write}
> _relaxed), because I think few backend (PCI Config Space/I2C/SPI) would
> support 64-bit atomic access except MMIO backend.

SGTM, I think it's fine to keep 64-bit in the MMIO backend for now, we can
always split it out into a separate trait once needed.