Skip to content

Commit 6f2d307

Browse files
committed
6.6.35-2: revert a commit that breaks AMD Zen based systems to suspend and resume
1 parent 37be668 commit 6f2d307

File tree

3 files changed

+73
-2
lines changed

3 files changed

+73
-2
lines changed

.SRCINFO

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pkgbase = linux-egoist
22
pkgdesc = LTS Linux
33
pkgver = 6.6.35
4-
pkgrel = 1
4+
pkgrel = 2
55
url = https://www.kernel.org
66
arch = x86_64
77
makedepends = bc
@@ -22,6 +22,7 @@ pkgbase = linux-egoist
2222
source = 0002-skip-simpledrm-if-nvidia-drm.modeset=1-is.patch
2323
source = 0003-Default-to-maximum-amount-of-ASLR-bits.patch
2424
source = config
25+
source = 0004_amd_nb.diff
2526
source = 0010-more-uarches-for-kernel-6.1.79-6.8-rc3.patch
2627
source = 0020-netfilter-add-xt_FLOWOFFLOAD-target.patch
2728
source = 0021-netfilter-nat-add-brcm-fullcone-support.patch
@@ -67,6 +68,7 @@ pkgbase = linux-egoist
6768
sha256sums = 2f23be91455e529d16aa2bbf5f2c7fe3d10812749828fc752240c21b2b845849
6869
sha256sums = 6400a06e6eb3a24b650bc3b1bba9626622f132697987f718e7ed6a5b8c0317bc
6970
sha256sums = 066e4739ad38e7c7b6ec84de38902b14a0db40cd8f82d41105c35bd1ca5b73d1
71+
sha256sums = 7a68f793a8acfdf6caaf8ada0273eaac0f04f5990ccfadd2293f82c7c6de91a1
7072
sha256sums = 1a3825b790413d09806c9a2115f679be28e434cfcc69c01dc069b634d1e8007a
7173
sha256sums = a91afecda4aed1e9165dc9e3303eb44ffa791e7fb615b7717c04318b2ab98af2
7274
sha256sums = e32903a97ff3b4626b42201829c5c22229448cf98fdf6f755dc06a8d3958221d
@@ -109,6 +111,7 @@ pkgbase = linux-egoist
109111
b2sums = 5dc21a7a6f0b840e6a671dcf09a865e42f0e2c000d5e45d3f3202c02946a8ab2207858d0b2ef1004648b8c2963efb428298b263c8494be806dfc9b6af66d5413
110112
b2sums = ba6ebe349b3757411364a9ba2deaa30a8d71a247d518c159385977c2b4782771bda4edfc96bd954808617c9ba984d832471b63c11f5bd6003369bfe4051df31f
111113
b2sums = e1fdeff92265d33fd1cdfdbab6e9cb8744253b7f3301f76fc4d1c4f7e3eb8d8ea2b616e7eeb50ae93ec131cdcfb217790bbea4e7dc24ad68766e7078ebae6785
114+
b2sums = 116090d2e3c96a2ac9bc7874c5db3db6b11c4deb7daa054557bced9f1cc16cdedd9a0ef5d37492da6ec640c63dca554be633fac01819d16038fb9587ad563cdd
112115
b2sums = e6768ae66c876256d3f781e9b0c8eb5c58e0c010c511bfd0f2064e48861e21d39d2478cf09576523d140839b96b9a63fe32a8c6f12ec6ead8ee8d2367576e75a
113116
b2sums = fd7f6d316b5bab64ecf2794e9ba2c2e145fb75ca719e7a45df277be340a9288117e0052ac8640423361bad8f3eed2e81b7cd054115325130dfdef106031b9817
114117
b2sums = 947bd89f5dc4ac9c0dc34fe7d9c4548a36b1107d3afef7be89e6946d2a74f7290624b58f142acf5a38304ea997401b78bc0a1469275e87690a15f06c247eaec8

0004_amd_nb.diff

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
From 348008f0043cd5ba915cfde44027c59bdb8a6791 Mon Sep 17 00:00:00 2001
2+
From: Yazen Ghannam <yazen.ghannam@amd.com>
3+
Date: Mon, 3 Apr 2023 16:42:44 +0000
4+
Subject: x86/amd_nb: Check for invalid SMN reads
5+
6+
commit c625dabbf1c4a8e77e4734014f2fde7aa9071a1f upstream.
7+
8+
AMD Zen-based systems use a System Management Network (SMN) that
9+
provides access to implementation-specific registers.
10+
11+
SMN accesses are done indirectly through an index/data pair in PCI
12+
config space. The PCI config access may fail and return an error code.
13+
This would prevent the "read" value from being updated.
14+
15+
However, the PCI config access may succeed, but the return value may be
16+
invalid. This is in similar fashion to PCI bad reads, i.e. return all
17+
bits set.
18+
19+
Most systems will return 0 for SMN addresses that are not accessible.
20+
This is in line with AMD convention that unavailable registers are
21+
Read-as-Zero/Writes-Ignored.
22+
23+
However, some systems will return a "PCI Error Response" instead. This
24+
value, along with an error code of 0 from the PCI config access, will
25+
confuse callers of the amd_smn_read() function.
26+
27+
Check for this condition, clear the return value, and set a proper error
28+
code.
29+
30+
Fixes: ddfe43cdc0da ("x86/amd_nb: Add SMN and Indirect Data Fabric access for AMD Fam17h")
31+
Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
32+
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
33+
Cc: stable@vger.kernel.org
34+
Link: https://lore.kernel.org/r/20230403164244.471141-1-yazen.ghannam@amd.com
35+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
36+
---
37+
arch/x86/kernel/amd_nb.c | 9 ++++++++-
38+
1 file changed, 8 insertions(+), 1 deletion(-)
39+
40+
diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c
41+
index cab4d8b1535d61..6f1cc7f1b202a6 100644
42+
--- a/arch/x86/kernel/amd_nb.c
43+
+++ b/arch/x86/kernel/amd_nb.c
44+
@@ -209,7 +209,14 @@ out:
45+
46+
int amd_smn_read(u16 node, u32 address, u32 *value)
47+
{
48+
- return __amd_smn_rw(node, address, value, false);
49+
+ int err = __amd_smn_rw(node, address, value, false);
50+
+
51+
+ if (PCI_POSSIBLE_ERROR(*value)) {
52+
+ err = -ENODEV;
53+
+ *value = 0;
54+
+ }
55+
+
56+
+ return err;
57+
}
58+
EXPORT_SYMBOL_GPL(amd_smn_read);
59+
60+
--
61+
cgit 1.2.3-korg
62+

