Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Jiawen Liu <liu1298662399@gmail.com>
To: Daniel Golle <daniel@makrotopia.org>,
	Aurelien Jarno <aurelien@aurel32.net>,
	Nicolas Frattaroli <nicolas.frattaroli@collabora.com>,
	Olivia Mackall <olivia@selenic.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Heiko Stuebner <heiko@sntech.de>
Cc: linux-crypto@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org
Subject: [PATCH] hwrng: rockchip - handle reset deassertion errors in probe
Date: Sun, 29 Nov 2026 19:25:33 +0000	[thread overview]
Message-ID: <179598034269.2.13563565241278722159.pattern-ext-132.23@gmail.com> (raw)

The RK3588 RNG uses an SCMI reset. After assertion succeeds, the
deassert request can fail before reaching firmware, for example if SCMI
cannot allocate a transmit transfer. rk_rng_probe() ignores the error
and can register an RNG that remains in reset and cannot supply data.

Return the deassertion error through dev_err_probe() before setting up
runtime PM or registering the hwrng. Keep the reset delay and rely on
the existing managed resource cleanup.

Verification
included static control-flow review, git diff --check, checkpatch, and
driver object builds for ARM64 Rockchip with SCMI reset enabled and for
x86-64 COMPILE_TEST with reset and PM disabled. Runtime and hardware
reproduction was not performed.

Fixes: 8eff8eb83fc0 ("hwrng: rockchip - add support for rk3588's standalone TRNG")
Signed-off-by: Jiawen Liu <liu1298662399@gmail.com>
---
 drivers/char/hw_random/rockchip-rng.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/rockchip-rng.c b/drivers/char/hw_random/rockchip-rng.c
index fc389832c72f5..e6259831c3e7e 100644
--- a/drivers/char/hw_random/rockchip-rng.c
+++ b/drivers/char/hw_random/rockchip-rng.c
@@ -414,7 +414,9 @@ static int rk_rng_probe(struct platform_device *pdev)
 
 		reset_control_assert(rst);
 		udelay(2);
-		reset_control_deassert(rst);
+		ret = reset_control_deassert(rst);
+		if (ret)
+			return dev_err_probe(dev, ret, "Failed to deassert reset\n");
 	}
 
 	platform_set_drvdata(pdev, rk_rng);
-- 
2.34.1

             reply	other threads:[~2026-11-29 19:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 19:25 Jiawen Liu [this message]
2026-11-30 11:43 ` [PATCH] hwrng: rockchip - handle reset deassertion errors in probe Nicolas Frattaroli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179598034269.2.13563565241278722159.pattern-ext-132.23@gmail.com \
    --to=liu1298662399@gmail.com \
    --cc=aurelien@aurel32.net \
    --cc=daniel@makrotopia.org \
    --cc=heiko@sntech.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=nicolas.frattaroli@collabora.com \
    --cc=olivia@selenic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox