Skip to contentSkip to conversation

soc/tegra: fuse: Fix spurious straps warning on SMCCC platforms

PATCH In review Breno Leitao 3 participants 5 messages Jun 4 – Jun 22 Tegra architecture support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc/tegra: fuse: Fix spurious straps warning on SMCCC platforms

My Grace host started to show this warning:

  WARNING: drivers/soc/tegra/fuse/tegra-apbmisc.c:120 at tegra_read_straps
   tegra30_fuse_add_randomness
   tegra30_fuse_init
   tegra_fuse_probe

tegra_read_straps() warns when the static "chipid" cache is still zero, using it as a proxy for "APBMISC has been initialised". However chipid is only ever populated lazily by tegra_read_chipid() when it reads the APBMISC register.

Guard on apbmisc_base instead, which is set unconditionally in tegra_init_apbmisc_resources() for all platforms and is already the sentinel used by tegra_read_chipid().

Fixes c71f213fa5af ("soc/tegra: fuse: Warn if straps are not ready")
---
 drivers/soc/tegra/fuse/tegra-apbmisc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/tegra/fuse/tegra-apbmisc.c +1 -1
index 87ae63a7e52d..7aba7c58bad0 100644
@@ -117,7 +117,7 @@ bool tegra_is_silicon(void)
 
 u32 tegra_read_straps(void)
 {
-	WARN(!chipid, "Tegra ABP MISC not yet available\n");
+	WARN(!apbmisc_base, "Tegra ABP MISC not yet available\n");
 
 	return strapping;
 }

---
base-commit: 1f5563665c2715e5ab2f64ec3d4b0af60927014f
change-id: 20260604-tegra_warn_fix-f9e8085b4175

Best regards,

Signature · 1 line
Breno Leitao <[email protected]>
#1 lore raw
Quoted 26 lines · Breno Leitao

My Grace host started to show this warning:

  WARNING: drivers/soc/tegra/fuse/tegra-apbmisc.c:120 at tegra_read_straps
   tegra30_fuse_add_randomness
   tegra30_fuse_init
   tegra_fuse_probe

tegra_read_straps() warns when the static "chipid" cache is still zero, using it as a proxy for "APBMISC has been initialised". However chipid is only ever populated lazily by tegra_read_chipid() when it reads the APBMISC register.

Guard on apbmisc_base instead, which is set unconditionally in tegra_init_apbmisc_resources() for all platforms and is already the sentinel used by tegra_read_chipid().

Fixes c71f213fa5af ("soc/tegra: fuse: Warn if straps are not ready")
---
 drivers/soc/tegra/fuse/tegra-apbmisc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/tegra/fuse/tegra-apbmisc.c +0 -0
index 87ae63a7e52d..7aba7c58bad0 100644

drivers/soc/tegra/fuse/tegra-apbmisc.c bool tegra_is_silicon(void) · line 120

