From: Marc Zyngier <maz@kernel.org>
To: Punit Agrawal <punit.agrawal@bytedance.com>
Cc: sudeep.holla@arm.com, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Vikram Sethi <vsethi@nvidia.com>,
Shanker Donthineni <sdonthineni@nvidia.com>
Subject: Re: [PATCH] firmware: smccc: Fix use of uninitialised results structure
Date: Tue, 18 Jul 2023 09:38:26 +0100 [thread overview]
Message-ID: <86351lvcl9.wl-maz@kernel.org> (raw)
In-Reply-To: <20230717171702.424253-1-punit.agrawal@bytedance.com>
On Mon, 17 Jul 2023 18:17:02 +0100,
Punit Agrawal <punit.agrawal@bytedance.com> 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 <punit.agrawal@bytedance.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Vikram Sethi <vsethi@nvidia.com>
> Cc: Shanker Donthineni <sdonthineni@nvidia.com>
> ---
> 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 <maz@kernel.org>
Sudeep, I assume you'll take that one directly?
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Punit Agrawal <punit.agrawal@bytedance.com>
Cc: sudeep.holla@arm.com, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Vikram Sethi <vsethi@nvidia.com>,
Shanker Donthineni <sdonthineni@nvidia.com>
Subject: Re: [PATCH] firmware: smccc: Fix use of uninitialised results structure
Date: Tue, 18 Jul 2023 09:38:26 +0100 [thread overview]
Message-ID: <86351lvcl9.wl-maz@kernel.org> (raw)
In-Reply-To: <20230717171702.424253-1-punit.agrawal@bytedance.com>
On Mon, 17 Jul 2023 18:17:02 +0100,
Punit Agrawal <punit.agrawal@bytedance.com> 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 <punit.agrawal@bytedance.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Vikram Sethi <vsethi@nvidia.com>
> Cc: Shanker Donthineni <sdonthineni@nvidia.com>
> ---
> 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 <maz@kernel.org>
Sudeep, I assume you'll take that one directly?
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2023-07-19 6:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-17 17:17 [PATCH] firmware: smccc: Fix use of uninitialised results structure Punit Agrawal
2023-07-17 17:17 ` Punit Agrawal
2023-07-18 8:38 ` Marc Zyngier [this message]
2023-07-18 8:38 ` Marc Zyngier
2023-07-18 8:48 ` Sudeep Holla
2023-07-18 8:48 ` Sudeep Holla
2023-07-19 8:10 ` [External] " Punit Agrawal
2023-07-19 8:10 ` Punit Agrawal
2023-07-19 10:01 ` Sudeep Holla
2023-07-19 10:01 ` Sudeep Holla
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=86351lvcl9.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=punit.agrawal@bytedance.com \
--cc=sdonthineni@nvidia.com \
--cc=sudeep.holla@arm.com \
--cc=vsethi@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.