aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD6
-rw-r--r--iommu-amd-Fix-loop-timeout-issue-in-iommu_ga_log_enable.patch45
-rw-r--r--iommu-amd-W-A-for-warning-during-iommu-initialization.patch70
4 files changed, 50 insertions, 75 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3ad5b8365e0e..f07cc0a3f997 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -20,7 +20,7 @@ pkgbase = linux-xanmod-rog
source = https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.16.tar.sign
source = https://github.com/xanmod/linux/releases/download/5.16.7-xanmod1/patch-5.16.7-xanmod1.xz
source = choose-gcc-optimization.sh
- source = iommu-amd-W-A-for-warning-during-iommu-initialization.patch
+ source = iommu-amd-Fix-loop-timeout-issue-in-iommu_ga_log_enable.patch
source = Bluetooth-btintel-Fix-bdaddress-comparison-with-garb.patch
source = Bluetooth-Read-codec-capabilities-only-if-supported.patch
source = UDP-IPv6-Optimizations-from-5.17-partial.patch
@@ -45,7 +45,7 @@ pkgbase = linux-xanmod-rog
sha256sums = SKIP
sha256sums = 834dd6603ec3fb0a72e3a1a97669a7198cd6921c4f355b155b3d587a8f0fcea4
sha256sums = 278118011d7a2eeca9971ac97b31bf0c55ab55e99c662ab9ae4717b55819c9a2
- sha256sums = 393ce8f52e18624b82622a162bb4b9103e976bfe9438514b693ecf74a8541c82
+ sha256sums = 7b68a13653fd468725e1029951ac0eb4295aac873cb0a31f16eb65ab666279df
sha256sums = 241f01f06849fcec462d72355ca3ab6bd34931731dec89876d785912ac532398
sha256sums = dd01bd3f774c3a9af42b6d89f534f39c4a5f200db32cd6d4b72a29325645100e
sha256sums = 41b0cef536675f10fdfb69eeca2f1927653c69eb351dd92f4085ab6590485851
diff --git a/PKGBUILD b/PKGBUILD
index b38767b5709e..09dd1ae2fca7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -106,8 +106,8 @@ source=("https://cdn.kernel.org/pub/linux/kernel/v${_branch}/linux-${_major}.tar
#"https://cdn.kernel.org/pub/linux/kernel/v5.x/incr/patch-5.16.4-5.xz"
#"Linux-5.16.6-rc1.patch"
- # W/A for warning during iommu initialization
- "iommu-amd-W-A-for-warning-during-iommu-initialization.patch"
+ # fix: W/A for AMD iommu initialization timeout
+ "iommu-amd-Fix-loop-timeout-issue-in-iommu_ga_log_enable.patch"
# Arch: misc hotfixes
"Bluetooth-btintel-Fix-bdaddress-comparison-with-garb.patch"
@@ -165,7 +165,7 @@ sha256sums=('027d7e8988bb69ac12ee92406c3be1fe13f990b1ca2249e226225cd1573308bb'
'SKIP'
'834dd6603ec3fb0a72e3a1a97669a7198cd6921c4f355b155b3d587a8f0fcea4'
'278118011d7a2eeca9971ac97b31bf0c55ab55e99c662ab9ae4717b55819c9a2'
- '393ce8f52e18624b82622a162bb4b9103e976bfe9438514b693ecf74a8541c82'
+ '7b68a13653fd468725e1029951ac0eb4295aac873cb0a31f16eb65ab666279df'
'241f01f06849fcec462d72355ca3ab6bd34931731dec89876d785912ac532398'
'dd01bd3f774c3a9af42b6d89f534f39c4a5f200db32cd6d4b72a29325645100e'
'41b0cef536675f10fdfb69eeca2f1927653c69eb351dd92f4085ab6590485851'
diff --git a/iommu-amd-Fix-loop-timeout-issue-in-iommu_ga_log_enable.patch b/iommu-amd-Fix-loop-timeout-issue-in-iommu_ga_log_enable.patch
new file mode 100644
index 000000000000..965a886b472d
--- /dev/null
+++ b/iommu-amd-Fix-loop-timeout-issue-in-iommu_ga_log_enable.patch
@@ -0,0 +1,45 @@
+From 9b45a7738eec52bf0f5d8d3d54e822962781c5f2 Mon Sep 17 00:00:00 2001
+From: Joerg Roedel <jroedel@suse.de>
+Date: Fri, 4 Feb 2022 12:55:37 +0100
+Subject: [PATCH] iommu/amd: Fix loop timeout issue in iommu_ga_log_enable()
+
+The polling loop for the register change in iommu_ga_log_enable() needs
+to have a udelay() in it. Otherwise the CPU might be faster than the
+IOMMU hardware and wrongly trigger the WARN_ON() further down the code
+stream. Use a 10us for udelay(), has there is some hardware where
+activation of the GA log can take more than a 100ms.
+
+A future optimization should move the activation check of the GA log
+to the point where it gets used for the first time. But that is a
+bigger change and not suitable for a fix.
+
+Fixes: 8bda0cfbdc1a ("iommu/amd: Detect and initialize guest vAPIC log")
+Signed-off-by: Joerg Roedel <jroedel@suse.de>
+Link: https://lore.kernel.org/r/20220204115537.3894-1-joro@8bytes.org
+---
+ drivers/iommu/amd/init.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
+index dc338acf3338..b10fb52ea442 100644
+--- a/drivers/iommu/amd/init.c
++++ b/drivers/iommu/amd/init.c
+@@ -21,6 +21,7 @@
+ #include <linux/export.h>
+ #include <linux/kmemleak.h>
+ #include <linux/cc_platform.h>
++#include <linux/iopoll.h>
+ #include <asm/pci-direct.h>
+ #include <asm/iommu.h>
+ #include <asm/apic.h>
+@@ -834,6 +835,7 @@ static int iommu_ga_log_enable(struct amd_iommu *iommu)
+ status = readl(iommu->mmio_base + MMIO_STATUS_OFFSET);
+ if (status & (MMIO_STATUS_GALOG_RUN_MASK))
+ break;
++ udelay(10);
+ }
+
+ if (WARN_ON(i >= LOOP_TIMEOUT))
+--
+2.35.1
+
diff --git a/iommu-amd-W-A-for-warning-during-iommu-initialization.patch b/iommu-amd-W-A-for-warning-during-iommu-initialization.patch
deleted file mode 100644
index 7e04dce2ad59..000000000000
--- a/iommu-amd-W-A-for-warning-during-iommu-initialization.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 4a2a0f1420af5a9c869a35afee06f2db8cd2debd Mon Sep 17 00:00:00 2001
-From: Scott B <arglebargle@arglebargle.dev>
-Date: Sat, 5 Feb 2022 00:53:23 -0800
-Subject: [PATCH] iommu/amd: W/A for warning during iommu initialization v2
-
-Workaround for iommu warning introduced by upstream commit
-a8d4a37d1bb93608501d0d0545f902061152669a
-
-see LKML: https://lore.kernel.org/lkml/6cf58a4cd925726ef10481d38f9f4e8090f5023d.camel@redhat.com/
-
-------------[ cut here ]------------
-WARNING: CPU: 0 PID: 1 at amd_iommu_enable_interrupts+0x36a/0x440
-Modules linked in:
-CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.16.6-rc1-prexan0-rog-1 #1
-Hardware name: ASUSTeK COMPUTER INC. ROG Zephyrus G15 GA503QR_GA503QR/GA503QR, BIOS GA503QR.413 11/03/2021
-RIP: 0010:amd_iommu_enable_interrupts+0x36a/0x440
-Code: 89 41 18 b8 a0 86 01 00 0f 1f 84 00 00 00 00 00 48 8b 4b 38 8b 89 20 20 00 00 f7 c1 00 01 00 00 0f 85 fa fc ff ff ff c8 75 e6 <0f> 0b e9 ef fc ff ff 48 8b 7b 18 80 7f 6d 00 0f 84 81 00 00 00 be
-RSP: 0018:ffff996880087c18 EFLAGS: 00010246
-RAX: 0000000000000000 RBX: ffff8bfb0004a800 RCX: 0000000000000098
-RDX: 0000000000000008 RSI: ffff996880087c20 RDI: ffff9968801000f0
-RBP: ffff996880087c18 R08: ffff8bfb015eabc8 R09: 0000000000000000
-R10: 0000000000000000 R11: ffffffffffffffff R12: ffffffff7fffffff
-R13: 000fffff80000000 R14: 0000000000000000 R15: ffffffffa217af68
-FS: 0000000000000000(0000) GS:ffff8bfdde400000(0000) knlGS:0000000000000000
-CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
-CR2: 0000000000000000 CR3: 00000000bee10000 CR4: 0000000000750ef0
-PKRU: 55555554
-Call Trace:
- <TASK>
- ? iommu_setup+0x2a2/0x2a2
- state_next+0x6e/0x1c9
- ? iommu_setup+0x2a2/0x2a2
- iommu_go_to_state+0x1f/0x33
- amd_iommu_init+0xb/0x45
- pci_iommu_init+0xd/0x45
- ? iommu_setup+0x2a2/0x2a2
- __initstub__kmod_pci_dma__271_136_pci_iommu_initrootfs+0x5/0x8
- do_one_initcall+0xb6/0x230
- ? parse_one+0xa8/0x2a0
- ? parse_one+0x53/0x2a0
- ? parse_args+0xe7/0x1e0
- ? do_initcall_level+0x96/0x96
- do_initcall_level+0x83/0x96
- do_initcalls+0x44/0x6d
- kernel_init_freeable+0x13f/0x1a0
- ? rest_init+0xb0/0xb0
- kernel_init+0x11/0x1b0
- ret_from_fork+0x1f/0x30
- </TASK>
----[ end trace aec8e9a873f1d2d8 ]---
----
- drivers/iommu/amd/init.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
-index b94822fc2c9f..7afdbb156288 100644
---- a/drivers/iommu/amd/init.c
-+++ b/drivers/iommu/amd/init.c
-@@ -83,7 +83,7 @@
- #define ACPI_DEVFLAG_LINT1 0x80
- #define ACPI_DEVFLAG_ATSDIS 0x10000000
-
--#define LOOP_TIMEOUT 100000
-+#define LOOP_TIMEOUT 1000000
- /*
- * ACPI table definitions
- *
---
-2.35.1
-