From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8A2F606A32A for ; Mon, 30 Nov 2026 11:44:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=UF5bfevP; dkim=fail reason="signature verification failed" (1024-bit key) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=zohomail header.b=fWIIK2BN DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=PtjmsOwrlWvs/kJQzZzQg2XuT2P1/LmUL0hgMljNFxo=; b=UF5bfevP2wci70CNa/su8Sze37 2LxoMua5lFqIIbQLYH4UFEoypwa24d8KNR4Toyp9TNj1CSJ6AfIeiyw/MP1xIa0Fmxz1VqFHUr3QG vlcM95iTGKMp6+iF7CpRKoLU/R3sw8+uSwOM1sL+H1WHcRVxlPQkqvLcYzZHovQfRcs9ALQwOBquM lpUPwGJvXNab7j0umJ+WFGXxG+KyyXwkVRawHHHkwkrEgFtnsdQz9D//LFf7AUnaHLGOOlQRcLMeF jF8H3qWCOygRLzj3PD8vnzfYzXhfxaq7kMWrO9Y9P17y4w2Z3dj68Ob6G1XStLwAvnWnkmakYFoaF QKO4o12g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXznr-00000004N0U-2N4R; Mon, 30 Nov 2026 11:44:15 +0000 Received: from sender6-op-o12.zoho.com ([165.173.180.12]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXznp-00000004Mzy-25D5; Mon, 30 Nov 2026 11:44:15 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1796039023; cv=none; d=zohomail.com; s=zohoarc; b=X7Xny4fHWl8PjXRzN0pO6rqCiRUrThTpciylGSIVdZTqBhsA3n4ppET14NlhmldrzV+8WA3eZjHCcoD9LCzIiZ8IwKfI6A5pAML3rKeIQxOfcNHrp9uNL+FLUEBEO7vnjmj8fnGMl52CcrULeKawO3+ub2XpgKe3SDHX19Bbj48= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1796039023; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=PtjmsOwrlWvs/kJQzZzQg2XuT2P1/LmUL0hgMljNFxo=; b=I0dcll1TlzO0v5yfHgy+yLNUW7p16rEENOjVQr+GMSWm4YQjrdUsNxO5Ji2FIecrVbCrfkO0sJi/a2ehyiX+sAeGvcIxhYhH5mtbsh7xHcebOnyWOIyN0jZSKabWHFbCcrHQp3EY28HUlBHgg9a45/ULHIgvWOi8rj1eXnuvpRc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=nicolas.frattaroli@collabora.com; dmarc=pass header.from= DKIM-Signature: a=rsa-sha256; b=fWIIK2BNzunMHeBvfdxuZN5L8g/yRbt+DJSWcAIgKuetpFWle2Owz/KNimZd4STuPLUOEvULWNzs3yX4zkHK0lU7EX9PzePAQbK4oB0o1qzODQIybcCsgmd9CqwRSlj8Sk66zTKaXpMgr0Ci/Zvp4wRGEU5S9BjjFhHFYdtb9O4=; c=relaxed/relaxed; s=zohomail; d=collabora.com; v=1; bh=PtjmsOwrlWvs/kJQzZzQg2XuT2P1/LmUL0hgMljNFxo=; h=Content-Description:Content-ID:Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Resent-Sender:Resent-Cc:Resent-Date:Resent-To:Reply-To:Resent-Message-ID:Resent-From:Sender:Subject:To:Date:From:Message-Id:Reply-To:Subject:To:Cc; Received: by smtp.zohomail.com with SMTPS id 1796039020981195.78767242641607; Mon, 30 Nov 2026 03:43:40 -0800 (PST) From: Nicolas Frattaroli To: Daniel Golle , Aurelien Jarno , Olivia Mackall , Herbert Xu , Heiko Stuebner , Jiawen Liu Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: Re: [PATCH] hwrng: rockchip - handle reset deassertion errors in probe Date: Mon, 30 Nov 2026 12:43:35 +0100 Message-ID: In-Reply-To: <179598034269.2.13563565241278722159.pattern-ext-132.23@gmail.com> References: <179598034269.2.13563565241278722159.pattern-ext-132.23@gmail.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261130_034413_608157_7BB4F7FD X-CRM114-Status: GOOD ( 24.36 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Sunday, 29 November 2026 20:25:33 Central European Standard Time Jiawen Liu wrote: > 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 > --- > 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); > Anyone can inspect the publicly available RK3588 SCMI reset implementation in TF-A[1] and see that there is no possibility for an implemented reset to ever return an error. That's not by happenstance either: there's simply no meaningful way for the hardware to communicate a failure here. For the case where the SCMI reset is not implemented, SCMI_NOT_FOUND or SCMI_NOT_SUPPORTED can be returned[2], but since Rockchip hardware will work fine without explicitly triggering a reset, I believe it is in the user's interest to not error out driver probe in this scenario. Plus the prior assert call would've already failed the same way, which is not handled in this patch. Consequently, this does nothing and only adds dead code (and a string to .text), and should therefore not be applied. Kind regards, Nicolas Frattaroli [1]: https://github.com/TrustedFirmware-A/trusted-firmware-a/blob/main/plat/rockchip/rk3588/drivers/scmi/rk3588_rstd.c#L30-L39 [2]: https://github.com/TrustedFirmware-A/trusted-firmware-a/blob/main/plat/rockchip/common/scmi/scmi_rstd.c#L59-L74