mbox series

[0/2] hwrng: st - fix potential race condition

Message ID 20230616083618.1320824-1-martin@kaiser.cx (mailing list archive)
Headers show
Series hwrng: st - fix potential race condition | expand

Message

Martin Kaiser June 16, 2023, 8:36 a.m. UTC
Fix a potential race condition in the st-rng driver. There's a short timeframe
where the driver is still registered but its peripheral clock is disabled.

Add support for compile-testing the driver. I do not have any hardware that
supports st-rng.

Martin Kaiser (2):
  hwrng: st - support compile-testing
  hwrng: st - keep clock enabled while hwrng is registered

 drivers/char/hw_random/Kconfig  |  2 +-
 drivers/char/hw_random/st-rng.c | 18 +-----------------
 2 files changed, 2 insertions(+), 18 deletions(-)

Comments

Martin Kaiser June 16, 2023, 8:58 a.m. UTC | #1
Fix a potential race condition in the st-rng driver. There's a short timeframe
where the driver is still registered but its peripheral clock is disabled.

Add support for compile-testing the driver. I do not have any hardware that
supports st-rng.

v2: Remove some more obsolete code and rephrase the explanation. The point is
    that devres does now disable the clock.

Martin Kaiser (2):
  hwrng: st - support compile-testing
  hwrng: st - keep clock enabled while hwrng is registered

 drivers/char/hw_random/Kconfig  |  2 +-
 drivers/char/hw_random/st-rng.c | 21 +--------------------
 2 files changed, 2 insertions(+), 21 deletions(-)
Herbert Xu June 23, 2023, 8:23 a.m. UTC | #2
On Fri, Jun 16, 2023 at 09:58:11AM +0100, Martin Kaiser wrote:
> Fix a potential race condition in the st-rng driver. There's a short timeframe
> where the driver is still registered but its peripheral clock is disabled.
> 
> Add support for compile-testing the driver. I do not have any hardware that
> supports st-rng.
> 
> v2: Remove some more obsolete code and rephrase the explanation. The point is
>     that devres does now disable the clock.
> 
> Martin Kaiser (2):
>   hwrng: st - support compile-testing
>   hwrng: st - keep clock enabled while hwrng is registered
> 
>  drivers/char/hw_random/Kconfig  |  2 +-
>  drivers/char/hw_random/st-rng.c | 21 +--------------------
>  2 files changed, 2 insertions(+), 21 deletions(-)
> 
> -- 
> 2.30.2

All applied.  Thanks.