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

From: Herbert Xu

Date: Fri Nov 20 2026 - 04:52:36 EST


On Wed, Nov 11, 2026 at 05:06:57PM +0800, Gu Bin wrote:
> 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

All applied. Thanks.
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt