linux-stable/drivers/char
Martin Kaiser 950f1e7b95 hwrng: st - keep clock enabled while hwrng is registered
[ Upstream commit 501e197a02 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-11 19:39:50 +02:00
..
agp parisc: Flush gatt writes and adjust gatt mask in parisc_agp_mask_memory() 2023-06-21 16:02:07 +02:00
hw_random hwrng: st - keep clock enabled while hwrng is registered 2023-07-11 19:39:50 +02:00
ipmi ipmi: ASPEED_BT_IPMI_BMC: select REGMAP_MMIO instead of depending on it 2023-05-11 23:17:23 +09:00
mwave
pcmcia Char/Misc and other driver subsystem changes for 6.3-rc1 2023-02-24 12:47:33 -08:00
tpm tpm, tpm_tis: Claim locality in interrupt handler 2023-06-28 11:13:57 +02:00
xilinx_hwicap xilinx_hwicap: cleanup comments 2022-02-25 12:08:57 +01:00
xillybus char: xillybus: Fix trivial bug with mutex 2022-11-23 19:44:04 +01:00
Kconfig random: use random.trust_{bootloader,cpu} command line option only 2022-11-18 02:18:10 +01:00
Makefile char: remove VR41XX related char driver 2022-07-28 16:12:33 +02: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 powerpc/BSR: Make use of the helper macro LIST_HEAD() 2022-02-25 12:10:15 +01:00
ds1620.c
dsp56k.c
dtlk.c
hangcheck-timer.c
hpet.c hpet: remove unused writeq/readq function definitions 2022-02-04 16:45:39 +01:00
lp.c char: lp: remove redundant initialization of err 2022-06-10 15:29:50 +02:00
mem.c mm/nommu: factor out check for NOMMU shared mappings into is_nommu_shared_mapping() 2023-01-18 17:12:56 -08:00
misc.c Driver Core changes for 6.2-rc1 2022-12-16 03:54:54 -08: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
ppdev.c
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 virtio_console: Use strscpy() to instead of strncpy() 2023-01-20 13:07:54 +01:00