* [PATCH] firmware: smccc: Fix use of uninitialised results structure
@ 2023-07-17 17:17 Punit Agrawal
2023-07-18 8:38 ` Marc Zyngier
2023-07-19 10:01 ` Sudeep Holla
0 siblings, 2 replies; 5+ messages in thread
From: Punit Agrawal @ 2023-07-17 17:17 UTC (permalink / raw)
To: sudeep.holla
Cc: linux-arm-kernel, linux-kernel, Punit Agrawal, Marc Zyngier,
Vikram Sethi, Shanker Donthineni
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;
}
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] firmware: smccc: Fix use of uninitialised results structure
2023-07-17 17:17 [PATCH] firmware: smccc: Fix use of uninitialised results structure Punit Agrawal
@ 2023-07-18 8:38 ` Marc Zyngier
2023-07-18 8:48 ` Sudeep Holla
2023-07-19 10:01 ` Sudeep Holla
1 sibling, 1 reply; 5+ messages in thread
From: Marc Zyngier @ 2023-07-18 8:38 UTC (permalink / raw)
To: Punit Agrawal
Cc: sudeep.holla, linux-arm-kernel, linux-kernel, Vikram Sethi,
Shanker Donthineni
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] firmware: smccc: Fix use of uninitialised results structure
2023-07-18 8:38 ` Marc Zyngier
@ 2023-07-18 8:48 ` Sudeep Holla
2023-07-19 8:10 ` [External] " Punit Agrawal
0 siblings, 1 reply; 5+ messages in thread
From: Sudeep Holla @ 2023-07-18 8:48 UTC (permalink / raw)
To: Marc Zyngier
Cc: Punit Agrawal, linux-arm-kernel, linux-kernel, Sudeep Holla,
Vikram Sethi, Shanker Donthineni
On Tue, Jul 18, 2023 at 09:38:26AM +0100, Marc Zyngier wrote:
> 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?
>
Sure I will route it via (arm-)soc team.
--
Regards,
Sudeep
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [External] Re: [PATCH] firmware: smccc: Fix use of uninitialised results structure
2023-07-18 8:48 ` Sudeep Holla
@ 2023-07-19 8:10 ` Punit Agrawal
0 siblings, 0 replies; 5+ messages in thread
From: Punit Agrawal @ 2023-07-19 8:10 UTC (permalink / raw)
To: Sudeep Holla
Cc: Marc Zyngier, Punit Agrawal, linux-arm-kernel, linux-kernel,
Vikram Sethi, Shanker Donthineni
Sudeep Holla <sudeep.holla@arm.com> writes:
> On Tue, Jul 18, 2023 at 09:38:26AM +0100, Marc Zyngier wrote:
>> 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>
Thanks Marc.
>> Sudeep, I assume you'll take that one directly?
>>
>
> Sure I will route it via (arm-)soc team.
Sudeep, hope you can add the tag while applying. Let me know if you'd
like me to resend.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] firmware: smccc: Fix use of uninitialised results structure
2023-07-17 17:17 [PATCH] firmware: smccc: Fix use of uninitialised results structure Punit Agrawal
2023-07-18 8:38 ` Marc Zyngier
@ 2023-07-19 10:01 ` Sudeep Holla
1 sibling, 0 replies; 5+ messages in thread
From: Sudeep Holla @ 2023-07-19 10:01 UTC (permalink / raw)
To: Punit Agrawal
Cc: Sudeep Holla, linux-arm-kernel, linux-kernel, Marc Zyngier,
Vikram Sethi, Shanker Donthineni
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.
>
> [...]
Applied to sudeep.holla/linux (for-next/scmi/fixes), thanks!
[1/1] firmware: smccc: Fix use of uninitialised results structure
https://git.kernel.org/sudeep.holla/c/d05799d7b4a3
--
Regards,
Sudeep
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-07-19 10:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-17 17:17 [PATCH] firmware: smccc: Fix use of uninitialised results structure Punit Agrawal
2023-07-18 8:38 ` Marc Zyngier
2023-07-18 8:48 ` Sudeep Holla
2023-07-19 8:10 ` [External] " Punit Agrawal
2023-07-19 10:01 ` Sudeep Holla
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).