tpmdd-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* Re: What does error code 38 mean?
@ 2017-04-24  1:32 Peter Huewe
  2017-04-24 14:50 ` Paul Menzel
  2017-04-26 17:57 ` What does error code 38 mean? -> hex vs. decimal Ken Goldman
  0 siblings, 2 replies; 7+ messages in thread
From: Peter Huewe @ 2017-04-24  1:32 UTC (permalink / raw)
  To: Paul Menzel, tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- Attachment #1: Type: text/html, Size: 221 bytes --]

[-- Attachment #2: Type: text/plain, Size: 202 bytes --]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

[-- Attachment #3: Type: text/plain, Size: 192 bytes --]

_______________________________________________
tpmdd-devel mailing list
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: What does error code 38 mean?
  2017-04-24  1:32 What does error code 38 mean? Peter Huewe
@ 2017-04-24 14:50 ` Paul Menzel
       [not found]   ` <0603ee8e-ce81-9a46-4bb3-5fe4d7bda463-KUpvgZVWgV9o1qOY/usvUg@public.gmane.org>
  2017-04-26 17:57 ` What does error code 38 mean? -> hex vs. decimal Ken Goldman
  1 sibling, 1 reply; 7+ messages in thread
From: Paul Menzel @ 2017-04-24 14:50 UTC (permalink / raw)
  To: Peter Huewe, tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: Patrick Rudolph, Arthur Heymans

Dear Peter, dear TPM folks,


On 04/24/17 03:32, Peter Huewe wrote:

>> x60t kernel: tpm tpm0: A TPM error (38) occurred continue selftest
>
> 38=0x26= invalid post init, which means tpm did not receive tpm_startup command
> after reset.

Thank you for the quick reply. As this is during resume, could you 
please point me to documentation, what is expected for resume from the 
firmware?


Kind regards,

Paul

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: What does error code 38 mean?
       [not found]   ` <0603ee8e-ce81-9a46-4bb3-5fe4d7bda463-KUpvgZVWgV9o1qOY/usvUg@public.gmane.org>
@ 2017-04-26 17:52     ` Ken Goldman
  0 siblings, 0 replies; 7+ messages in thread
From: Ken Goldman @ 2017-04-26 17:52 UTC (permalink / raw)
  To: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On 4/24/2017 10:50 AM, Paul Menzel wrote:
>
> Thank you for the quick reply. As this is during resume, could you
> please point me to documentation, what is expected for resume from the
> firmware?

If "resume" means: from the sleep state where the platform suspends to 
RAM and there is no OS reboot, that's

Shutdown(STATE) followed by Startup(STATE).

The TPM 2.0 specifications use the key word "TPM Resume".



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: What does error code 38 mean? -> hex vs. decimal
  2017-04-24  1:32 What does error code 38 mean? Peter Huewe
  2017-04-24 14:50 ` Paul Menzel
@ 2017-04-26 17:57 ` Ken Goldman
  2017-04-26 19:18   ` Jerry Snitselaar
  1 sibling, 1 reply; 7+ messages in thread
From: Ken Goldman @ 2017-04-26 17:57 UTC (permalink / raw)
  To: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On 4/23/2017 9:32 PM, Peter Huewe wrote:
> 38=0x26= invalid post init, which means tpm did not receive tpm_startup
> command after reset.

A minor observation:

While the TPM 1.2 specification listed error codes in decimal, TPM 2.0 
uses hex, and further has a lot of bit level encoding.

Thus, for TPM 2.0, it would be easier if error messages printed TPM 
errors in hex.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: What does error code 38 mean? -> hex vs. decimal
  2017-04-26 17:57 ` What does error code 38 mean? -> hex vs. decimal Ken Goldman
@ 2017-04-26 19:18   ` Jerry Snitselaar
  2017-04-26 20:57     ` Ken Goldman
  0 siblings, 1 reply; 7+ messages in thread
From: Jerry Snitselaar @ 2017-04-26 19:18 UTC (permalink / raw)
  To: Ken Goldman; +Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Wed Apr 26 17, Ken Goldman wrote:
>On 4/23/2017 9:32 PM, Peter Huewe wrote:
>> 38=0x26= invalid post init, which means tpm did not receive tpm_startup
>> command after reset.
>
>A minor observation:
>
>While the TPM 1.2 specification listed error codes in decimal, TPM 2.0
>uses hex, and further has a lot of bit level encoding.
>
>Thus, for TPM 2.0, it would be easier if error messages printed TPM
>errors in hex.
>
>
>
>------------------------------------------------------------------------------
>Check out the vibrant tech community on one of the world's most
>engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>_______________________________________________
>tpmdd-devel mailing list
>tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>https://lists.sourceforge.net/lists/listinfo/tpmdd-devel

Maybe the following?

--8<--

diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
index bd2128e0b56c..e6e60f9f428c 100644
--- a/drivers/char/tpm/tpm-interface.c
+++ b/drivers/char/tpm/tpm-interface.c
@@ -453,9 +453,14 @@ ssize_t tpm_transmit_cmd(struct tpm_chip *chip, const void *buf,
                return -EFAULT;
 
        err = be32_to_cpu(header->return_code);
-       if (err != 0 && desc)
-               dev_err(&chip->dev, "A TPM error (%d) occurred %s\n", err,
-                       desc);
+       if (err != 0 && desc) {
+               if (chip->flags & TPM_CHIP_FLAG_TPM2)
+                       dev_err(&chip->dev, "A TPM error (0x%x) occurred %s\n", err,
+                               desc);
+               else
+                       dev_err(&chip->dev, "A TPM error (%d) occurred %s\n", err,
+                               desc);
+       }
        if (err)
                return err;

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: What does error code 38 mean? -> hex vs. decimal
  2017-04-26 19:18   ` Jerry Snitselaar
@ 2017-04-26 20:57     ` Ken Goldman
  0 siblings, 0 replies; 7+ messages in thread
From: Ken Goldman @ 2017-04-26 20:57 UTC (permalink / raw)
  To: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On 4/26/2017 3:18 PM, Jerry Snitselaar wrote:
>
> Maybe the following?
>
>
> diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
> index bd2128e0b56c..e6e60f9f428c 100644
> --- a/drivers/char/tpm/tpm-interface.c
> +++ b/drivers/char/tpm/tpm-interface.c
> @@ -453,9 +453,14 @@ ssize_t tpm_transmit_cmd(struct tpm_chip *chip, const void *buf,
>                 return -EFAULT;
>
>         err = be32_to_cpu(header->return_code);
> -       if (err != 0 && desc)
> -               dev_err(&chip->dev, "A TPM error (%d) occurred %s\n", err,
> -                       desc);
> +       if (err != 0 && desc) {
> +               if (chip->flags & TPM_CHIP_FLAG_TPM2)
> +                       dev_err(&chip->dev, "A TPM error (0x%x) occurred %s\n", err,
> +                               desc);
> +               else
> +                       dev_err(&chip->dev, "A TPM error (%d) occurred %s\n", err,
> +                               desc);
> +       }
>         if (err)
>                 return err;
>

I think that's a good idea.

I have a utility that parses the fields out of the TPM 2.0 error codes 
and prints the text.  It expects hex values, as does the specification.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply	[flat|nested] 7+ messages in thread

* What does error code 38 mean?
@ 2017-04-23 19:57 Paul Menzel
  0 siblings, 0 replies; 7+ messages in thread
From: Paul Menzel @ 2017-04-23 19:57 UTC (permalink / raw)
  To: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Dear Linux folks,


On resume, Linux 4.11-rc7 logs the messages below.

```
[…]
Apr 23 21:42:05 lenovox60t kernel: pciehp 0000:00:1c.0:pcie004: Timeout 
on hotplug command 0x1038 (issued 109528 msec ago)
Apr 23 21:42:05 lenovox60t kernel: tpm tpm0: A TPM error (38) occurred 
continue selftest
Apr 23 21:42:05 lenovox60t kernel: pciehp 0000:00:1c.0:pcie004: Device 
0000:01:00.0 already exists at 0000:01:00, cannot hot-add
Apr 23 21:42:05 lenovox60t kernel: pciehp 0000:00:1c.0:pcie004: Cannot 
add device at 0000:01:00
Apr 23 21:42:05 lenovox60t kernel: ata1.00: configured for UDMA/33
Apr 23 21:42:05 lenovox60t kernel: pciehp 0000:00:1c.0:pcie004: Device 
0000:01:00.0 already exists at 0000:01:00, cannot hot-add
Apr 23 21:42:05 lenovox60t kernel: pciehp 0000:00:1c.0:pcie004: Cannot 
add device at 0000:01:00
Apr 23 21:42:05 lenovox60t kernel: pcieport 0000:00:1c.0: System wakeup 
disabled by ACPI
Apr 23 21:42:05 lenovox60t kernel: e1000e 0000:01:00.0: Disabling ASPM 
L0s L1
Apr 23 21:42:05 lenovox60t kernel: usb 5-6: reset high-speed USB device 
number 2 using ehci-pci
Apr 23 21:42:05 lenovox60t kernel: ata3: SATA link up 1.5 Gbps (SStatus 
113 SControl 300)
Apr 23 21:42:05 lenovox60t kernel: PM: resume of devices complete after 
499.821 msecs
Apr 23 21:42:05 lenovox60t kernel: PM: Finishing wakeup.
Apr 23 21:42:05 lenovox60t kernel: Restarting tasks ... done.
Apr 23 21:42:05 lenovox60t kernel: video LNXVIDEO:00: Restoring 
backlight state
[…]
```

What does error code 38 mean in `tpm tpm0: A TPM error (38) occurred 
continue selftest`?


Kind regards,

Paul

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
tpmdd-devel mailing list
tpmdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-04-26 20:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-24  1:32 What does error code 38 mean? Peter Huewe
2017-04-24 14:50 ` Paul Menzel
     [not found]   ` <0603ee8e-ce81-9a46-4bb3-5fe4d7bda463-KUpvgZVWgV9o1qOY/usvUg@public.gmane.org>
2017-04-26 17:52     ` Ken Goldman
2017-04-26 17:57 ` What does error code 38 mean? -> hex vs. decimal Ken Goldman
2017-04-26 19:18   ` Jerry Snitselaar
2017-04-26 20:57     ` Ken Goldman
  -- strict thread matches above, loose matches on Subject: below --
2017-04-23 19:57 What does error code 38 mean? Paul Menzel

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).