linux-stable/drivers/char
Martin Kaiser 501e197a02 hwrng: st - keep clock enabled while hwrng is registered
The st-rng 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, st-rng's clock is disabled in the remove function. There's a
short timeframe where st-rng 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: 3e75241be8 ("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>
2023-06-23 16:15:37 +08:00
..
agp char/agp: consolidate {alloc,free}_gatt_pages() 2023-02-13 22:13:12 +01:00
hw_random hwrng: st - keep clock enabled while hwrng is registered 2023-06-23 16:15:37 +08:00
ipmi Driver core changes for 6.4-rc1 2023-04-27 11:53:57 -07:00
mwave char/mwave: Adjust io port register size 2021-12-03 14:27:06 +01:00
tpm This PR fixes a critical bug in my first pull request. I fixed the 2023-05-01 10:37:37 -07:00
xilinx_hwicap driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
xillybus driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
adi.c
apm-emulation.c apm-emulation: drop unexpected word "the" in the comments 2022-06-27 16:15:27 +02:00
applicom.c applicom: Fix PCI device refcount leak in applicom_init() 2023-01-20 13:05:39 +01:00
applicom.h
bsr.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
ds1620.c
dsp56k.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
dtlk.c
hangcheck-timer.c
hpet.c hpet: remove unused writeq/readq function definitions 2022-02-04 16:45:39 +01:00
Kconfig char: pcmcia: remove all the drivers 2023-03-09 17:30:27 +01:00
lp.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
Makefile char: pcmcia: remove all the drivers 2023-03-09 17:30:27 +01:00
mem.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
misc.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
mspec.c mm: replace vma->vm_flags direct modifications with modifier calls 2023-02-09 16:51:39 -08:00
nsc_gpio.c
nvram.c
nwbutton.c
nwbutton.h
nwflash.c
pc8736x_gpio.c
powernv-op-panel.c powerpc/powernv: Fix fall-through warning for Clang 2021-07-13 19:21:41 -05:00
ppdev.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
ps3flash.c
random.c cpumask: fix incorrect cpumask scanning result checks 2023-03-06 12:15:13 -08:00
scx200_gpio.c
sonypi.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
tlclk.c
toshiba.c
ttyprintk.c char: ttyprintk: register console 2022-04-22 16:24:47 +02:00
uv_mmtimer.c
virtio_console.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00