PKGBUILD

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
pkgbase=linux-egoist
44
pkgver=6.6.35
5-
pkgrel=1
5+
pkgrel=2
66
pkgdesc='LTS Linux'
77
url='https://www.kernel.org'
88
arch=(x86_64)
@@ -28,6 +28,7 @@ source=(
2828
0002-skip-simpledrm-if-nvidia-drm.modeset=1-is.patch
2929
0003-Default-to-maximum-amount-of-ASLR-bits.patch
3030
config # the main kernel config file
31+
0004_amd_nb.diff
3132
0010-more-uarches-for-kernel-6.1.79-6.8-rc3.patch
3233
0020-netfilter-add-xt_FLOWOFFLOAD-target.patch
3334
0021-netfilter-nat-add-brcm-fullcone-support.patch
@@ -77,6 +78,7 @@ sha256sums=('fce3ee728712ed063aa8c14a8756c8ff8c7a46ba3827f61d2b04a73c7cf5dd9e'
7778
'2f23be91455e529d16aa2bbf5f2c7fe3d10812749828fc752240c21b2b845849'
7879
'6400a06e6eb3a24b650bc3b1bba9626622f132697987f718e7ed6a5b8c0317bc'
7980
'066e4739ad38e7c7b6ec84de38902b14a0db40cd8f82d41105c35bd1ca5b73d1'
81+
'7a68f793a8acfdf6caaf8ada0273eaac0f04f5990ccfadd2293f82c7c6de91a1'
8082
'1a3825b790413d09806c9a2115f679be28e434cfcc69c01dc069b634d1e8007a'
8183
'a91afecda4aed1e9165dc9e3303eb44ffa791e7fb615b7717c04318b2ab98af2'
8284
'e32903a97ff3b4626b42201829c5c22229448cf98fdf6f755dc06a8d3958221d'
@@ -119,6 +121,7 @@ b2sums=('93fff6421875329ab7d7ad2f0a0d3d1377c1eb42df295638c967eced3551b08986445b5
119121
'5dc21a7a6f0b840e6a671dcf09a865e42f0e2c000d5e45d3f3202c02946a8ab2207858d0b2ef1004648b8c2963efb428298b263c8494be806dfc9b6af66d5413'
120122
'ba6ebe349b3757411364a9ba2deaa30a8d71a247d518c159385977c2b4782771bda4edfc96bd954808617c9ba984d832471b63c11f5bd6003369bfe4051df31f'
121123
'e1fdeff92265d33fd1cdfdbab6e9cb8744253b7f3301f76fc4d1c4f7e3eb8d8ea2b616e7eeb50ae93ec131cdcfb217790bbea4e7dc24ad68766e7078ebae6785'
124+
'116090d2e3c96a2ac9bc7874c5db3db6b11c4deb7daa054557bced9f1cc16cdedd9a0ef5d37492da6ec640c63dca554be633fac01819d16038fb9587ad563cdd'
122125
'e6768ae66c876256d3f781e9b0c8eb5c58e0c010c511bfd0f2064e48861e21d39d2478cf09576523d140839b96b9a63fe32a8c6f12ec6ead8ee8d2367576e75a'
123126
'fd7f6d316b5bab64ecf2794e9ba2c2e145fb75ca719e7a45df277be340a9288117e0052ac8640423361bad8f3eed2e81b7cd054115325130dfdef106031b9817'
124127
'947bd89f5dc4ac9c0dc34fe7d9c4548a36b1107d3afef7be89e6946d2a74f7290624b58f142acf5a38304ea997401b78bc0a1469275e87690a15f06c247eaec8'
@@ -175,6 +178,9 @@ prepare() {
175178
patch -Np1 < "../$src"
176179
done
177180

181+
# revert to fix broken suspend/resume
182+
patch -Rp1 -i ../0004_amd_nb.diff
183+
178184
echo "Setting config..."
179185
cp ../config .config
180186

0 commit comments

Comments
 (0)