From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DA5CEB64DA for ; Tue, 18 Jul 2023 08:38:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231895AbjGRIid (ORCPT ); Tue, 18 Jul 2023 04:38:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231623AbjGRIic (ORCPT ); Tue, 18 Jul 2023 04:38:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0221E10C for ; Tue, 18 Jul 2023 01:38:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7F33D614DA for ; Tue, 18 Jul 2023 08:38:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D23BC4160E; Tue, 18 Jul 2023 08:38:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689669509; bh=mBzdz1+zGo4OGF4RbMLBZa0bdU4OVhGULkKCfrVy5gY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=G87Lw1v1/JJWw2Esl16WVFIRDfAkXhiq/r6KeQe1miMPoEtCZSNB1V9ZPRfY/7zA/ 0LKihbS/qwJByyqtGJhaOzjQ9LHTzyWP3hMUl0cxT6tDik6wb9jJbMftT+tbTc1kqI OWxrIMoayU4qVebK06vh65i0sGPh9jT8QxkTOeyh5v5ECjwgiF7ft/g6c2p2OtWAA4 PfibXFfXqG2ZDnEW333Df0d14rdz6TRuMNuwgyWxLEadkRW5aFND5cCg441OfHmsdV eJQMK+rOu/nRb1jp31NUYIJUdxgkU38sUWWLUlPaAJ1DmRRtFLy8dFTcIhfJ7S258I qIu79ls2RsIhw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qLgDy-00DynT-Sa; Tue, 18 Jul 2023 09:38:26 +0100 Date: Tue, 18 Jul 2023 09:38:26 +0100 Message-ID: <86351lvcl9.wl-maz@kernel.org> From: Marc Zyngier To: Punit Agrawal Cc: sudeep.holla@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Vikram Sethi , Shanker Donthineni Subject: Re: [PATCH] firmware: smccc: Fix use of uninitialised results structure In-Reply-To: <20230717171702.424253-1-punit.agrawal@bytedance.com> References: <20230717171702.424253-1-punit.agrawal@bytedance.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: punit.agrawal@bytedance.com, sudeep.holla@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, vsethi@nvidia.com, sdonthineni@nvidia.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 17 Jul 2023 18:17:02 +0100, Punit Agrawal wrote: > > Commit 35727af2b15d ("irqchip/gicv3: Workaround for NVIDIA erratum > T241-FABRIC-4") moved the initialisation of the SoC version to > arm_smccc_version_init() but forgot to update the results structure > and it's usage. > > Fix the use of the uninitialised results structure and update the > error strings. > > Fixes: 35727af2b15d ("irqchip/gicv3: Workaround for NVIDIA erratum T241-FABRIC-4") > Signed-off-by: Punit Agrawal > Cc: Sudeep Holla > Cc: Marc Zyngier > Cc: Vikram Sethi > Cc: Shanker Donthineni > --- > drivers/firmware/smccc/soc_id.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/firmware/smccc/soc_id.c b/drivers/firmware/smccc/soc_id.c > index 890eb454599a..1990263fbba0 100644 > --- a/drivers/firmware/smccc/soc_id.c > +++ b/drivers/firmware/smccc/soc_id.c > @@ -34,7 +34,6 @@ static struct soc_device_attribute *soc_dev_attr; > > static int __init smccc_soc_init(void) > { > - struct arm_smccc_res res; > int soc_id_rev, soc_id_version; > static char soc_id_str[20], soc_id_rev_str[12]; > static char soc_id_jep106_id_str[12]; > @@ -49,13 +48,13 @@ static int __init smccc_soc_init(void) > } > > if (soc_id_version < 0) { > - pr_err("ARCH_SOC_ID(0) returned error: %lx\n", res.a0); > + pr_err("Invalid SoC Version: %x\n", soc_id_version); > return -EINVAL; > } > > soc_id_rev = arm_smccc_get_soc_id_revision(); > if (soc_id_rev < 0) { > - pr_err("ARCH_SOC_ID(1) returned error: %lx\n", res.a0); > + pr_err("Invalid SoC Revision: %x\n", soc_id_rev); > return -EINVAL; > } > Ah, indeed. Well caught. FWIW: Acked-by: Marc Zyngier Sudeep, I assume you'll take that one directly? Thanks, M. -- Without deviation from the norm, progress is not possible.