Re: [PATCH v6 RESEND 4/7] rust: io: factor common I/O helpers into Io trait
From: John Hubbard
Date: Tue Nov 18 2025 - 18:44:05 EST
On 11/18/25 1:18 PM, Danilo Krummrich wrote:
> On Tue Nov 18, 2025 at 11:44 AM NZDT, John Hubbard wrote:
...
>> Other IO subsystems can also get IO errors, too.
>>
>> I wonder if we should just provide IoFallible? (It could check for the
>> 0xFFFF_FFFF case, for example, which is helpful to simplify the caller.)
>
> For some registers this could be an expected value, plus a device can fall off
> the bus during a read was well, leaving you with broken data.
>
> I don't think trying to make all I/O operations fallible is the way to go, it's
> just unreliable to detect in the generic layer. Instead, drivers should perform
> a plausibility check on the read values (which they have to do anyways).
OK, I feel more comfortable with the approach now, thanks.
In return, I'll resist making jokes about calling it IoMostlyFallible.
You're welcome. haha :)
thanks,
--
John Hubbard