All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <superm1@kernel.org>
To: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
	Lars Francke <lars.francke@gmail.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>,
	John Allen <john.allen@amd.com>,
	platform-driver-x86@vger.kernel.org,
	Patil Rajesh <Patil.Reddy@amd.com>,
	Mario Limonciello <mario.limonciello@amd.com>
Subject: Re: AMD PMF: CCP PSP fails to reinitialize after hibernation causing TEE errors
Date: Sun, 26 Oct 2025 12:44:29 -0500	[thread overview]
Message-ID: <c6f2002f-abc4-4d63-a143-1c3e466cbeff@kernel.org> (raw)
In-Reply-To: <84d6bd41-64ff-4380-ad87-54cfbb5bc1a0@gmail.com>



On 10/26/25 12:40 PM, Mario Limonciello wrote:
> 
> 
> On 10/26/25 11:49 AM, Shyam Sundar S K wrote:
>> + Mario
>>
>> On 10/26/2025 22:16, Lars Francke wrote:
>>> Hi,
>>>
>>> thank you Mario for the super quick response.
>>> It arrived so fast I missed it.
>>>
>>> On Sun, Oct 26, 2025 at 3:17 PM Shyam Sundar S K
>>> <Shyam-sundar.S-k@amd.com> wrote:
>>>>> After resuming from hibernation I get this log line once a second:
>>>>>    amd-pmf AMDI0105:00: TEE enact cmd failed. err: ffff000e, ret:0
>>>>
>>>> Can you please share full dmesg log? Perhaps with both ccp and amd_tee
>>>> drivers enabled with dynamic debug.
>>>
>>> I have (with AI help, but reviewed manually) created a shell script to
>>> collect the necessary information. I have attached the full dmesg file
>>> to this mail but am not sure if that is proper etiquette here?
>>>
>>> I put up the script & more debug information in a dedicated
>>> repository: https://github.com/lfrancke/amd-pmf-hibernate/tree/main
>>>
>>>>> Right after hibernation and before the first of those errors I get:
>>>>>    ccp 0000:c3:00.2: tee: command 0x5 timed out, disabling PSP
>>>>>
> 
> This comes from tee_wait_cmd_completion().  Looking at the suspend/ 
> resume handling code from ccp.ko, I notice that we don't actually have 
> any special handling for the TEE ring for S4.  Normally that ring is 
> initialized at bootup (by sending PSP_CMD_TEE_RING_INIT to PSP).
> 
> During the S4 resume flow I don't expect that this has happened and is 
> needed explicitly in the restore() call.
> 
> Can you try this attached patch which inserts that flow to see if it helps?
> 
> Note mostly to myself: I need to double check flows but I think restore 
> also needs a pm_hibernate_is_recovering() check in this case too if this 
> works.
> 
>>>>> On boot it looks good:
>>>>>    ccp 0000:c3:00.2: psp enabled
>>>>
>>>> Do you see this message after hibernation exit?
>>>
>>> Yes. On a fresh boot it works without issues but after the first
>>> hibernate I get these.
>>>
>>>
>>>>> Commit 11e298f3548a6fe5e6ad78f811abfba15e6ebbc1 from 2024 has
>>>>> more or less exactly my error message but it doesn't seem
>>>>> to be fixed for this case.
>>>>> https://lore.kernel.org/all/20240216064112.962582-2-Shyam-sundar.S- 
>>>>> k@amd.com/
>>>>
>>>> This was a case fixed for S2Idle cases, but I seem to understand that
>>>> you are attempting hibernate here, right?
>>>
>>> Correct. I use hibernate.
>>>
>>> The issue I'm really trying to debug is a separate one (I'll report
>>> separately): Hibernate doesn't reliably turn off the laptop. Image is
>>> being written successfully but I have to press the power button for
>>> 4s.
> 
> Potential theory on root cause is that it's the same regression reported 
> here [1].
> 
> If so the root cause is [2], and the fix is [3].
> 
> Link:
> https://lore.kernel.org/linux-pm/a2563b83-e5d7-4d02- 
> a317-54d51e718d32@kernel.org/T/ 
> #m19966ea259837e4b02c6d0a55d67acfe15fc64ae [1]
> Link: https://git.kernel.org/torvalds/c/469d80a3712c6  [2]

Sorry - minor correction.  Root cause is [4].
> Link: https://lore.kernel.org/linux-pm/20251026033115.436448-1- 
> superm1@kernel.org/ [3]

Link: https://git.kernel.org/torvalds/c/449c9c02537a [4]

  reply	other threads:[~2025-10-26 17:44 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22 20:04 AMD PMF: CCP PSP fails to reinitialize after hibernation causing TEE errors Lars Francke
2025-10-22 20:09 ` Mario Limonciello
2025-10-26 14:17 ` Shyam Sundar S K
2025-10-26 16:46   ` Lars Francke
2025-10-26 16:49     ` Shyam Sundar S K
2025-10-26 17:40       ` Mario Limonciello
2025-10-26 17:44         ` Mario Limonciello [this message]
2025-10-26 20:39         ` Lars Francke
2025-10-26 21:16           ` Mario Limonciello
2025-10-26 23:21             ` Lars Francke
2025-10-27  2:15               ` Mario Limonciello
2025-10-27 11:12                 ` Lars Francke
2025-10-27 12:11                   ` Shyam Sundar S K
2025-10-27 13:10                     ` Mario Limonciello
2025-10-27 16:18                       ` Lars Francke
2025-10-27 19:32                         ` Mario Limonciello
2025-10-27 20:17                           ` Lars Francke
2025-10-27 20:40                             ` Mario Limonciello
2025-10-27 20:46                               ` Lars Francke
2025-10-27 21:23                                 ` Lars Francke
2025-10-28 17:12                             ` Shyam Sundar S K
2025-10-28 23:45                               ` Lars Francke
2025-10-29  3:38                                 ` Mario Limonciello (AMD) (kernel.org)
2025-10-30  0:22                                   ` Lars Francke
2025-10-30 13:35                                     ` Mario Limonciello (AMD) (kernel.org)
2025-11-04 16:16                                       ` Mario Limonciello
2025-11-11  8:56                                         ` Lars Francke
2025-11-19 21:07                                           ` Mario Limonciello

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=c6f2002f-abc4-4d63-a143-1c3e466cbeff@kernel.org \
    --to=superm1@kernel.org \
    --cc=Patil.Reddy@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=john.allen@amd.com \
    --cc=lars.francke@gmail.com \
    --cc=mario.limonciello@amd.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=thomas.lendacky@amd.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.