From: "Marek Behún" <kabel@kernel.org>
To: Josef Schlehofer <pepe.schlehofer@gmail.com>
Cc: "Marek Behún" <kabel@kernel.org>,
"Herbert Xu" <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
"Thorsten Blum" <blum@kernel.org>,
linux-crypto@vger.kernel.org, linux-i2c@vger.kernel.org,
linux-kernel@vger.kernel.org, "Marius Dinu" <m95d@psihoexpert.ro>
Subject: Re: [PATCH] crypto: atmel-i2c - find the bus speed behind an I2C mux
Date: Mon, 9 Nov 2026 15:34:01 +0100 [thread overview]
Message-ID: <avHVv4LscKrE4b7K@solitude> (raw)
In-Reply-To: <20261102170141.54660-1-pepe.schlehofer@gmail.com>
On Mon, Nov 02, 2026 at 06:01:41PM +0100, Josef Schlehofer wrote:
> Hi Marek,
>
> thanks for the ack and the warning.
>
> The hwrng core starts a fill thread for the current RNG, whatever its
> quality. It reads 32 bytes every 60 seconds, even when idle.
> atmel_i2c_send_receive() puts the ATSHA204A to sleep after each
> command. That means about 1440 seed updates per day, and 100k cycles
> in about 70 days.
>
> The ATSHA204A becomes the current RNG when the MCU firmware has no
> TRNG. It also stays current when it registers first, because both RNGs
> have quality 1024. Today the probe fails on the Omnia, so it is safe.
> This patch could wear out its EEPROM within months. It is also marked
> for stable.
>
> The patch also lets the ATSHA204 on the Turris 1.x probe, as its I2C
> controller has no clock-frequency either. There the talitos hwrng wins,
> because the ATSHA204 has quality 1. Without talitos, the ATSHA204 would
> wear out the same way.
>
> Should we fix the wear before this patch goes in? Does "proper power
> management" mean the idle command instead of sleep? I can look into
> it.
Yes, basically.
Note that there are two time constants after which the device goes to
sleep mode:
t_TIMEOUT (45 to 85 ms) - if I2C bus is inactive the device goes to sleep
t_WATCHDOG (0.7 to 1.7s) - the device goes to sleep automatically at most
t_WATCHDOG time after wakeup, unless put into
IDLE mode
If the RANDOM command was the only command the driver is issuing, I would
simply make it so that the device is put to IDLE mode after each command.
But if there are other commands executed, maybe the implementation needs
to be smarter. Depends on the commands.
prev parent reply other threads:[~2026-11-09 14:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 8:26 Josef Schlehofer
2026-11-02 14:48 ` Marek Behún
2026-11-02 17:01 ` Josef Schlehofer
2026-11-09 14:34 ` Marek Behún [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=avHVv4LscKrE4b7K@solitude \
--to=kabel@kernel.org \
--cc=blum@kernel.org \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m95d@psihoexpert.ro \
--cc=pepe.schlehofer@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®