Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6544183rwp; Tue, 18 Jul 2023 01:56:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlF+yaF7aeToEsSxPVQjc0/E7UtXH9aEzyTpCp+FZkMypPtwz33tAm2hIvn7I2BysFokw7mj X-Received: by 2002:aca:5c3:0:b0:39c:a986:953a with SMTP id 186-20020aca05c3000000b0039ca986953amr13318050oif.34.1689670597392; Tue, 18 Jul 2023 01:56:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689670597; cv=none; d=google.com; s=arc-20160816; b=yy7O3nwtaNkjCT4ABhkIZKNxOQ/V1SbKr5Aiuz1fEEE1nuwZZ9MmW5Sq9jrnJ7vasR c+cIWs1vO0ncaAhZnqSjurfRbJfQWhe31bzDYWZ7W53y0ivsLBJR0gnC5I9cDrL97jzI zMwg8D6NdIspjzC5jlq1KmASQab8lu6/4Aic0RhYjxQQh+8RcBfPnwpG5ykQuRo+t4oG NZyc9X1BtmjUSfeQpLoHcr3cruHDG9JplCb3Ci4j6Vic9Wa59mbZLTjJiTRiFQl43nqc vGBz8m1CPRuQIv+ZjCjRDWe12P78/kdzfQLeS6Icaz8BWNofu82e6qlJB2DNMD010NxD YGkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=zxBuLqWFsaoQBrZjXkiy6x3MQY4GjC1vBhYvjMnlsQs=; fh=VWVM+Mxu/i5DR7kDwepjsisPlyIiY7yKBOLnNUqpLP8=; b=tvxDwlNdqk107YNdKxj19bWfPzgbDxMKZvNXizIdMPYw1p+Nd62Wo/UkzDQHiEslHv Pa4e3mBp5AvHMvdvBsj6hKlk25Qwa1ERjviEHtGenXpoVRFdh4q0fOVypipqojyvSTDs UX+xxBkMunPTOm7jOryFT1xyNXY1rsHRixPpeC8LWWhhTu57Ryql50eHgVwK5P8duYG/ eSgjeUsrkF8UKR6Nr0NC07HfOp/8FI9+xiMh+PovAuGf+KJZt/jF5aMfpHeCCtCRKvsg 0yPfeEQV9n+kqahSKvuElGlSrGrvZoyNqgDcSBvRSvQ8rs5yvOeqb0XBQwVCQqb6uhhH SzKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=G87Lw1v1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q28-20020a638c5c000000b0053f23ffad1csi1294649pgn.544.2023.07.18.01.56.24; Tue, 18 Jul 2023 01:56:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=G87Lw1v1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231887AbjGRIid (ORCPT + 99 others); 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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.