Quoted 5 lines
drivers/soc/tegra/fuse/tegra-apbmisc.c +1 -1
@@ -117,7 +117,7 @@ bool tegra_is_silicon(void)
 
 u32 tegra_read_straps(void)
 {
-	WARN(!chipid, "Tegra ABP MISC not yet available\n");
+	WARN(!apbmisc_base, "Tegra ABP MISC not yet available\n");

Hello Thierry,

Have you had a chance to look at this one? This is showing up in my Grace all the time.

Thanks

maintainer
#2 lore raw
Quoted 36 lines · Breno Leitao
Quoted 26 lines · Breno Leitao

My Grace host started to show this warning:

  WARNING: drivers/soc/tegra/fuse/tegra-apbmisc.c:120 at tegra_read_straps
   tegra30_fuse_add_randomness
   tegra30_fuse_init
   tegra_fuse_probe

tegra_read_straps() warns when the static "chipid" cache is still zero, using it as a proxy for "APBMISC has been initialised". However chipid is only ever populated lazily by tegra_read_chipid() when it reads the APBMISC register.

Guard on apbmisc_base instead, which is set unconditionally in tegra_init_apbmisc_resources() for all platforms and is already the sentinel used by tegra_read_chipid().

Fixes c71f213fa5af ("soc/tegra: fuse: Warn if straps are not ready")
---
 drivers/soc/tegra/fuse/tegra-apbmisc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/tegra/fuse/tegra-apbmisc.c +0 -0
index 87ae63a7e52d..7aba7c58bad0 100644

drivers/soc/tegra/fuse/tegra-apbmisc.c bool tegra_is_silicon(void) · line 120

Quoted 5 lines
drivers/soc/tegra/fuse/tegra-apbmisc.c +1 -1
@@ -117,7 +117,7 @@ bool tegra_is_silicon(void)
 
 u32 tegra_read_straps(void)
 {
-	WARN(!chipid, "Tegra ABP MISC not yet available\n");
+	WARN(!apbmisc_base, "Tegra ABP MISC not yet available\n");

Hello Thierry,

Quoted 2 lines

Have you had a chance to look at this one? This is showing up in my Grace all the time.

Yeah, sorry for the delay. You're right in that we now get the warning until we end up calling tegra_read_chipid(). However, I don't think the
Fixes: reference is right. I think this started showing up after:

8b8ee2e56f95 ("soc/tegra: Use ARM SMCCC to get chip ID, revision, and platform info")

I don't think we accounted for tegra_read_straps() in that case and I suspect that we're not seeing this elsewhere because we do end up calling tegra_read_chipid() earlier in DT systems whereas for ACPI it might only get called at a later point, if at all.

There's also this patch:

https://lore.kernel.org/linux-tegra/[email protected]/

IIUC, that's the only place where tegra_read_straps() gets called on ACPI systems. Would you mind testing that patch (without the one that we're currently discussing) to confirm that that's the only callsite? It doesn't really matter either way, because applying your fix here is the right thing to do, but it'd still be useful as a data point.

If you don't have any objections, I'm going to replace the Fixes: line, but otherwise this patch looks good.

Also, I'm going to check if we can get some better coverage in our daily testing for the ACPI platforms. Do you happen to run any daily tests on your systems for linux-next?

Thierry

#3 lore raw

Hello Thierry,

Quoted 8 lines · Thierry Reding
Quoted 2 lines

Have you had a chance to look at this one? This is showing up in my Grace all the time.

Yeah, sorry for the delay. You're right in that we now get the warning until we end up calling tegra_read_chipid(). However, I don't think the
Fixes: reference is right. I think this started showing up after:

8b8ee2e56f95 ("soc/tegra: Use ARM SMCCC to get chip ID, revision, and platform info")

Ack!

Quoted 5 lines

I don't think we accounted for tegra_read_straps() in that case and I suspect that we're not seeing this elsewhere because we do end up calling tegra_read_chipid() earlier in DT systems whereas for ACPI it might only get called at a later point, if at all.

Quoted 7 lines

There's also this patch:

https://lore.kernel.org/linux-tegra/[email protected]/

IIUC, that's the only place where tegra_read_straps() gets called on ACPI systems. Would you mind testing that patch (without the one that we're currently discussing) to confirm that that's the only callsite?

Sure, I've just tested it, and it doesn't hit the problematic path. Thanks for pointing it out.

Quoted 2 lines

It doesn't really matter either way, because applying your fix here is the right thing to do, but it'd still be useful as a data point.

Agreed, they seem independent. This patch fixes the issue, while Kartik's patch avoids hitting it.

Quoted 2 lines

If you don't have any objections, I'm going to replace the Fixes: line, but otherwise this patch looks good.

Ack!

Quoted 3 lines

Also, I'm going to check if we can get some better coverage in our daily testing for the ACPI platforms. Do you happen to run any daily tests on your systems for linux-next?

Yes, I use my Grace machine for development, and I am usually on linux-next, so, I get these crazy issues from time to time.

Thanks for the reply,
--breno

maintainer
#4 lore raw
In reply to Thierry Reding
Quoted 61 lines · Thierry Reding
Quoted 36 lines · Breno Leitao
Quoted 26 lines · Breno Leitao

My Grace host started to show this warning:

   WARNING: drivers/soc/tegra/fuse/tegra-apbmisc.c:120 at tegra_read_straps
    tegra30_fuse_add_randomness
    tegra30_fuse_init
    tegra_fuse_probe

tegra_read_straps() warns when the static "chipid" cache is still zero, using it as a proxy for "APBMISC has been initialised". However chipid is only ever populated lazily by tegra_read_chipid() when it reads the APBMISC register.

Guard on apbmisc_base instead, which is set unconditionally in tegra_init_apbmisc_resources() for all platforms and is already the sentinel used by tegra_read_chipid().

Fixes c71f213fa5af ("soc/tegra: fuse: Warn if straps are not ready")
---
  drivers/soc/tegra/fuse/tegra-apbmisc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/tegra/fuse/tegra-apbmisc.c +0 -0
