Linux IOMMU Development
 help / color / mirror / Atom feed
From: Vasant Hegde <vasant.hegde@amd.com>
To: Johannes Stezenbach <js@sig21.net>
Cc: iommu@lists.linux.dev, Joerg Roedel <joro@8bytes.org>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Subject: Re: AMD IOMMU issue with hibernate on Asrock X600
Date: Mon, 23 Feb 2026 14:19:53 +0530	[thread overview]
Message-ID: <cf136d02-986f-402c-81d9-8971229abe9e@amd.com> (raw)
In-Reply-To: <aZoVhnX77mGUsV3y@sig21.net>

Hi Johannes,


On 2/22/2026 1:58 AM, Johannes Stezenbach wrote:
> Hi Vasant,
> 
> On Sat, Feb 21, 2026 at 08:01:16PM +0530, Vasant Hegde wrote:
>> We have managed to reproduce the issue internally.
>>
>>
>> On 2/5/2026 7:35 PM, Johannes Stezenbach wrote:
>>> On Wed, Feb 04, 2026 at 04:16:51PM +0100, Johannes Stezenbach wrote:
>>>>
>>>> Side note: I wanted to check AMD documents at https://docs.amd.com/
>>>> but the "Create Account" button doesn't work. :-(
>>>> (And why do they require an account anyway, Intel and ARM don't...)
>>>
>>> Eventually I could download the "AMD I/O Virtualization Technology
>>> (IOMMU) Specification" document (link on https://uefi.org/acpi
>>> is stale, BTW).
>>
>>
>> Latest public spec -> https://docs.amd.com/v/u/en-US/48882_3.10_PUB
> 
> Yeah, found it already. I guess I used the wrong search terms,
> trying to find docs for the 8700G. Later I also found the 
> "AMD64 Architecture Programmer’s Manual Volume 2: System Programming"
> which has info on the APIC/xAPIC/x2APIC.
> 
>> If you have cycles, Can you try below patch (untested patch we will test it
>> internally next week)?
> 
> I tried it with 6.19.3, doesn't seem to work reliably, but the
> results are mixed, sometimes seems to work, sometimes doesn't.
> (Trying a mix of suspend and hibernate, and hibernate mutiple times.)


hmmm. Is there any pattern (like hibernate -> suspend failure) ?
Also do we have any other interesting message in dmesg?

I went through complete init code today. I don't see any other suspicious thing.
(disable -> enable sequence is proper).

-Vasant


> 
> I met the familiar
> 
> [  301.963784][ T5153] i >= MMIO_STATUS_TIMEOUT
> [  301.963786][ T5153] WARNING: drivers/iommu/amd/init.c:952 at amd_iommu_enable_interrupts+0x4c8/0x550, CPU#0: pm-hiber
> nate/5153
> ...
> [  302.304252][ T5153] Call Trace:                                                                                      [  302.312118][ T5153]  <TASK>
> [  302.319113][ T5153]  amd_iommu_reenable+0x10/0x20
> [  302.330910][ T5153]  lapic_resume+0x176/0x260
> 
> on hibernation entry (doesn't show up in dmesg, needs serial
> console) and also on hibernation resume after image loading
> (this shows up in dmesg).
> 
> 
> Thanks,
> Johannes
> 
> 
>> <--
>> commit fd6196203c8637951e56bf144015c020f57d5a34
>> Author: Vasant Hegde <vasant.hegde@amd.com>
>> Date:   Sat Feb 21 19:48:59 2026 +0530
>>
>>     iommu/amd: Skip IOMMU re-initialization if already enabled during resume
>>
>>     Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
>>
>> diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
>> index 384c90b4f90a..eb5bff024f95 100644
>> --- a/drivers/iommu/amd/init.c
>> +++ b/drivers/iommu/amd/init.c
>> @@ -3058,15 +3058,23 @@ static void disable_iommus(void)
>>  static void amd_iommu_resume(void *data)
>>  {
>>  	struct amd_iommu *iommu;
>> +	u64 ctrl;
>> +	bool enable_intr = false;
>>
>> -	for_each_iommu(iommu)
>> +	for_each_iommu(iommu) {
>> +		ctrl = readq(iommu->mmio_base + MMIO_CONTROL_OFFSET);
>> +		if (ctrl & BIT_ULL(CONTROL_IOMMU_EN))
>> +			continue;
>> +
>> +		enable_intr = true;
>>  		iommu_apply_resume_quirks(iommu);
>>
>> -	/* re-load the hardware */
>> -	for_each_iommu(iommu)
>> +		/* re-load the hardware */
>>  		early_enable_iommu(iommu);
>> +	}
>>
>> -	amd_iommu_enable_interrupts();
>> +	if (enable_intr)
>> +		amd_iommu_enable_interrupts();
>>  }
>>
>>  static int amd_iommu_suspend(void *data)
>>
>>


  reply	other threads:[~2026-02-23  8:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-26 14:54 AMD IOMMU issue with hibernate on Asrock X600 Johannes Stezenbach
2026-01-26 15:02 ` Asrock X600 port80 UART Johannes Stezenbach
2026-01-28  9:31 ` AMD IOMMU issue with hibernate on Asrock X600 Johannes Stezenbach
2026-02-03  5:38   ` Vasant Hegde
2026-02-03 11:40     ` Johannes Stezenbach
2026-02-04 15:16       ` Johannes Stezenbach
2026-02-05 14:05         ` Johannes Stezenbach
2026-02-21 14:31           ` Vasant Hegde
2026-02-21 20:28             ` Johannes Stezenbach
2026-02-23  8:49               ` Vasant Hegde [this message]
2026-02-23  9:09                 ` Johannes Stezenbach
2026-02-24  8:56                   ` Vasant Hegde
2026-02-24  9:11                     ` Johannes Stezenbach
2026-03-05 16:50                       ` Vasant Hegde
2026-02-21 13:14         ` Vasant Hegde
2026-02-21 12:51       ` Vasant Hegde
2026-02-23  6:17         ` Naveen N Rao
2026-02-03  5:28 ` Vasant Hegde
2026-02-03 11:49   ` Johannes Stezenbach

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=cf136d02-986f-402c-81d9-8971229abe9e@amd.com \
    --to=vasant.hegde@amd.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=js@sig21.net \
    --cc=suravee.suthikulpanit@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox