Re: [PATCH] crypto: atmel-i2c - find the bus speed behind an I2C mux
From: Herbert Xu
Date: Thu Nov 12 2026 - 05:50:10 EST
On Thu, Oct 29, 2026 at 09:26:16AM +0100, Josef Schlehofer wrote:
> On the Turris Omnia, the ATSHA204A sits behind a PCA9547 I2C mux. The
> driver reads "clock-frequency" from the mux channel, which has no such
> property, so the probe fails with -EINVAL:
>
> atmel-sha204a 6-0064: failed to read clock-frequency property
>
> A device tree patch in 2024 added the property to the mux channel. The
> review rejected it, because the I2C core ignores the property there. The
> driver would then compute the wake token for a wrong bus speed. The
> review asked for a fix in the driver, but none was sent.
>
> Keep reading the property of the client's adapter first, as before. If
> it has none, look at the parent adapters. If no adapter has it, use
> 100 kHz, the default of most I2C controller drivers.
>
> Fixes: 11105693fa05 ("crypto: atmel-ecc - introduce Microchip / Atmel ECC driver")
> Cc: stable@xxxxxxxxxxxxxxx # v5.19+
> Reported-by: Marius Dinu <m95d@xxxxxxxxxxxxxx>
> Closes: https://lore.kernel.org/all/46ea55652f8bcdef51d5c552902fd0cc@xxxxxxxxxxxxxx/
> Link: https://lore.kernel.org/all/20240515104149.2ce3566e@dellmb/
> Signed-off-by: Josef Schlehofer <pepe.schlehofer@xxxxxxxxx>
> ---
> Tested on a Turris Omnia with 7.2.13 and 6.18.59: the driver probes, and
> /dev/hwrng reads random data from the ATSHA204A. The mv64xxx controller
> stops at the address NAK, so this test does not exercise the token size.
>
> drivers/crypto/atmel-i2c.c | 29 ++++++++++++++++++++---------
> 1 file changed, 20 insertions(+), 9 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt