Home
last modified time | relevance | path

Searched hist:"039980 de" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/char/hw_random/
H A Dnomadik-rng.c039980de Sun Jul 02 12:35:02 CDT 2023 Martin Kaiser <martin@kaiser.cx> hwrng: nomadik - keep clock enabled while hwrng is registered

The nomadik driver uses devres to register itself with the hwrng core,
the driver will be unregistered from hwrng when its device goes out of
scope. This happens after the driver's remove function is called.

However, nomadik's clock is disabled in the remove function. There's a
short timeframe where nomadik is still registered with the hwrng core
although its clock is disabled. I suppose the clock must be active to
access the hardware and serve requests from the hwrng core.

Switch to devm_clk_get_enabled and let devres disable the clock and
unregister the hwrng. This avoids the race condition.

Fixes: 3e75241be808 ("hwrng: drivers - Use device-managed registration API")
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>