Skip to content

Commit 3dfee47

Browse files
khfengjoergroedel
authored andcommitted
iommu/amd: Disable IOMMU on Stoney Ridge systems
Serious screen flickering when Stoney Ridge outputs to a 4K monitor. Use identity-mapping and PCI ATS doesn't help this issue. According to Alex Deucher, IOMMU isn't enabled on Windows, so let's do the same here to avoid screen flickering on 4K monitor. Cc: Alex Deucher <[email protected]> Bug: https://gitlab.freedesktop.org/drm/amd/issues/961 Signed-off-by: Kai-Heng Feng <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent 1ddb32d commit 3dfee47

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

drivers/iommu/amd_iommu_init.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2523,6 +2523,7 @@ static int __init early_amd_iommu_init(void)
25232523
struct acpi_table_header *ivrs_base;
25242524
acpi_status status;
25252525
int i, remap_cache_sz, ret = 0;
2526+
u32 pci_id;
25262527

25272528
if (!amd_iommu_detected)
25282529
return -ENODEV;
@@ -2610,6 +2611,16 @@ static int __init early_amd_iommu_init(void)
26102611
if (ret)
26112612
goto out;
26122613

2614+
/* Disable IOMMU if there's Stoney Ridge graphics */
2615+
for (i = 0; i < 32; i++) {
2616+
pci_id = read_pci_config(0, i, 0, 0);
2617+
if ((pci_id & 0xffff) == 0x1002 && (pci_id >> 16) == 0x98e4) {
2618+
pr_info("Disable IOMMU on Stoney Ridge\n");
2619+
amd_iommu_disabled = true;
2620+
break;
2621+
}
2622+
}
2623+
26132624
/* Disable any previously enabled IOMMUs */
26142625
if (!is_kdump_kernel() || amd_iommu_disabled)
26152626
disable_iommus();
@@ -2718,7 +2729,7 @@ static int __init state_next(void)
27182729
ret = early_amd_iommu_init();
27192730
init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED;
27202731
if (init_state == IOMMU_ACPI_FINISHED && amd_iommu_disabled) {
2721-
pr_info("AMD IOMMU disabled on kernel command-line\n");
2732+
pr_info("AMD IOMMU disabled\n");
27222733
init_state = IOMMU_CMDLINE_DISABLED;
27232734
ret = -EINVAL;
27242735
}

0 commit comments

Comments
 (0)