Re: [PATCH v5 2/2] hw_random: timeriomem-rng: add configurable read width and data mask

From: Krzysztof Kozlowski

Date: Mon Jun 22 2026 - 03:38:35 EST


On Thu, Jun 18, 2026 at 01:01:10PM +0100, Jad Keskes wrote:
> The TODO for supporting read sizes other than 32 bits and masking has
> been sitting in this driver since 2009. Implement it.

And who - which driver/platform - uses or needs that? We are not really
doing things because someone wrote TODO in 2009. Quite likely notes
from 2009 are way outdated...

>
> Add reg-io-width (1, 2, or 4 bytes) and mask support. The read loop
> dispatches on width using readb/readw/readl so a configured 1-byte
> access does not trigger a bus error on hardware that rejects 32-bit
> reads to that address. The mask is ANDed with the value before storing.
>
> These are platform properties, not runtime policy -- width depends on
> SoC integration, mask reflects which output bits carry entropy.
>
> The alignment check in probe is updated to verify the resource is
> aligned to the configured width instead of hardcoding 4-byte alignment.

Best regards,
Krzysztof