linux/drivers/iommu/amd
Vasant Hegde 40c731472f iommu/amd: Expicitly enable CNTRL.EPHEn bit in resume path
[ Upstream commit ef75966abf ]

With recent kernel, AMDGPU failed to resume after suspend on certain laptop.

Sample log:
-----------
Nov 14 11:52:19 Thinkbook kernel: iommu ivhd0: AMD-Vi: Event logged [ILLEGAL_DEV_TABLE_ENTRY device=0000:06:00.0 pasid=0x00000 address=0x135300000 flags=0x0080]
Nov 14 11:52:19 Thinkbook kernel: AMD-Vi: DTE[0]: 7d90000000000003
Nov 14 11:52:19 Thinkbook kernel: AMD-Vi: DTE[1]: 0000100103fc0009
Nov 14 11:52:19 Thinkbook kernel: AMD-Vi: DTE[2]: 2000000117840013
Nov 14 11:52:19 Thinkbook kernel: AMD-Vi: DTE[3]: 0000000000000000

This is because in resume path, CNTRL[EPHEn] is not set. Fix this by
setting CNTRL[EPHEn] to 1 in resume path if EFR[EPHSUP] is set.

Note
  May be better approach is to save the control register in suspend path
  and restore it in resume path instead of trying to set indivisual
  bits. We will have separate patch for that.

Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219499
Fixes: c4cb231111 ("iommu/amd: Add support for enable/disable IOPF")
Tested-by: Hamish McIntyre-Bhatty <kernel-bugzilla@regd.hamishmb.com>
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Link: https://lore.kernel.org/r/20250127094411.5931-1-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-02-21 14:01:22 +01:00
..
amd_iommu.h iommu/amd: Remove unused amd_iommu_domain_update() 2025-02-08 09:57:34 +01:00
amd_iommu_types.h iommu/amd: Expicitly enable CNTRL.EPHEn bit in resume path 2025-02-21 14:01:22 +01:00
debugfs.c iommu/amd: Move AMD IOMMU driver into subdirectory 2020-06-10 17:46:42 +02:00
init.c iommu/amd: Expicitly enable CNTRL.EPHEn bit in resume path 2025-02-21 14:01:22 +01:00
io_pgtable.c iommu/amd: Fix corruption when mapping large pages from 0 2024-12-14 20:04:00 +01:00
io_pgtable_v2.c iommu/amd/pgtbl_v2: Take protection domain lock before invalidating TLB 2024-12-05 14:02:06 +01:00
iommu.c iommu/amd: Remove unused amd_iommu_domain_update() 2025-02-08 09:57:34 +01:00
Kconfig iommu/amd: Fix compilation error 2024-05-03 12:12:16 +02:00
Makefile iommu/amd: Initial SVA support for AMD IOMMU 2024-04-26 12:16:05 +02:00
pasid.c iommu/amd: Store the nid in io_pgtable_cfg instead of the domain 2024-09-04 11:38:34 +02:00
ppr.c iommu/amd: Fix Invalid wait context issue 2024-06-04 14:00:59 +02:00
quirks.c iommu/amd: Include PCI segment ID when initialize IOMMU 2022-07-07 09:37:51 +02:00