Skip to contentSkip to conversation

5.10.y Kernel Panic while poweroff and reboot - Null Pointer Exception - with TPM-Module SLB 9670

DISCUSSION Paul Enuta 2 participants 6 messages Mar 22, 2021 – Mar 23, 2021 1 message not in the archive Keys-trusted

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Paul Enuta

author
#1 lore raw

Dear all,

As described in the issue here:
https://github.com/raspberrypi/linux/issues/4228
and here:
https://www.raspberrypi.org/forums/viewtopic.php?f=75&t=303564&p=1817702#p1839351
starting with kernel 5.10.XX we encounter a system hang with kernel panic at poweroff or reboot if we have dtoverlay=tpm-slb9670 loaded. Applying the patch proposed here:
https://github.com/raspberrypi/linux/issues/4228#issuecomment-804081079
and rebuilding the kernel solves the issue.

Please review the issue and provide guidance finding the cause and solving.

Kind regards,
Paul Enuta

maintainer
#2 lore raw
Quoted 12 lines · Paul Enuta

Dear all,

As described in the issue here:
https://github.com/raspberrypi/linux/issues/4228
and here:
https://www.raspberrypi.org/forums/viewtopic.php?f=75&t=303564&p=1817702#p1839351
starting with kernel 5.10.XX we encounter a system hang with kernel panic at poweroff or reboot if we have dtoverlay=tpm-slb9670 loaded. Applying the patch proposed here:
https://github.com/raspberrypi/linux/issues/4228#issuecomment-804081079
and rebuilding the kernel solves the issue.

Quoted 4 lines

Please review the issue and provide guidance finding the cause and solving.

Kind regards,
Paul Enuta

So does this happen with the latest mainline? Patched kernels are not our concern.

/Jarkko

author
#3 lore raw

Hi,
it happens with 5.10.25-v7l (latest mainline in Raspberry PI OS) and in my test it started with 5.10.0-v7+.
5.4.83-v7+ was OK.
Problems occur on fresh and clean installs with kernel versions above 5.10. This quick fix solves:

tpm-chip.c 2021-03-22 18:22:52.000000000 +0000 renamed from tpm-chip.c.orig 2021-03-22 17:43:05.433433496 +0000 +5 -0
@@ -101,6 +101,11 @@
 {
  int ret;
 
+    if (!chip->ops) {
+            pr_err("%s: Avoiding NULL ops pointer\n", __func__);
+            return -EIO;
+    }
+
  tpm_clk_enable(chip);
 
  if (chip->locality == -1) {
Quoted 25 lines · Jarkko Sakkinen
Quoted 12 lines · Paul Enuta

Dear all,

As described in the issue here:
https://github.com/raspberrypi/linux/issues/4228
and here:
https://www.raspberrypi.org/forums/viewtopic.php?f=75&t=303564&p=1817702#p1839351
starting with kernel 5.10.XX we encounter a system hang with kernel panic at poweroff or reboot if we have dtoverlay=tpm-slb9670 loaded. Applying the patch proposed here:
https://github.com/raspberrypi/linux/issues/4228#issuecomment-804081079
and rebuilding the kernel solves the issue.

Quoted 4 lines

Please review the issue and provide guidance finding the cause and solving.

Kind regards,
Paul Enuta

So does this happen with the latest mainline? Patched kernels are not our concern.

/Jarkko

author
#4 lore raw

I only found this commit
https://github.com/raspberrypi/linux/commit/1e5ac6300a07ceecfc70a893ebef3352be21e6f8#
related to the problem.

BR,
Paul

Quoted 48 lines · Paul Enuta

Hi,
it happens with 5.10.25-v7l (latest mainline in Raspberry PI OS) and in my test it started with 5.10.0-v7+.
5.4.83-v7+ was OK.
Problems occur on fresh and clean installs with kernel versions above 5.10. This quick fix solves:

tpm-chip.c 2021-03-22 18:22:52.000000000 +0000 renamed from tpm-chip.c.orig 2021-03-22 17:43:05.433433496 +0000 +5 -0
@@ -101,6 +101,11 @@
 {
  int ret;
 
+    if (!chip->ops) {
+            pr_err("%s: Avoiding NULL ops pointer\n", __func__);
+            return -EIO;
+    }
+
  tpm_clk_enable(chip);
 
  if (chip->locality == -1) {
Quoted 25 lines · Jarkko Sakkinen
Quoted 12 lines · Paul Enuta

Dear all,

As described in the issue here:
https://github.com/raspberrypi/linux/issues/4228
and here:
https://www.raspberrypi.org/forums/viewtopic.php?f=75&t=303564&p=1817702#p1839351
starting with kernel 5.10.XX we encounter a system hang with kernel panic at poweroff or reboot if we have dtoverlay=tpm-slb9670 loaded. Applying the patch proposed here:
https://github.com/raspberrypi/linux/issues/4228#issuecomment-804081079
and rebuilding the kernel solves the issue.

Quoted 4 lines

Please review the issue and provide guidance finding the cause and solving.

Kind regards,
Paul Enuta

So does this happen with the latest mainline? Patched kernels are not our concern.

/Jarkko

maintainer
#5 lore raw
In reply to Paul Enuta
Quoted 11 lines · Paul Enuta

Hi,
it happens with 5.10.25-v7l (latest mainline in Raspberry PI OS) and in my test it started with 5.10.0-v7+.
5.4.83-v7+ was OK.
Problems occur on fresh and clean installs with kernel versions above 5.10. This quick fix solves:

tpm-chip.c 2021-03-22 18:22:52.000000000 +0000 renamed from tpm-chip.c.orig 2021-03-22 17:43:05.433433496 +0000 +0 -0
@@ -101,6 +101,11 @@
 {

tpm-chip.c 2021-03-22 18:22:52.000000000 +0000 line 111

Quoted 10 lines
tpm-chip.c 2021-03-22 18:22:52.000000000 +0000 renamed from tpm-chip.c.orig 2021-03-22 17:43:05.433433496 +0000 +5 -0
  int ret;
 
+    if (!chip->ops) {
+            pr_err("%s: Avoiding NULL ops pointer\n", __func__);
+            return -EIO;
+    }
+
  tpm_clk_enable(chip);
 
  if (chip->locality == -1) {

Please try with the actual mainline. We don't care about RPi kernel.

Quoted 21 lines · Jarkko Sakkinen
Quoted 20 lines · Paul Enuta
Quoted 16 lines

Dear all,

As described in the issue here:
https://github.com/raspberrypi/linux/issues/4228
and here:
https://www.raspberrypi.org/forums/viewtopic.php?f=75&t=303564&p=1817702#p1839351
starting with kernel 5.10.XX we encounter a system hang with kernel panic at poweroff or reboot if we have dtoverlay=tpm-slb9670 loaded. Applying the patch proposed here:
https://github.com/raspberrypi/linux/issues/4228#issuecomment-804081079
and rebuilding the kernel solves the issue.

Please review the issue and provide guidance finding the cause and solving.

Kind regards,
Paul Enuta

Quoted 6 lines
Quoted 5 lines

So does this happen with the latest mainline? Patched kernels are not our concern.

/Jarkko

/Jarkko

maintainer
#6 lore raw
Quoted 20 lines · Jarkko Sakkinen
Quoted 19 lines · Paul Enuta

Hi,
it happens with 5.10.25-v7l (latest mainline in Raspberry PI OS) and in my test it started with 5.10.0-v7+.
5.4.83-v7+ was OK.
Problems occur on fresh and clean installs with kernel versions above 5.10. This quick fix solves:

tpm-chip.c 2021-03-22 18:22:52.000000000 +0000 renamed from tpm-chip.c.orig 2021-03-22 17:43:05.433433496 +0000 +5 -0
@@ -101,6 +101,11 @@
 {
  int ret;
 
+    if (!chip->ops) {
+            pr_err("%s: Avoiding NULL ops pointer\n", __func__);
+            return -EIO;
+    }
+
  tpm_clk_enable(chip);
 
Quoted 4 lines

tpm-chip.c 2021-03-22 18:22:52.000000000 +0000 line 111

Quoted 2 lines
tpm-chip.c 2021-03-22 18:22:52.000000000 +0000 renamed from tpm-chip.c.orig 2021-03-22 17:43:05.433433496 +0000 +0 -0
  if (chip->locality == -1) {

Please try with the actual mainline. We don't care about RPi kernel.

AFAIK you can compile BuildRoot for RPi and try vanilla mainline with that. I cannot provide any support for that but at least it is a build target.

/Jarkko