[PATCH v2 0/2] hwrng: mtk - runtime PM fixes

From: Gu Bin

Date: Wed Nov 11 2026 - 04:13:41 EST


The sashiko review of v1 pointed out a pre-existing ordering problem:
mtk_rng_probe() registers the RNG before enabling runtime PM, so
mtk_rng_read() can run while runtime PM is disabled - both in the
probe window (hwrng_register() starts the fillfn kthread right away)
and on unbind (the devres teardown disables runtime PM before the RNG
is unregistered). Patch 2 moves the drvdata assignment and the
runtime PM setup above the registration, which closes both windows.
Patch 1 is unchanged.

Gu Bin (2):
hwrng: mtk - use pm_runtime_resume_and_get() in mtk_rng_read()
hwrng: mtk - enable runtime PM before registering the RNG

drivers/char/hw_random/mtk-rng.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)

--
2.55.0.windows.3