index 87ae63a7e52d..7aba7c58bad0 100644

drivers/soc/tegra/fuse/tegra-apbmisc.c bool tegra_is_silicon(void) · line 120

Quoted 5 lines
drivers/soc/tegra/fuse/tegra-apbmisc.c +1 -1
@@ -117,7 +117,7 @@ bool tegra_is_silicon(void)
 
  u32 tegra_read_straps(void)
  {
-	WARN(!chipid, "Tegra ABP MISC not yet available\n");
+	WARN(!apbmisc_base, "Tegra ABP MISC not yet available\n");

Hello Thierry,

Quoted 2 lines

Have you had a chance to look at this one? This is showing up in my Grace all the time.

Yeah, sorry for the delay. You're right in that we now get the warning until we end up calling tegra_read_chipid(). However, I don't think the
Fixes: reference is right. I think this started showing up after:

8b8ee2e56f95 ("soc/tegra: Use ARM SMCCC to get chip ID, revision, and platform info")

I don't think we accounted for tegra_read_straps() in that case and I suspect that we're not seeing this elsewhere because we do end up calling tegra_read_chipid() earlier in DT systems whereas for ACPI it might only get called at a later point, if at all.

There's also this patch:

   https://lore.kernel.org/linux-tegra/[email protected]/

IIUC, that's the only place where tegra_read_straps() gets called on ACPI systems. Would you mind testing that patch (without the one that we're currently discussing) to confirm that that's the only callsite? It doesn't really matter either way, because applying your fix here is the right thing to do, but it'd still be useful as a data point.

Quoted 6 lines

If you don't have any objections, I'm going to replace the Fixes: line, but otherwise this patch looks good.

Also, I'm going to check if we can get some better coverage in our daily testing for the ACPI platforms. Do you happen to run any daily tests on your systems for linux-next?

FWIW I also see this on Tegra194 and Tegra234 (I have not checked others) ...

WARNING KERN ------------[ cut here ]------------
WARNING KERN Tegra ABP MISC not yet available
WARNING KERN WARNING: drivers/soc/tegra/fuse/tegra-apbmisc.c:120 at tegra_read_straps+0x40/0x58, CPU#0: swapper/0/1 WARNING KERN Modules linked in:
WARNING KERN CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 7.1.0-g8cd8cf7a07e5 #1 PREEMPT WARNING KERN Hardware name: NVIDIA Jetson AGX Orin Developer Kit (DT)
WARNING KERN pstate: 60000009 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
WARNING KERN pc : tegra_read_straps+0x40/0x58
WARNING KERN lr : tegra_read_straps+0x40/0x58
WARNING KERN sp : ffff80008327bcb0
WARNING KERN x29: ffff80008327bcb0 x28: 0000000000000000 x27: 0000000000000000
WARNING KERN x26: 0000000000000000 x25: ffff800083146000 x24: 0000000000000000
WARNING KERN x23: 0000000000000000 x22: 0000000000000000 x21: 0000000000000000
WARNING KERN x20: ffff8000831ae000 x19: ffff8000831ae850 x18: fffffffffffe1fe8
WARNING KERN x17: ffff800083042c38 x16: ffff800083042ca8 x15: ffff800082c444d8
WARNING KERN x14: 0000000000000030 x13: 0a656c62616c6961 x12: 7661207465792074
WARNING KERN x11: ffff800082c44558 x10: 0000000000000018 x9 : ffff800082c44558
WARNING KERN x8 : 000000000000006b x7 : ffff800082c9c558 x6 : ffff800082c9c558
WARNING KERN x5 : 0000000000017fe8 x4 : 0000000000000000 x3 : 0000000000000000
WARNING KERN x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0000801c3000
WARNING KERN Call trace:

 WARNING KERN  tegra_read_straps+0x40/0x58 (P)
 WARNING KERN  tegra30_fuse_init+0x70/0x13c
 WARNING KERN  tegra_init_fuse+0x154/0x1ec
 WARNING KERN  do_one_initcall+0x7c/0x1c0
 WARNING KERN  kernel_init_freeable+0x108/0x2ec
 WARNING KERN  kernel_init+0x24/0x1e0
 WARNING KERN  ret_from_fork+0x10/0x20

WARNING KERN ---[ end trace 0000000000000000 ]---

Jon

Signature · 1 line
nvpublic