aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott B2021-11-04 18:53:00 -0700
committerScott B2021-11-06 12:38:43 -0700
commit982a3f781ed68030ceaa5dd288159e1fc7b9e10a (patch)
tree5f231dfe647a020ad0027047e2f3d44b81298258
parentf9067925d2e5945751c764ec17cd694285b1df31 (diff)
downloadaur-982a3f781ed68030ceaa5dd288159e1fc7b9e10a.tar.gz
5.15.1rc1.xanpre0-0; migrate to 5.15
-rw-r--r--.SRCINFO40
-rw-r--r--.gitignore3
-rw-r--r--1-1-Bluetooth-btusb-Enable-MSFT-extension-for-Mediatek-Chip-MT7921.patch34
-rw-r--r--9001-v5.15-s0ix-patch-2021-11-04.patch (renamed from 9001-v5.14.16-s0ix-patch-2021-11-02.patch)171
-rw-r--r--9002-Issue-1710-1712-debugging-and-speculative-fixes.patch1
-rw-r--r--HID-asus-Prevent-Claymore-sending-suspend-event.patch73
-rw-r--r--Linux-5.15.1-rc1.patch829
-rw-r--r--PKGBUILD95
-rw-r--r--amd-pstate-v3.diff876
-rw-r--r--asus-wmi-Add-dgpu-disable-method.patch182
-rw-r--r--asus-wmi-Add-egpu-enable-method.patch169
-rw-r--r--asus-wmi-Add-panel-overdrive-functionality.patch166
-rw-r--r--hwmon-k10temp-support-Zen3-APUs.patch37
-rw-r--r--myconfig113
-rw-r--r--r8169-Add-device-10ec-8162-to-driver-r8169.patch31
-rw-r--r--v5-asus-wmi-Add-support-for-platform_profile.patch239
-rw-r--r--xanmod-rog-config111
17 files changed, 1035 insertions, 2135 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 2b825087a4cb..00aa4cb716a4 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = linux-xanmod-rog
pkgdesc = Linux Xanmod
- pkgver = 5.14.16.xanpre0
- pkgrel = 1
+ pkgver = 5.15.1rc1.xanpre0
+ pkgrel = 0
url = http://www.xanmod.org/
arch = x86_64
license = GPL2
@@ -16,30 +16,21 @@ pkgbase = linux-xanmod-rog
makedepends = zstd
makedepends = gcc>=11.0
options = !strip
- source = https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.14.tar.xz
- source = https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.14.tar.sign
- source = https://github.com/xanmod/linux/releases/download/5.14.15-xanmod1/patch-5.14.15-xanmod1.xz
+ source = https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.tar.xz
+ source = https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.tar.sign
+ source = https://github.com/xanmod/linux/releases/download/5.15.0-xanmod1/patch-5.15.0-xanmod1.xz
source = choose-gcc-optimization.sh
source = sphinx-workaround.patch
- source = https://cdn.kernel.org/pub/linux/kernel/v5.x/incr/patch-5.14.15-16.xz
- source = amd-pstate-v3.diff
+ source = Linux-5.15.1-rc1.patch
source = x86-ACPI-State-Optimize-C3-entry-on-AMD-CPUs.patch
source = acpi-battery-Always-read-fresh-battery-state-on-update.patch
- source = hwmon-k10temp-support-Zen3-APUs.patch
source = x86-change-default-to-spec_store_bypass_disable-prct.patch
source = cfg80211-dont-WARN-if-a-self-managed-device.patch
source = r8152-fix-spurious-wakeups-from-s0i3.patch
- source = r8169-Add-device-10ec-8162-to-driver-r8169.patch
- source = asus-wmi-Add-panel-overdrive-functionality.patch
- source = asus-wmi-Add-dgpu-disable-method.patch
- source = asus-wmi-Add-egpu-enable-method.patch
- source = HID-asus-Prevent-Claymore-sending-suspend-event.patch
source = HID-asus-Reduce-object-size-by-consolidating-calls.patch
- source = v5-asus-wmi-Add-support-for-platform_profile.patch
source = v16-asus-wmi-Add-support-for-custom-fan-curves.patch
source = mt76-mt7921-Fix-out-of-order-process-by-invalid-even.patch
source = mt76-mt7921-Add-mt7922-support.patch
- source = 1-1-Bluetooth-btusb-Enable-MSFT-extension-for-Mediatek-Chip-MT7921.patch
source = 1-2-mt76-mt7915-send-EAPOL-frames-at-lowest-rate.patch
source = 2-2-mt76-mt7921-send-EAPOL-frames-at-lowest-rate.patch
source = mt76-mt7921-enable-VO-tx-aggregation.patch
@@ -55,33 +46,24 @@ pkgbase = linux-xanmod-rog
source = Bluetooth-btusb-Add-support-for-IMC-Networks-Mediatek-Chip.patch
source = Bluetooth-btusb-Add-support-for-Foxconn-Mediatek-Chip.patch
source = Bluetooth-btusb-Add-support-for-IMC-Networks-Mediatek-Chip-MT7921.patch
- source = 9001-v5.14.16-s0ix-patch-2021-11-02.patch
+ source = 9001-v5.15-s0ix-patch-2021-11-04.patch
validpgpkeys = ABAF11C65A2970B130ABE3C479BE3E4300411886
validpgpkeys = 647F28654894E3BD457199BE38DBBDC86092693E
- sha256sums = 7e068b5e0d26a62b10e5320b25dce57588cbbc6f781c090442138c9c9c3271b2
+ sha256sums = 57b2cf6991910e3b67a1b3490022e8a0674b6965c74c12da1e99d138d1991ee8
sha256sums = SKIP
- sha256sums = e3999a9e5957b425656bcda2a6d938175478ae9b17d15d38010e486ffbcf2076
+ sha256sums = 8209a82fe051a99f8fd6df23966278d329b98c27899d4eea4b75b5f96c6f9010
sha256sums = 1ac18cad2578df4a70f9346f7c6fccbb62f042a0ee0594817fdef9f2704904ee
sha256sums = 52fc0fcd806f34e774e36570b2a739dbdf337f7ff679b1c1139bee54d03301eb
- sha256sums = 3c7ae911838cda30992d5a7fdf34b40494d31ba5765b834549aa276b1fa833e3
- sha256sums = deffeac14f6d9393e82595f6b6ec0e2a71f3b873a1996159577aa2522d6207c4
+ sha256sums = 98fc296ed8f68d77e0655298ac1775edde06234007a17dc32617bc9801b030a9
sha256sums = 923230ed8367e28adfdeed75d3cdba9eec6b781818c37f6f3d3eb64101d2e716
sha256sums = f7a4bf6293912bfc4a20743e58a5a266be8c4dbe3c1862d196d3a3b45f2f7c90
- sha256sums = de8c9747637768c4356c06aa65c3f157c526aa420f21fdd5edd0ed06f720a62e
sha256sums = cc401107f1bf7b7d8e8a78ee594f9db4b6fa252b7239b6aa88f678aef84d935c
sha256sums = 3d8961438b5c8110588ff0b881d472fc71a4304d306808d78a4055a4150f351e
sha256sums = f47a5a5e329e410a0ae7d46b450707d5575a4deda5b3b58281f5eca14938fb21
- sha256sums = e4e55dd548c7689596a7c5c42e49c8f072bd2613bd416c6910b5c6410120eb1d
- sha256sums = 1ab75535772c63567384eb2ac74753e4d5db2f3317cb265aedf6151b9f18c6c2
- sha256sums = 8cc771f37ee08ad5796e6db64f180c1415a5f6e03eb3045272dade30ca754b53
- sha256sums = f3461e7cc759fd4cef2ec5c4fa15b80fa6d37e16008db223f77ed88a65aa938e
- sha256sums = ec317cc2c2c8c1186c4f553fdd010adc013c37600a499802473653fd8e7564df
sha256sums = 544464bf0807b324120767d55867f03014a9fda4e1804768ca341be902d7ade4
- sha256sums = 4ef12029ea73ca924b6397e1de4911e84d9e77ddaccdab1ef579823d848524e8
sha256sums = 0c422d8f420c1518aab1b980c6cdb6e029a4fa9cde1fd99a63670bb105a44f36
sha256sums = 2163cb2e394a013042a40cd3b00dae788603284b20d71e262995366c5534e480
sha256sums = a01cf700d79b983807e2285be1b30df6e02db6adfd9c9027fe2dfa8ca5a74bc9
- sha256sums = 9f6b8c3ea6e1c285e0a7efda4d743dbae343bc6ee7ad599a4ab7d380c750bc83
sha256sums = 4bfbff4eba07fc9de2ce78097a4a269509468ba0e24c15a82905cd94e093ad55
sha256sums = 021f8539ab2fb722b46937b95fdab22a2308236a24ecc1a9ea8db4853721dd39
sha256sums = 1ce9fd988201c4d2e48794c58acda5b768ec0fea1d29555e99d35cd2712281e4
@@ -97,7 +79,7 @@ pkgbase = linux-xanmod-rog
sha256sums = 292a7e32b248c7eee6e2f5407d609d03d985f367d329adb02b9d6dba1f85b44c
sha256sums = 7dbfdd120bc155cad1879579cb9dd1185eb5e37078c8c93fef604a275a163812
sha256sums = 1444af2e125080934c67b6adb4561fd354a72ce47d3de393b24f53832ee492ac
- sha256sums = 67421174b6dfd18beb9e6f06a54c15e425a9568cd9412cd0625d11fee65d3ab7
+ sha256sums = 03a01e5caa9aa79c9f3643668f4b1e5d52ea2aeed191b8a5e3c869bca07f8c82
pkgname = linux-xanmod-rog
pkgdesc = The Linux kernel and modules with Xanmod and ASUS ROG laptop patches (Zephyrus G14, G15, etc)
diff --git a/.gitignore b/.gitignore
index df25090fd770..cf8eb222e643 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,8 @@
-src-cache/
src-cache
src/
pkg/
-patches/
buildlog*
*log
*.pkg.tar.*
*.sig
+config.last
diff --git a/1-1-Bluetooth-btusb-Enable-MSFT-extension-for-Mediatek-Chip-MT7921.patch b/1-1-Bluetooth-btusb-Enable-MSFT-extension-for-Mediatek-Chip-MT7921.patch
deleted file mode 100644
index c13ab0806638..000000000000
--- a/1-1-Bluetooth-btusb-Enable-MSFT-extension-for-Mediatek-Chip-MT7921.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From: <mark-yw.chen@mediatek.com>
-To: <marcel@holtmann.org>, <johan.hedberg@gmail.com>
-CC: <chris.lu@mediatek.com>, <will-cy.lee@mediatek.com>,
- <sean.wang@mediatek.com>, <linux-bluetooth@vger.kernel.org>,
- <linux-mediatek@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
- <michaelfsun@google.com>, <shawnku@google.com>, <jemele@google.com>,
- <apusaka@google.com>, mark-yw.chen <mark-yw.chen@mediatek.com>
-Subject: [PATCH 1/1] Bluetooth: btusb: Enable MSFT extension for Mediatek Chip
- (MT7921)
-Date: Mon, 2 Aug 2021 20:59:41 +0800
-
-From: "mark-yw.chen" <mark-yw.chen@mediatek.com>
-
-The Mdiatek MT7921(7961) support MSFT HCI extensions, we are using
-0xFD30 for VsMsftOpCode.
-
-Signed-off-by: mark-yw.chen <mark-yw.chen@mediatek.com>
----
- drivers/bluetooth/btusb.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
-index fec798dadd99..b1a05bb9f4bf 100644
---- a/drivers/bluetooth/btusb.c
-+++ b/drivers/bluetooth/btusb.c
-@@ -3775,6 +3775,8 @@ static int btusb_mtk_setup(struct hci_dev *hdev)
- bt_dev_err(hdev, "Failed to send wmt func ctrl (%d)", err);
- return err;
- }
-+
-+ hci_set_msft_opcode(hdev, 0xFD30);
- goto done;
- default:
- bt_dev_err(hdev, "Unsupported hardware variant (%08x)",
diff --git a/9001-v5.14.16-s0ix-patch-2021-11-02.patch b/9001-v5.15-s0ix-patch-2021-11-04.patch
index 1191c8585d3b..e355d4a73d85 100644
--- a/9001-v5.14.16-s0ix-patch-2021-11-02.patch
+++ b/9001-v5.15-s0ix-patch-2021-11-04.patch
@@ -1,11 +1,11 @@
-From dd99d42fd79c5cd66170f5a3892febd33b768556 Mon Sep 17 00:00:00 2001
+From 453ac7e441998d9fbd48e56506bdd6f697f85736 Mon Sep 17 00:00:00 2001
From: Scott B <arglebargle@arglebargle.dev>
-Date: Tue, 2 Nov 2021 14:33:52 -0700
-Subject: [PATCH] v5.14.16 s0ix patch 2021-11-02
+Date: Thu, 4 Nov 2021 20:03:10 -0700
+Subject: [PATCH] v5.15 s0ix patch 2021-11-04
Squashed commit of the following:
-commit 3f296b0bccfc9ff5c855b817acb3df3c1e983aee
+commit 6bdd54fa7d0770fcfdde3a969876ed54673cfdd5
Author: Mario Limonciello <mario.limonciello@amd.com>
Date: Tue Sep 28 11:00:40 2021 -0500
@@ -36,7 +36,7 @@ Date: Tue Sep 28 11:00:40 2021 -0500
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Change-Id: Ic3a1ed188abad21f94c8dd82c2eeed43117b1dbe
-commit 80cf43cdd48523059267f918aacac8e6c55aee4f
+commit 4ccffecb1210fd7b38e1b584b35d00d52fe685dc
Author: Sanket Goswami <Sanket.Goswami@amd.com>
Date: Thu Oct 28 17:09:35 2021 +0530
@@ -54,7 +54,7 @@ Date: Thu Oct 28 17:09:35 2021 +0530
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
-commit 536c848847b97ceb286be562cb1229bdec630c0e
+commit c76c8b2d6497dcc828fbb5ca1c1a24b456feab52
Author: Sanket Goswami <Sanket.Goswami@amd.com>
Date: Thu Oct 28 17:09:34 2021 +0530
@@ -65,7 +65,7 @@ Date: Thu Oct 28 17:09:34 2021 +0530
Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
-commit f1966e02634cbb68d3ad8ac69cdcc5266e89efbf
+commit eb36880e53d06c51941c8760e951e455d2b4dc92
Author: Sanket Goswami <Sanket.Goswami@amd.com>
Date: Thu Oct 28 17:09:33 2021 +0530
@@ -76,7 +76,7 @@ Date: Thu Oct 28 17:09:33 2021 +0530
Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
-commit b3c98c2df6b0ad8f8c212294d83e01bf5e682150
+commit d7245e84b1abd655c34276c34b46e22786e196b0
Author: Mario Limonciello <mario.limonciello@amd.com>
Date: Sun Oct 31 20:48:53 2021 -0500
@@ -95,7 +95,7 @@ Date: Sun Oct 31 20:48:53 2021 -0500
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
-commit 050a6d3ffb1f284f350952f43329ddd9818909be
+commit e63e24d5c814734ea52e21d85054ee98fa56fa0f
Author: Mario Limonciello <mario.limonciello@amd.com>
Date: Fri Oct 29 15:40:16 2021 -0500
@@ -111,7 +111,7 @@ Date: Fri Oct 29 15:40:16 2021 -0500
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
-commit bce1facca6cf3fb3b2504b86fedb32bc67865b21
+commit 8f1609f26f32b629304f8fee5ff359c58e5eade0
Author: Hans de Goede <hdegoede@redhat.com>
Date: Tue Nov 2 16:32:56 2021 +0100
@@ -127,7 +127,7 @@ Date: Tue Nov 2 16:32:56 2021 +0100
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Mario Limonciello <mario.limonciello@amd.com>
-commit 920a48001f0154e447f57b7e0394ce1389d2a4dc
+commit 4016da45040d2625a8cf822bc02091ca16d36409
Author: Mario Limonciello <mario.limonciello@amd.com>
Date: Tue Oct 26 12:14:43 2021 -0500
@@ -138,7 +138,7 @@ Date: Tue Oct 26 12:14:43 2021 -0500
Suggested-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
-commit 0c01fd295f6bd0aa960719cce745ce17afb0c9e9
+commit eac1b32f6cce4a8b416029fbaa0b9218353583fd
Author: Mario Limonciello <mario.limonciello@amd.com>
Date: Tue Oct 26 12:14:42 2021 -0500
@@ -150,7 +150,7 @@ Date: Tue Oct 26 12:14:42 2021 -0500
Suggested-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
-commit 6000883b8c6e0431c359bd69fedf195194c9b462
+commit 6c12d3aba8789b49bc4b82d76e905e4d1a84bbb9
Author: Mario Limonciello <mario.limonciello@amd.com>
Date: Tue Oct 26 12:14:41 2021 -0500
@@ -164,7 +164,7 @@ Date: Tue Oct 26 12:14:41 2021 -0500
Fixes: 59348401ebed ("platform/x86: amd-pmc: Add special handling for timer based S0i3 wakeup")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
-commit de3d852b6fb9cc59f6e1b7a9bc0ad6fa026e1229
+commit 6ac4a98e4ca2b1dcb72e49de93211acb9f399f1e
Author: Mario Limonciello <mario.limonciello@amd.com>
Date: Wed Oct 20 11:29:46 2021 -0500
@@ -187,7 +187,7 @@ Date: Wed Oct 20 11:29:46 2021 -0500
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
-commit a97c915815b2b6ade1ad43dd018a7f7220249ab5
+commit b7f215dee5b17eb26ff39c09fcf5dcc3b55c5570
Author: Mario Limonciello <mario.limonciello@amd.com>
Date: Wed Oct 20 11:29:45 2021 -0500
@@ -201,7 +201,7 @@ Date: Wed Oct 20 11:29:45 2021 -0500
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
-commit 4a80b8cebdb3e71975640e015e7ff8815c872f2a
+commit c738c0930b1e8edc8a0f3425de9342cea0b7bfc0
Author: Scott B <arglebargle@arglebargle.dev>
Date: Thu Oct 14 02:22:21 2021 -0700
@@ -210,7 +210,7 @@ Date: Thu Oct 14 02:22:21 2021 -0700
replacement for 4df3adab896f843afe5bca5960fbca6ff2cc407e per lijo lazar
see: https://gitlab.freedesktop.org/drm/amd/-/issues/1710#note_1102805
-commit d6d7232eacc074260d0d7dc7300023c2ad2d5086
+commit 326ad78248530c566707ec74241d7f64d70199d1
Author: Scott B <arglebargle@arglebargle.dev>
Date: Thu Oct 14 02:16:16 2021 -0700
@@ -218,7 +218,7 @@ Date: Thu Oct 14 02:16:16 2021 -0700
This reverts commit 4df3adab896f843afe5bca5960fbca6ff2cc407e.
-commit 6d4f4d2716c3e5152f3e9d5378b6c65201c26568
+commit bacdd913c9f333f1075bf8b8e26ca0fca0ba93a2
Author: Hans de Goede <hdegoede@redhat.com>
Date: Tue Sep 28 16:21:22 2021 +0200
@@ -237,7 +237,7 @@ Date: Tue Sep 28 16:21:22 2021 +0200
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-commit cf14324fa87a87c518e63ea0c7ed94ed94e39410
+commit c93d488a712caa8c08b11802bf02305f2a157199
Author: Mario Limonciello <mario.limonciello@amd.com>
Date: Fri Sep 24 12:32:06 2021 -0500
@@ -250,7 +250,7 @@ Date: Fri Sep 24 12:32:06 2021 -0500
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Change-Id: I34f5ca978aab69ff0a0906191eec21649b19fe27
-commit 94749039d6e1e5a34b61325789d147a614f4b84e
+commit d2b71a18d8ae450d26d2a475dc5bda28da09919e
Author: Sanket Goswami <Sanket.Goswami@amd.com>
Date: Tue Sep 21 17:30:20 2021 +0530
@@ -262,7 +262,7 @@ Date: Tue Sep 21 17:30:20 2021 +0530
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
-commit 22b19142456dac63df6572e314bafdd0849bb05a
+commit d9eb018a52af1451a72389b76326f5246a67c543
Author: Sanket Goswami <Sanket.Goswami@amd.com>
Date: Tue Sep 21 17:29:10 2021 +0530
@@ -277,7 +277,7 @@ Date: Tue Sep 21 17:29:10 2021 +0530
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
-commit 51a75d5d3b1662cee0445ab360fbee19259c2f37
+commit 4851b6540bd2fbae04435179be8f3ba2e46174f1
Author: Sanket Goswami <Sanket.Goswami@amd.com>
Date: Thu Sep 16 18:11:30 2021 +0530
@@ -290,7 +290,7 @@ Date: Thu Sep 16 18:11:30 2021 +0530
Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
-commit 2131722f974e158dbad412ec4caf65ffaf2f9844
+commit 053bd7d9cf67f78c37559ff3f63292065b788df9
Author: Sanket Goswami <Sanket.Goswami@amd.com>
Date: Thu Sep 16 18:10:02 2021 +0530
@@ -309,7 +309,7 @@ Date: Thu Sep 16 18:10:02 2021 +0530
Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
-commit 694f519cb333009c26b1ea82203928e5daf51469
+commit 5ba1eb1a6352b5c835b8a876f0e924c561be7c3e
Author: Mario Limonciello <mario.limonciello@amd.com>
Date: Wed Sep 15 16:52:16 2021 -0500
@@ -323,46 +323,19 @@ Date: Wed Sep 15 16:52:16 2021 -0500
BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1708
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
-
-commit f219ce3e11d0da3f2057c187367266a4819bff49
-Author: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
-Date: Tue Aug 31 17:36:12 2021 +0530
-
- pinctrl: amd: Add irq field data
-
- pinctrl_amd use gpiochip_get_data() to get their local state containers
- back from the gpiochip passed as amd_gpio chip data.
-
- Hence added irq field data to get directly using amd_gpio chip data.
-
- Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
-
-commit 04de779b9e157850e083af79409468498b11a974
-Author: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
-Date: Tue Aug 31 17:36:13 2021 +0530
-
- pinctrl: amd: Handle wake-up interrupt
-
- Enable/disable power management wakeup mode, which is disabled by
- default. enable_irq_wake enables wakes the system from sleep.
-
- Hence added enable/disable irq_wake to handle wake-up interrupt.
-
- Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
---
drivers/acpi/processor_idle.c | 3 +-
drivers/acpi/x86/s2idle.c | 6 +
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 14 +-
.../gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 2 +
- drivers/pinctrl/pinctrl-amd.c | 48 ++-
- drivers/pinctrl/pinctrl-amd.h | 1 +
+ drivers/pinctrl/pinctrl-amd.c | 29 +-
drivers/platform/x86/Kconfig | 2 +-
drivers/platform/x86/amd-pmc.c | 322 ++++++++++++++++--
include/linux/acpi.h | 9 +
- 9 files changed, 366 insertions(+), 41 deletions(-)
+ 8 files changed, 351 insertions(+), 36 deletions(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
-index 095c8aca141e..1b6529396371 100644
+index f37fba9e5ba0..9d378dc9e928 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -789,7 +789,8 @@ static int acpi_processor_setup_cstates(struct acpi_processor *pr)
@@ -393,7 +366,7 @@ index 1c48358b43ba..0b65d4623214 100644
acpi_handle_info(handle,
"LPI: Constraint not met; min power state:%s current power state:%s\n",
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
-index 1795d448c700..b4ced45301be 100644
+index 1916ec84dd71..e7f06bd0f0cd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -31,8 +31,6 @@
@@ -432,10 +405,10 @@ index 1795d448c700..b4ced45301be 100644
if (adev->gfx.gfx_off_req_count == 0) {
cancel_delayed_work_sync(&adev->gfx.gfx_off_delay_work);
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
-index 9a9c24a6ec35..3891fe8cd7fb 100644
+index 145f13b8c977..25d9e5b22cd3 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
-@@ -1376,6 +1376,8 @@ static ssize_t renoir_get_gpu_metrics(struct smu_context *smu,
+@@ -1378,6 +1378,8 @@ static ssize_t renoir_get_gpu_metrics(struct smu_context *smu,
static int renoir_gfx_state_change_set(struct smu_context *smu, uint32_t state)
{
@@ -445,34 +418,10 @@ index 9a9c24a6ec35..3891fe8cd7fb 100644
return 0;
}
diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
-index c5fd75bbf5d9..90f874434e23 100644
+index bae9d429b813..ecab9064a845 100644
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
-@@ -445,6 +445,7 @@ static int amd_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
- struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
- struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
- u32 wake_mask = BIT(WAKE_CNTRL_OFF_S0I3) | BIT(WAKE_CNTRL_OFF_S3);
-+ int err;
-
- raw_spin_lock_irqsave(&gpio_dev->lock, flags);
- pin_reg = readl(gpio_dev->base + (d->hwirq)*4);
-@@ -457,6 +458,15 @@ static int amd_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
- writel(pin_reg, gpio_dev->base + (d->hwirq)*4);
- raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
-
-+ if (on)
-+ err = enable_irq_wake(gpio_dev->irq);
-+ else
-+ err = disable_irq_wake(gpio_dev->irq);
-+
-+ if (err)
-+ dev_err(&gpio_dev->pdev->dev, "failed to %s wake-up interrupt\n",
-+ on ? "enable" : "disable");
-+
- return 0;
- }
-
-@@ -588,14 +598,14 @@ static struct irq_chip amd_gpio_irqchip = {
+@@ -598,14 +598,14 @@ static struct irq_chip amd_gpio_irqchip = {
#define PIN_IRQ_PENDING (BIT(INTERRUPT_STS_OFF) | BIT(WAKE_STS_OFF))
@@ -489,7 +438,7 @@ index c5fd75bbf5d9..90f874434e23 100644
u32 regval;
u64 status, mask;
-@@ -617,6 +627,14 @@ static irqreturn_t amd_gpio_irq_handler(int irq, void *dev_id)
+@@ -627,6 +627,14 @@ static irqreturn_t amd_gpio_irq_handler(int irq, void *dev_id)
/* Each status bit covers four pins */
for (i = 0; i < 4; i++) {
regval = readl(regs + i);
@@ -504,7 +453,7 @@ index c5fd75bbf5d9..90f874434e23 100644
if (!(regval & PIN_IRQ_PENDING) ||
!(regval & BIT(INTERRUPT_MASK_OFF)))
continue;
-@@ -642,9 +660,12 @@ static irqreturn_t amd_gpio_irq_handler(int irq, void *dev_id)
+@@ -650,9 +658,12 @@ static irqreturn_t amd_gpio_irq_handler(int irq, void *dev_id)
}
writel(regval, regs + i);
raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
@@ -518,7 +467,7 @@ index c5fd75bbf5d9..90f874434e23 100644
/* Signal EOI to the GPIO unit */
raw_spin_lock_irqsave(&gpio_dev->lock, flags);
-@@ -656,6 +677,16 @@ static irqreturn_t amd_gpio_irq_handler(int irq, void *dev_id)
+@@ -664,6 +675,16 @@ static irqreturn_t amd_gpio_irq_handler(int irq, void *dev_id)
return ret;
}
@@ -535,35 +484,7 @@ index c5fd75bbf5d9..90f874434e23 100644
static int amd_get_groups_count(struct pinctrl_dev *pctldev)
{
struct amd_gpio *gpio_dev = pinctrl_dev_get_drvdata(pctldev);
-@@ -932,7 +963,6 @@ static struct pinctrl_desc amd_pinctrl_desc = {
- static int amd_gpio_probe(struct platform_device *pdev)
- {
- int ret = 0;
-- int irq_base;
- struct resource *res;
- struct amd_gpio *gpio_dev;
- struct gpio_irq_chip *girq;
-@@ -955,9 +985,9 @@ static int amd_gpio_probe(struct platform_device *pdev)
- if (!gpio_dev->base)
- return -ENOMEM;
-
-- irq_base = platform_get_irq(pdev, 0);
-- if (irq_base < 0)
-- return irq_base;
-+ gpio_dev->irq = platform_get_irq(pdev, 0);
-+ if (gpio_dev->irq < 0)
-+ return gpio_dev->irq;
-
- #ifdef CONFIG_PM_SLEEP
- gpio_dev->saved_regs = devm_kcalloc(&pdev->dev, amd_pinctrl_desc.npins,
-@@ -1020,12 +1050,13 @@ static int amd_gpio_probe(struct platform_device *pdev)
- goto out2;
- }
-
-- ret = devm_request_irq(&pdev->dev, irq_base, amd_gpio_irq_handler,
-+ ret = devm_request_irq(&pdev->dev, gpio_dev->irq, amd_gpio_irq_handler,
- IRQF_SHARED, KBUILD_MODNAME, gpio_dev);
- if (ret)
+@@ -1033,6 +1054,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
goto out2;
platform_set_drvdata(pdev, gpio_dev);
@@ -571,7 +492,7 @@ index c5fd75bbf5d9..90f874434e23 100644
dev_dbg(&pdev->dev, "amd gpio driver loaded\n");
return ret;
-@@ -1043,6 +1074,7 @@ static int amd_gpio_remove(struct platform_device *pdev)
+@@ -1050,6 +1072,7 @@ static int amd_gpio_remove(struct platform_device *pdev)
gpio_dev = platform_get_drvdata(pdev);
gpiochip_remove(&gpio_dev->gc);
@@ -579,23 +500,11 @@ index c5fd75bbf5d9..90f874434e23 100644
return 0;
}
-diff --git a/drivers/pinctrl/pinctrl-amd.h b/drivers/pinctrl/pinctrl-amd.h
-index 95e763424042..1d4317073654 100644
---- a/drivers/pinctrl/pinctrl-amd.h
-+++ b/drivers/pinctrl/pinctrl-amd.h
-@@ -98,6 +98,7 @@ struct amd_gpio {
- struct resource *res;
- struct platform_device *pdev;
- u32 *saved_regs;
-+ int irq;
- };
-
- /* KERNCZ configuration*/
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
-index d12db6c316ea..211c3156fb01 100644
+index e21ea3d23e6f..4cc2782635ec 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
-@@ -192,7 +192,7 @@ config ACER_WMI
+@@ -170,7 +170,7 @@ config ACER_WMI
config AMD_PMC
tristate "AMD SoC PMC driver"
@@ -1099,7 +1008,7 @@ index fc95620101e8..2c1bebf972c1 100644
static int amd_pmc_remove(struct platform_device *pdev)
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
-index 72e4f7fd268c..e29b4c1da377 100644
+index 974d497a897d..6224b1e32681 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -976,6 +976,15 @@ static inline int acpi_get_local_address(acpi_handle handle, u32 *addr)
diff --git a/9002-Issue-1710-1712-debugging-and-speculative-fixes.patch b/9002-Issue-1710-1712-debugging-and-speculative-fixes.patch
deleted file mode 100644
index 8b137891791f..000000000000
--- a/9002-Issue-1710-1712-debugging-and-speculative-fixes.patch
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/HID-asus-Prevent-Claymore-sending-suspend-event.patch b/HID-asus-Prevent-Claymore-sending-suspend-event.patch
deleted file mode 100644
index c72d5ce0e0a7..000000000000
--- a/HID-asus-Prevent-Claymore-sending-suspend-event.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From patchwork Sat Aug 7 02:49:21 2021
-From: "Luke D. Jones" <luke@ljones.dev>
-To: linux-input@vger.kernel.org
-Cc: linux-kernel@vger.kernel.org, jikos@kernel.org,
- benjamin.tissoires@redhat.com, "Luke D. Jones" <luke@ljones.dev>
-Subject: [PATCH] HID: asus: Prevent Claymore sending suspend event
-Date: Sat, 7 Aug 2021 14:49:21 +1200
-Message-Id: <20210807024921.26479-1-luke@ljones.dev>
-List-ID: <linux-input.vger.kernel.org>
-X-Mailing-List: linux-input@vger.kernel.org
-
-Prevent the ASUS Claymore keyboard from sending a suspend event
-when the device sleeps itself. The suspend event causes a system
-suspend if uncaught.
-
-Signed off by: Luke D Jones <luke@ljones.dev>
----
- drivers/hid/hid-asus.c | 15 +++++++++++++++
- drivers/hid/hid-ids.h | 1 +
- 2 files changed, 16 insertions(+)
-
-diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
-index fca8fc78a78a..9de0129fc3d4 100644
---- a/drivers/hid/hid-asus.c
-+++ b/drivers/hid/hid-asus.c
-@@ -82,6 +82,7 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad");
- #define QUIRK_T90CHI BIT(9)
- #define QUIRK_MEDION_E1239T BIT(10)
- #define QUIRK_ROG_NKEY_KEYBOARD BIT(11)
-+#define QUIRK_ROG_CLAYMORE_II_KEYBOARD BIT(12)
-
- #define I2C_KEYBOARD_QUIRKS (QUIRK_FIX_NOTEBOOK_REPORT | \
- QUIRK_NO_INIT_REPORTS | \
-@@ -366,6 +367,17 @@ static int asus_raw_event(struct hid_device *hdev,
-
- }
-
-+ if (drvdata->quirks & QUIRK_ROG_CLAYMORE_II_KEYBOARD) {
-+ /*
-+ * CLAYMORE II keyboard sends this packet when it goes to sleep
-+ * this causes the whole system to go into suspend.
-+ */
-+
-+ if(size == 2 && data[0] == 0x02 && data[1] == 0x00) {
-+ return -1;
-+ }
-+ }
-+
- return 0;
- }
-
-@@ -1228,6 +1240,9 @@ static const struct hid_device_id asus_devices[] = {
- { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
- USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2),
- QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD },
-+ { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
-+ USB_DEVICE_ID_ASUSTEK_ROG_CLAYMORE_II_KEYBOARD),
-+ QUIRK_ROG_CLAYMORE_II_KEYBOARD },
- { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
- USB_DEVICE_ID_ASUSTEK_T100TA_KEYBOARD),
- QUIRK_T100_KEYBOARD | QUIRK_NO_CONSUMER_USAGES },
-diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
-index b84a0a11e05b..c5d5e6f269a0 100644
---- a/drivers/hid/hid-ids.h
-+++ b/drivers/hid/hid-ids.h
-@@ -197,6 +197,7 @@
- #define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD3 0x1822
- #define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD 0x1866
- #define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2 0x19b6
-+#define USB_DEVICE_ID_ASUSTEK_ROG_CLAYMORE_II_KEYBOARD 0x196b
- #define USB_DEVICE_ID_ASUSTEK_FX503VD_KEYBOARD 0x1869
-
- #define USB_VENDOR_ID_ATEN 0x0557
diff --git a/Linux-5.15.1-rc1.patch b/Linux-5.15.1-rc1.patch
new file mode 100644
index 000000000000..2812c0fdf56d
--- /dev/null
+++ b/Linux-5.15.1-rc1.patch
@@ -0,0 +1,829 @@
+From 6adeecffa50f38f177de111a930087d444458160 Mon Sep 17 00:00:00 2001
+From: Scott B <arglebargle@arglebargle.dev>
+Date: Thu, 4 Nov 2021 19:57:50 -0700
+Subject: [PATCH] Linux 5.15.1-rc1
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Squashed commit of the following:
+
+commit feb80b14f66dd9b7c828d80089ab163ed5478840
+Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Thu Nov 4 15:11:59 2021 +0100
+
+ Linux 5.15.1-rc1
+
+commit 0b319aec83939b2c6129c3ea864dea9760f3e3f6
+Author: Takashi Iwai <tiwai@suse.de>
+Date: Tue Nov 2 17:18:59 2021 +0100
+
+ ALSA: usb-audio: Add quirk for Audient iD14
+
+ commit df0380b9539b04c1ae8854a984098da06d5f1e67 upstream.
+
+ Audient iD14 (2708:0002) may get a control message error that
+ interferes the operation e.g. with alsactl. Add the quirk to ignore
+ such errors like other devices.
+
+ BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1191247
+ Cc: <stable@vger.kernel.org>
+ Link: https://lore.kernel.org/r/20211102161859.19301-1-tiwai@suse.de
+ Signed-off-by: Takashi Iwai <tiwai@suse.de>
+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit 3903803b0078aabdec33788660d2d09f4746727f
+Author: Matthew Brost <matthew.brost@intel.com>
+Date: Thu Sep 9 09:47:28 2021 -0700
+
+ Revert "drm/i915/gt: Propagate change in error status to children on unhold"
+
+ commit ac653dd7996edf1770959e11a078312928bd7315 upstream.
+
+ Propagating errors to dependent fences is broken and can lead to errors
+ from one client ending up in another. In commit 3761baae908a ("Revert
+ "drm/i915: Propagate errors on awaiting already signaled fences""), we
+ attempted to get rid of fence error propagation but missed the case
+ added in commit 8e9f84cf5cac ("drm/i915/gt: Propagate change in error
+ status to children on unhold"). Revert that one too. This error was
+ found by an up-and-coming selftest which triggers a reset during
+ request cancellation and verifies that subsequent requests complete
+ successfully.
+
+ v2:
+ (Daniel Vetter)
+ - Use revert
+ v3:
+ (Jason)
+ - Update commit message
+
+ v4 (Daniele):
+ - fix checkpatch error in commit message.
+
+ References: '3761baae908a ("Revert "drm/i915: Propagate errors on awaiting already signaled fences"")'
+ Signed-off-by: Matthew Brost <matthew.brost@intel.com>
+ Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
+ Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+ Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
+ Link: https://patchwork.freedesktop.org/patch/msgid/20210909164744.31249-8-matthew.brost@intel.com
+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit 04a693b76ca79d95fb36f568495e7c5697789bb2
+Author: Anson Jacob <Anson.Jacob@amd.com>
+Date: Tue Aug 24 09:32:53 2021 -0400
+
+ drm/amd/display: Revert "Directly retrain link from debugfs"
+
+ commit 1131cadfd7563975f3a4efcc6f7c1fdc872db38b upstream.
+
+ This reverts commit f5b6a20c7ef40599095c796b0500d842ffdbc639.
+
+ This patch broke new settings from taking effect. Hotplug is
+ required for new settings to take effect.
+
+ Reviewed-by: Mikita Lipski <mikita.lipski@amd.com>
+ Acked-by: Mikita Lipski <mikita.lipski@amd.com>
+ Signed-off-by: Anson Jacob <Anson.Jacob@amd.com>
+ Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
+ Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit e819e0776cffaa6b31ef5f8e91c55df3446d6cfe
+Author: Christian König <christian.koenig@amd.com>
+Date: Thu Sep 30 11:22:51 2021 +0200
+
+ drm/amdgpu: revert "Add autodump debugfs node for gpu reset v8"
+
+ commit c8365dbda056578eebe164bf110816b1a39b4b7f upstream.
+
+ This reverts commit 728e7e0cd61899208e924472b9e641dbeb0775c4.
+
+ Further discussion reveals that this feature is severely broken
+ and needs to be reverted ASAP.
+
+ GPU reset can never be delayed by userspace even for debugging or
+ otherwise we can run into in kernel deadlocks.
+
+ Signed-off-by: Christian König <christian.koenig@amd.com>
+ Acked-by: Alex Deucher <alexander.deucher@amd.com>
+ Acked-by: Nirmoy Das <nirmoy.das@amd.com>
+ Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit e85b2b361dbcbe3309234e63e3a2e783f8760fca
+Author: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
+Date: Fri Oct 22 15:04:47 2021 +0100
+
+ Revert "wcn36xx: Disable bmps when encryption is disabled"
+
+ commit 285bb1738e196507bf985574d0bc1e9dd72d46b1 upstream.
+
+ This reverts commit c6522a5076e1a65877c51cfee313a74ef61cabf8.
+
+ Testing on tip-of-tree shows that this is working now. Revert this and
+ re-enable BMPS for Open APs.
+
+ Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
+ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
+ Link: https://lore.kernel.org/r/20211022140447.2846248-3-bryan.odonoghue@linaro.org
+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit c368fbf3a63a022e58a25feb49d90f69a0c463cb
+Author: Wang Kefeng <wangkefeng.wang@huawei.com>
+Date: Mon Aug 23 10:41:42 2021 +0100
+
+ ARM: 9120/1: Revert "amba: make use of -1 IRQs warn"
+
+ commit eb4f756915875b0ea0757751cd29841f0504d547 upstream.
+
+ After commit 77a7300abad7 ("of/irq: Get rid of NO_IRQ usage"),
+ no irq case has been removed, irq_of_parse_and_map() will return
+ 0 in all cases when get error from parse and map an interrupt into
+ linux virq space.
+
+ amba_device_register() is only used on no-DT initialization, see
+ s3c64xx_pl080_init() arch/arm/mach-s3c/pl080.c
+ ep93xx_init_devices() arch/arm/mach-ep93xx/core.c
+
+ They won't set -1 to irq[0], so no need the warn.
+
+ This reverts commit 2eac58d5026e4ec8b17ff8b62877fea9e1d2f1b3.
+
+ Reviewed-by: Rob Herring <robh@kernel.org>
+ Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
+ Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit de867e1f164779b5872226f1dbaeb1815e8e9c2b
+Author: Lucas Stach <l.stach@pengutronix.de>
+Date: Sat Oct 2 02:59:37 2021 +0200
+
+ Revert "soc: imx: gpcv2: move reset assert after requesting domain power up"
+
+ commit 2b2f106eb55276a60a89ac27a52d0d738b57a546 upstream.
+
+ This reverts commit a77ebdd9f553. It turns out that the VPU domain has no
+ different requirements, even though the downstream ATF implementation seems
+ to suggest otherwise. Powering on the domain with the reset asserted works
+ fine. As the changed sequence has caused sporadic issues with the GPU
+ domains, just revert the change to go back to the working sequence.
+
+ Cc: <stable@vger.kernel.org> # 5.14
+ Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
+ Acked-by: Peng Fan <peng.fan@nxp.com>
+ Tested-by: Adam Ford <aford173@gmail.com> #imx8mm-beacon
+ Signed-off-by: Shawn Guo <shawnguo@kernel.org>
+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit cd8973fd8c59b0ffc7a3737b2575c15e88117290
+Author: Yifan Zhang <yifan1.zhang@amd.com>
+Date: Mon Oct 11 20:37:01 2021 +0800
+
+ drm/amdkfd: fix boot failure when iommu is disabled in Picasso.
+
+ commit afd18180c07026f94a80ff024acef5f4159084a4 upstream.
+
+ When IOMMU disabled in sbios and kfd in iommuv2 path, iommuv2
+ init will fail. But this failure should not block amdgpu driver init.
+
+ Reported-by: youling <youling257@gmail.com>
+ Tested-by: youling <youling257@gmail.com>
+ Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
+ Reviewed-by: James Zhu <James.Zhu@amd.com>
+ Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit 278d476f35636d0df40983b45130928c7e599066
+Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Wed Nov 3 16:51:36 2021 +0100
+
+ Revert "usb: core: hcd: Add support for deferring roothub registration"
+
+ This reverts commit 58877b0824da15698bd85a0a9dbfa8c354e6ecb7.
+
+ It has been reported to be causing problems in Arch and Fedora bug
+ reports.
+
+ Reported-by: Hans de Goede <hdegoede@redhat.com>
+ Link: https://bbs.archlinux.org/viewtopic.php?pid=2000956#p2000956
+ Link: https://bugzilla.redhat.com/show_bug.cgi?id=2019542
+ Link: https://bugzilla.redhat.com/show_bug.cgi?id=2019576
+ Link: https://lore.kernel.org/r/42bcbea6-5eb8-16c7-336a-2cb72e71bc36@redhat.com
+ Cc: Mathias Nyman <mathias.nyman@linux.intel.com>
+ Cc: Chris Chiu <chris.chiu@canonical.com>
+ Cc: Alan Stern <stern@rowland.harvard.edu>
+ Cc: Kishon Vijay Abraham I <kishon@ti.com>
+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit 3aa6ff297f5f82226d668d7f11cf3dd5bdd4a3ab
+Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Wed Nov 3 16:51:12 2021 +0100
+
+ Revert "xhci: Set HCD flag to defer primary roothub registration"
+
+ This reverts commit b7a0a792f864583207c593b50fd1b752ed89f4c1.
+
+ It has been reported to be causing problems in Arch and Fedora bug
+ reports.
+
+ Reported-by: Hans de Goede <hdegoede@redhat.com>
+ Link: https://bbs.archlinux.org/viewtopic.php?pid=2000956#p2000956
+ Link: https://bugzilla.redhat.com/show_bug.cgi?id=2019542
+ Link: https://bugzilla.redhat.com/show_bug.cgi?id=2019576
+ Link: https://lore.kernel.org/r/42bcbea6-5eb8-16c7-336a-2cb72e71bc36@redhat.com
+ Cc: Mathias Nyman <mathias.nyman@linux.intel.com>
+ Cc: Chris Chiu <chris.chiu@canonical.com>
+ Cc: Alan Stern <stern@rowland.harvard.edu>
+ Cc: Kishon Vijay Abraham I <kishon@ti.com>
+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit b5c2edd4a3868c186e0af37d76b86a958ff8bbcc
+Author: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Mon Jun 7 17:23:48 2021 +0200
+
+ media: firewire: firedtv-avc: fix a buffer overflow in avc_ca_pmt()
+
+ commit 35d2969ea3c7d32aee78066b1f3cf61a0d935a4e upstream.
+
+ The bounds checking in avc_ca_pmt() is not strict enough. It should
+ be checking "read_pos + 4" because it's reading 5 bytes. If the
+ "es_info_length" is non-zero then it reads a 6th byte so there needs to
+ be an additional check for that.
+
+ I also added checks for the "write_pos". I don't think these are
+ required because "read_pos" and "write_pos" are tied together so
+ checking one ought to be enough. But they make the code easier to
+ understand for me. The check on write_pos is:
+
+ if (write_pos + 4 >= sizeof(c->operand) - 4) {
+
+ The first "+ 4" is because we're writing 5 bytes and the last " - 4"
+ is to leave space for the CRC.
+
+ The other problem is that "length" can be invalid. It comes from
+ "data_length" in fdtv_ca_pmt().
+
+ Cc: stable@vger.kernel.org
+ Reported-by: Luo Likang <luolikang@nsfocus.com>
+ Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+ Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+ Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit 1fd3b5308200bb6bce0d2447997efc7758e57da8
+Author: Erik Ekman <erik@kryo.se>
+Date: Sun Oct 17 19:16:57 2021 +0200
+
+ sfc: Fix reading non-legacy supported link modes
+
+ commit 041c61488236a5a84789083e3d9f0a51139b6edf upstream.
+
+ Everything except the first 32 bits was lost when the pause flags were
+ added. This makes the 50000baseCR2 mode flag (bit 34) not appear.
+
+ I have tested this with a 10G card (SFN5122F-R7) by modifying it to
+ return a non-legacy link mode (10000baseCR).
+
+ Signed-off-by: Erik Ekman <erik@kryo.se>
+ Signed-off-by: David S. Miller <davem@davemloft.net>
+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Makefile | 4 +-
+ drivers/amba/bus.c | 3 -
+ drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 -
+ drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 80 -------------------
+ drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h | 5 --
+ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 --
+ drivers/gpu/drm/amd/amdkfd/kfd_device.c | 3 +
+ .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 3 +-
+ .../drm/i915/gt/intel_execlists_submission.c | 4 -
+ drivers/media/firewire/firedtv-avc.c | 14 +++-
+ drivers/media/firewire/firedtv-ci.c | 2 +
+ drivers/net/ethernet/sfc/ethtool_common.c | 10 +--
+ drivers/net/wireless/ath/wcn36xx/main.c | 10 ---
+ drivers/net/wireless/ath/wcn36xx/pmc.c | 5 +-
+ drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 -
+ drivers/soc/imx/gpcv2.c | 4 +-
+ drivers/usb/core/hcd.c | 29 ++-----
+ drivers/usb/host/xhci.c | 1 -
+ include/linux/usb/hcd.h | 2 -
+ sound/usb/quirks.c | 2 +
+ 20 files changed, 33 insertions(+), 159 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index ed6e7ec60eff..ba874e6cdc3f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,8 +1,8 @@
+ # SPDX-License-Identifier: GPL-2.0
+ VERSION = 5
+ PATCHLEVEL = 15
+-SUBLEVEL = 0
+-EXTRAVERSION =
++SUBLEVEL = 1
++EXTRAVERSION = -rc1
+ NAME = Trick or Treat
+
+ # *DOCUMENTATION*
+diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
+index 962041148482..6c0f7f4f7d1d 100644
+--- a/drivers/amba/bus.c
++++ b/drivers/amba/bus.c
+@@ -377,9 +377,6 @@ static int amba_device_try_add(struct amba_device *dev, struct resource *parent)
+ void __iomem *tmp;
+ int i, ret;
+
+- WARN_ON(dev->irq[0] == (unsigned int)-1);
+- WARN_ON(dev->irq[1] == (unsigned int)-1);
+-
+ ret = request_resource(parent, &dev->res);
+ if (ret)
+ goto err_out;
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+index 269437b01328..289c7dc05363 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+@@ -1078,8 +1078,6 @@ struct amdgpu_device {
+ char product_name[32];
+ char serial[20];
+
+- struct amdgpu_autodump autodump;
+-
+ atomic_t throttling_logging_enabled;
+ struct ratelimit_state throttling_logging_rs;
+ uint32_t ras_hw_enabled;
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+index 463b9c0283f7..ec30d81586a7 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+@@ -27,7 +27,6 @@
+ #include <linux/pci.h>
+ #include <linux/uaccess.h>
+ #include <linux/pm_runtime.h>
+-#include <linux/poll.h>
+
+ #include "amdgpu.h"
+ #include "amdgpu_pm.h"
+@@ -37,85 +36,7 @@
+ #include "amdgpu_securedisplay.h"
+ #include "amdgpu_fw_attestation.h"
+
+-int amdgpu_debugfs_wait_dump(struct amdgpu_device *adev)
+-{
+ #if defined(CONFIG_DEBUG_FS)
+- unsigned long timeout = 600 * HZ;
+- int ret;
+-
+- wake_up_interruptible(&adev->autodump.gpu_hang);
+-
+- ret = wait_for_completion_interruptible_timeout(&adev->autodump.dumping, timeout);
+- if (ret == 0) {
+- pr_err("autodump: timeout, move on to gpu recovery\n");
+- return -ETIMEDOUT;
+- }
+-#endif
+- return 0;
+-}
+-
+-#if defined(CONFIG_DEBUG_FS)
+-
+-static int amdgpu_debugfs_autodump_open(struct inode *inode, struct file *file)
+-{
+- struct amdgpu_device *adev = inode->i_private;
+- int ret;
+-
+- file->private_data = adev;
+-
+- ret = down_read_killable(&adev->reset_sem);
+- if (ret)
+- return ret;
+-
+- if (adev->autodump.dumping.done) {
+- reinit_completion(&adev->autodump.dumping);
+- ret = 0;
+- } else {
+- ret = -EBUSY;
+- }
+-
+- up_read(&adev->reset_sem);
+-
+- return ret;
+-}
+-
+-static int amdgpu_debugfs_autodump_release(struct inode *inode, struct file *file)
+-{
+- struct amdgpu_device *adev = file->private_data;
+-
+- complete_all(&adev->autodump.dumping);
+- return 0;
+-}
+-
+-static unsigned int amdgpu_debugfs_autodump_poll(struct file *file, struct poll_table_struct *poll_table)
+-{
+- struct amdgpu_device *adev = file->private_data;
+-
+- poll_wait(file, &adev->autodump.gpu_hang, poll_table);
+-
+- if (amdgpu_in_reset(adev))
+- return POLLIN | POLLRDNORM | POLLWRNORM;
+-
+- return 0;
+-}
+-
+-static const struct file_operations autodump_debug_fops = {
+- .owner = THIS_MODULE,
+- .open = amdgpu_debugfs_autodump_open,
+- .poll = amdgpu_debugfs_autodump_poll,
+- .release = amdgpu_debugfs_autodump_release,
+-};
+-
+-static void amdgpu_debugfs_autodump_init(struct amdgpu_device *adev)
+-{
+- init_completion(&adev->autodump.dumping);
+- complete_all(&adev->autodump.dumping);
+- init_waitqueue_head(&adev->autodump.gpu_hang);
+-
+- debugfs_create_file("amdgpu_autodump", 0600,
+- adev_to_drm(adev)->primary->debugfs_root,
+- adev, &autodump_debug_fops);
+-}
+
+ /**
+ * amdgpu_debugfs_process_reg_op - Handle MMIO register reads/writes
+@@ -1588,7 +1509,6 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)
+ }
+
+ amdgpu_ras_debugfs_create_all(adev);
+- amdgpu_debugfs_autodump_init(adev);
+ amdgpu_rap_debugfs_init(adev);
+ amdgpu_securedisplay_debugfs_init(adev);
+ amdgpu_fw_attestation_debugfs_init(adev);
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h
+index 141a8474e24f..8b641f40fdf6 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h
+@@ -26,10 +26,6 @@
+ /*
+ * Debugfs
+ */
+-struct amdgpu_autodump {
+- struct completion dumping;
+- struct wait_queue_head gpu_hang;
+-};
+
+ int amdgpu_debugfs_regs_init(struct amdgpu_device *adev);
+ int amdgpu_debugfs_init(struct amdgpu_device *adev);
+@@ -37,4 +33,3 @@ void amdgpu_debugfs_fini(struct amdgpu_device *adev);
+ void amdgpu_debugfs_fence_init(struct amdgpu_device *adev);
+ void amdgpu_debugfs_firmware_init(struct amdgpu_device *adev);
+ void amdgpu_debugfs_gem_init(struct amdgpu_device *adev);
+-int amdgpu_debugfs_wait_dump(struct amdgpu_device *adev);
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+index af9bdf16eefd..b8d9004fb163 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+@@ -2432,10 +2432,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
+ if (!adev->gmc.xgmi.pending_reset)
+ amdgpu_amdkfd_device_init(adev);
+
+- r = amdgpu_amdkfd_resume_iommu(adev);
+- if (r)
+- goto init_failed;
+-
+ amdgpu_fru_get_product_info(adev);
+
+ init_failed:
+@@ -4466,10 +4462,6 @@ int amdgpu_device_pre_asic_reset(struct amdgpu_device *adev,
+ if (reset_context->reset_req_dev == adev)
+ job = reset_context->job;
+
+- /* no need to dump if device is not in good state during probe period */
+- if (!adev->gmc.xgmi.pending_reset)
+- amdgpu_debugfs_wait_dump(adev);
+-
+ if (amdgpu_sriov_vf(adev)) {
+ /* stop the data exchange thread */
+ amdgpu_virt_fini_data_exchange(adev);
+diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+index 4a416231b24c..a6afacc3b10c 100644
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+@@ -924,6 +924,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
+
+ svm_migrate_init((struct amdgpu_device *)kfd->kgd);
+
++ if(kgd2kfd_resume_iommu(kfd))
++ goto device_iommu_error;
++
+ if (kfd_resume(kfd))
+ goto kfd_resume_error;
+
+diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
+index 8080bba5b7a7..de9ec5ddb6c7 100644
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
+@@ -247,6 +247,7 @@ static ssize_t dp_link_settings_write(struct file *f, const char __user *buf,
+ {
+ struct amdgpu_dm_connector *connector = file_inode(f)->i_private;
+ struct dc_link *link = connector->dc_link;
++ struct dc *dc = (struct dc *)link->dc;
+ struct dc_link_settings prefer_link_settings;
+ char *wr_buf = NULL;
+ const uint32_t wr_buf_size = 40;
+@@ -313,7 +314,7 @@ static ssize_t dp_link_settings_write(struct file *f, const char __user *buf,
+ prefer_link_settings.lane_count = param[0];
+ prefer_link_settings.link_rate = param[1];
+
+- dp_retrain_link_dp_test(link, &prefer_link_settings, false);
++ dc_link_set_preferred_training_settings(dc, &prefer_link_settings, NULL, link, true);
+
+ kfree(wr_buf);
+ return size;
+diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
+index de5f9c86b9a4..cafb0608ffb4 100644
+--- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
++++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
+@@ -2140,10 +2140,6 @@ static void __execlists_unhold(struct i915_request *rq)
+ if (p->flags & I915_DEPENDENCY_WEAK)
+ continue;
+
+- /* Propagate any change in error status */
+- if (rq->fence.error)
+- i915_request_set_error_once(w, rq->fence.error);
+-
+ if (w->engine != rq->engine)
+ continue;
+
+diff --git a/drivers/media/firewire/firedtv-avc.c b/drivers/media/firewire/firedtv-avc.c
+index 2bf9467b917d..71991f8638e6 100644
+--- a/drivers/media/firewire/firedtv-avc.c
++++ b/drivers/media/firewire/firedtv-avc.c
+@@ -1165,7 +1165,11 @@ int avc_ca_pmt(struct firedtv *fdtv, char *msg, int length)
+ read_pos += program_info_length;
+ write_pos += program_info_length;
+ }
+- while (read_pos < length) {
++ while (read_pos + 4 < length) {
++ if (write_pos + 4 >= sizeof(c->operand) - 4) {
++ ret = -EINVAL;
++ goto out;
++ }
+ c->operand[write_pos++] = msg[read_pos++];
+ c->operand[write_pos++] = msg[read_pos++];
+ c->operand[write_pos++] = msg[read_pos++];
+@@ -1177,13 +1181,17 @@ int avc_ca_pmt(struct firedtv *fdtv, char *msg, int length)
+ c->operand[write_pos++] = es_info_length >> 8;
+ c->operand[write_pos++] = es_info_length & 0xff;
+ if (es_info_length > 0) {
++ if (read_pos >= length) {
++ ret = -EINVAL;
++ goto out;
++ }
+ pmt_cmd_id = msg[read_pos++];
+ if (pmt_cmd_id != 1 && pmt_cmd_id != 4)
+ dev_err(fdtv->device, "invalid pmt_cmd_id %d at stream level\n",
+ pmt_cmd_id);
+
+- if (es_info_length > sizeof(c->operand) - 4 -
+- write_pos) {
++ if (es_info_length > sizeof(c->operand) - 4 - write_pos ||
++ es_info_length > length - read_pos) {
+ ret = -EINVAL;
+ goto out;
+ }
+diff --git a/drivers/media/firewire/firedtv-ci.c b/drivers/media/firewire/firedtv-ci.c
+index 9363d005e2b6..e0d57e09dab0 100644
+--- a/drivers/media/firewire/firedtv-ci.c
++++ b/drivers/media/firewire/firedtv-ci.c
+@@ -134,6 +134,8 @@ static int fdtv_ca_pmt(struct firedtv *fdtv, void *arg)
+ } else {
+ data_length = msg->msg[3];
+ }
++ if (data_length > sizeof(msg->msg) - data_pos)
++ return -EINVAL;
+
+ return avc_ca_pmt(fdtv, &msg->msg[data_pos], data_length);
+ }
+diff --git a/drivers/net/ethernet/sfc/ethtool_common.c b/drivers/net/ethernet/sfc/ethtool_common.c
+index bf1443539a1a..bd552c7dffcb 100644
+--- a/drivers/net/ethernet/sfc/ethtool_common.c
++++ b/drivers/net/ethernet/sfc/ethtool_common.c
+@@ -563,20 +563,14 @@ int efx_ethtool_get_link_ksettings(struct net_device *net_dev,
+ {
+ struct efx_nic *efx = netdev_priv(net_dev);
+ struct efx_link_state *link_state = &efx->link_state;
+- u32 supported;
+
+ mutex_lock(&efx->mac_lock);
+ efx_mcdi_phy_get_link_ksettings(efx, cmd);
+ mutex_unlock(&efx->mac_lock);
+
+ /* Both MACs support pause frames (bidirectional and respond-only) */
+- ethtool_convert_link_mode_to_legacy_u32(&supported,
+- cmd->link_modes.supported);
+-
+- supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
+-
+- ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
+- supported);
++ ethtool_link_ksettings_add_link_mode(cmd, supported, Pause);
++ ethtool_link_ksettings_add_link_mode(cmd, supported, Asym_Pause);
+
+ if (LOOPBACK_INTERNAL(efx)) {
+ cmd->base.speed = link_state->speed;
+diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
+index ec913ec991f3..6e91bdb2e08d 100644
+--- a/drivers/net/wireless/ath/wcn36xx/main.c
++++ b/drivers/net/wireless/ath/wcn36xx/main.c
+@@ -604,15 +604,6 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
+ }
+ }
+ }
+- /* FIXME: Only enable bmps support when encryption is enabled.
+- * For any reasons, when connected to open/no-security BSS,
+- * the wcn36xx controller in bmps mode does not forward
+- * 'wake-up' beacons despite AP sends DTIM with station AID.
+- * It could be due to a firmware issue or to the way driver
+- * configure the station.
+- */
+- if (vif->type == NL80211_IFTYPE_STATION)
+- vif_priv->allow_bmps = true;
+ break;
+ case DISABLE_KEY:
+ if (!(IEEE80211_KEY_FLAG_PAIRWISE & key_conf->flags)) {
+@@ -913,7 +904,6 @@ static void wcn36xx_bss_info_changed(struct ieee80211_hw *hw,
+ vif->addr,
+ bss_conf->aid);
+ vif_priv->sta_assoc = false;
+- vif_priv->allow_bmps = false;
+ wcn36xx_smd_set_link_st(wcn,
+ bss_conf->bssid,
+ vif->addr,
+diff --git a/drivers/net/wireless/ath/wcn36xx/pmc.c b/drivers/net/wireless/ath/wcn36xx/pmc.c
+index 2d0780fefd47..2936aaf53273 100644
+--- a/drivers/net/wireless/ath/wcn36xx/pmc.c
++++ b/drivers/net/wireless/ath/wcn36xx/pmc.c
+@@ -23,10 +23,7 @@ int wcn36xx_pmc_enter_bmps_state(struct wcn36xx *wcn,
+ {
+ int ret = 0;
+ struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
+-
+- if (!vif_priv->allow_bmps)
+- return -ENOTSUPP;
+-
++ /* TODO: Make sure the TX chain clean */
+ ret = wcn36xx_smd_enter_bmps(wcn, vif);
+ if (!ret) {
+ wcn36xx_dbg(WCN36XX_DBG_PMC, "Entered BMPS\n");
+diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
+index add6e527e833..e9560f35e9bc 100644
+--- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
++++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
+@@ -128,7 +128,6 @@ struct wcn36xx_vif {
+ enum wcn36xx_hal_bss_type bss_type;
+
+ /* Power management */
+- bool allow_bmps;
+ enum wcn36xx_power_state pw_state;
+
+ u8 bss_index;
+diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c
+index 34a9ac1f2b9b..8b7a01773aec 100644
+--- a/drivers/soc/imx/gpcv2.c
++++ b/drivers/soc/imx/gpcv2.c
+@@ -244,6 +244,8 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd)
+ goto out_regulator_disable;
+ }
+
++ reset_control_assert(domain->reset);
++
+ if (domain->bits.pxx) {
+ /* request the domain to power up */
+ regmap_update_bits(domain->regmap, GPC_PU_PGC_SW_PUP_REQ,
+@@ -266,8 +268,6 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd)
+ GPC_PGC_CTRL_PCR);
+ }
+
+- reset_control_assert(domain->reset);
+-
+ /* delay for reset to propagate */
+ udelay(5);
+
+diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
+index 7ee6e4cc0d89..00d35fe1fef0 100644
+--- a/drivers/usb/core/hcd.c
++++ b/drivers/usb/core/hcd.c
+@@ -2795,7 +2795,6 @@ int usb_add_hcd(struct usb_hcd *hcd,
+ {
+ int retval;
+ struct usb_device *rhdev;
+- struct usb_hcd *shared_hcd;
+
+ if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) {
+ hcd->phy_roothub = usb_phy_roothub_alloc(hcd->self.sysdev);
+@@ -2956,26 +2955,13 @@ int usb_add_hcd(struct usb_hcd *hcd,
+ goto err_hcd_driver_start;
+ }
+
+- /* starting here, usbcore will pay attention to the shared HCD roothub */
+- shared_hcd = hcd->shared_hcd;
+- if (!usb_hcd_is_primary_hcd(hcd) && shared_hcd && HCD_DEFER_RH_REGISTER(shared_hcd)) {
+- retval = register_root_hub(shared_hcd);
+- if (retval != 0)
+- goto err_register_root_hub;
+-
+- if (shared_hcd->uses_new_polling && HCD_POLL_RH(shared_hcd))
+- usb_hcd_poll_rh_status(shared_hcd);
+- }
+-
+ /* starting here, usbcore will pay attention to this root hub */
+- if (!HCD_DEFER_RH_REGISTER(hcd)) {
+- retval = register_root_hub(hcd);
+- if (retval != 0)
+- goto err_register_root_hub;
++ retval = register_root_hub(hcd);
++ if (retval != 0)
++ goto err_register_root_hub;
+
+- if (hcd->uses_new_polling && HCD_POLL_RH(hcd))
+- usb_hcd_poll_rh_status(hcd);
+- }
++ if (hcd->uses_new_polling && HCD_POLL_RH(hcd))
++ usb_hcd_poll_rh_status(hcd);
+
+ return retval;
+
+@@ -3013,7 +2999,6 @@ EXPORT_SYMBOL_GPL(usb_add_hcd);
+ void usb_remove_hcd(struct usb_hcd *hcd)
+ {
+ struct usb_device *rhdev = hcd->self.root_hub;
+- bool rh_registered;
+
+ dev_info(hcd->self.controller, "remove, state %x\n", hcd->state);
+
+@@ -3024,7 +3009,6 @@ void usb_remove_hcd(struct usb_hcd *hcd)
+
+ dev_dbg(hcd->self.controller, "roothub graceful disconnect\n");
+ spin_lock_irq (&hcd_root_hub_lock);
+- rh_registered = hcd->rh_registered;
+ hcd->rh_registered = 0;
+ spin_unlock_irq (&hcd_root_hub_lock);
+
+@@ -3034,8 +3018,7 @@ void usb_remove_hcd(struct usb_hcd *hcd)
+ cancel_work_sync(&hcd->died_work);
+
+ mutex_lock(&usb_bus_idr_lock);
+- if (rh_registered)
+- usb_disconnect(&rhdev); /* Sets rhdev to NULL */
++ usb_disconnect(&rhdev); /* Sets rhdev to NULL */
+ mutex_unlock(&usb_bus_idr_lock);
+
+ /*
+diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
+index 541fe4dcc43a..902f410874e8 100644
+--- a/drivers/usb/host/xhci.c
++++ b/drivers/usb/host/xhci.c
+@@ -692,7 +692,6 @@ int xhci_run(struct usb_hcd *hcd)
+ if (ret)
+ xhci_free_command(xhci, command);
+ }
+- set_bit(HCD_FLAG_DEFER_RH_REGISTER, &hcd->flags);
+ xhci_dbg_trace(xhci, trace_xhci_dbg_init,
+ "Finished xhci_run for USB2 roothub");
+
+diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
+index 2c1fc9212cf2..548a028f2dab 100644
+--- a/include/linux/usb/hcd.h
++++ b/include/linux/usb/hcd.h
+@@ -124,7 +124,6 @@ struct usb_hcd {
+ #define HCD_FLAG_RH_RUNNING 5 /* root hub is running? */
+ #define HCD_FLAG_DEAD 6 /* controller has died? */
+ #define HCD_FLAG_INTF_AUTHORIZED 7 /* authorize interfaces? */
+-#define HCD_FLAG_DEFER_RH_REGISTER 8 /* Defer roothub registration */
+
+ /* The flags can be tested using these macros; they are likely to
+ * be slightly faster than test_bit().
+@@ -135,7 +134,6 @@ struct usb_hcd {
+ #define HCD_WAKEUP_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_WAKEUP_PENDING))
+ #define HCD_RH_RUNNING(hcd) ((hcd)->flags & (1U << HCD_FLAG_RH_RUNNING))
+ #define HCD_DEAD(hcd) ((hcd)->flags & (1U << HCD_FLAG_DEAD))
+-#define HCD_DEFER_RH_REGISTER(hcd) ((hcd)->flags & (1U << HCD_FLAG_DEFER_RH_REGISTER))
+
+ /*
+ * Specifies if interfaces are authorized by default
+diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
+index 8929d9abe8aa..74e5bd2cc932 100644
+--- a/sound/usb/quirks.c
++++ b/sound/usb/quirks.c
+@@ -1887,6 +1887,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
+ QUIRK_FLAG_SHARE_MEDIA_DEVICE | QUIRK_FLAG_ALIGN_TRANSFER),
+ DEVICE_FLG(0x21b4, 0x0081, /* AudioQuest DragonFly */
+ QUIRK_FLAG_GET_SAMPLE_RATE),
++ DEVICE_FLG(0x2708, 0x0002, /* Audient iD14 */
++ QUIRK_FLAG_IGNORE_CTL_ERROR),
+ DEVICE_FLG(0x2912, 0x30c8, /* Audioengine D1 */
+ QUIRK_FLAG_GET_SAMPLE_RATE),
+ DEVICE_FLG(0x30be, 0x0101, /* Schiit Hel */
+--
+2.33.1
+
diff --git a/PKGBUILD b/PKGBUILD
index 75a3d36949b0..efbf564fc399 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,9 +5,13 @@
# Contributor: Yoshi2889 <rick.2889 at gmail dot com>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Thomas Baechler <thomas@archlinux.org>
-
+# --
# shellcheck disable=SC2034,SC2164
+## The following variables can be customized at build time. Use env or export to change at your wish
+##
+## Example: env _microarchitecture=98 use_numa=n use_tracers=n makepkg -sc
+
##
## Xanmod-ROG options:
##
@@ -52,10 +56,10 @@ if [ -z ${_compiler+x} ]; then
_compiler=gcc
fi
-# Compress modules with ZSTD (to save disk space)
-if [ -z ${_compress_modules+x} ]; then
- _compress_modules=y
-fi
+## Compress modules with ZSTD (to save disk space)
+#if [ -z ${_compress_modules+x} ]; then
+# _compress_modules=y
+#fi
# Compile ONLY used modules to VASTLY reduce the number of modules built
# and the build time.
@@ -65,7 +69,7 @@ fi
# This PKGBUILD read the database kept if it exists
#
# More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed-db
-if [ -z "${_localmodcfg}" ]; then
+if [ -z ${_localmodcfg+x} ]; then
_localmodcfg=n
fi
@@ -75,10 +79,10 @@ _makenconfig=
### IMPORTANT: Do no edit below this line unless you know what you're doing
pkgbase=linux-xanmod-rog
-xanmod=5.14.15-xanmod1
+xanmod=5.15.0-xanmod1
#pkgver=${xanmod//-/.}
-pkgver=5.14.16.xanpre0 # NOTE: start 4th position with 'xan...', we parse for this pattern later
-pkgrel=1
+pkgver=5.15.1rc1.xanpre0 # NOTE: start 4th position with 'xan...', we parse for this pattern later
+pkgrel=0
pkgdesc='Linux Xanmod'
url="http://www.xanmod.org/"
arch=(x86_64)
@@ -103,47 +107,38 @@ source=("https://cdn.kernel.org/pub/linux/kernel/v${_branch}/linux-${_major}.tar
# incremental kernel.org patch ahead of official Xanmod release
#"https://cdn.kernel.org/pub/linux/kernel/v5.x/patch-5.14.1.xz"
- "https://cdn.kernel.org/pub/linux/kernel/v5.x/incr/patch-5.14.15-16.xz"
- #"Linux-5.14.5-rc1.patch"
+ #"https://cdn.kernel.org/pub/linux/kernel/v5.x/incr/patch-5.14.15-16.xz"
+ "Linux-5.15.1-rc1.patch"
- # amd-pstate update
- "amd-pstate-v3.diff"
+ # amd-pstate v3 included in Xanmod
- # don't drop shared caches on C3 state transitions
- "x86-ACPI-State-Optimize-C3-entry-on-AMD-CPUs.patch" # landing in 5.15
+ # 5.16: don't drop shared caches on C3 state transitions
+ "x86-ACPI-State-Optimize-C3-entry-on-AMD-CPUs.patch"
- # patch from Chromium developers; more accurately report battery state changes
- "acpi-battery-Always-read-fresh-battery-state-on-update.patch" # awaiting ack ...
+ # -- patch from Chromium developers; more accurately report battery state changes
+ "acpi-battery-Always-read-fresh-battery-state-on-update.patch"
- # k10temp support for Zen3 APUs
- #"x86-amd_nb-Add-AMD-family-19h-model-50h-PCI-ids.patch" # included in 5.14
- "hwmon-k10temp-support-Zen3-APUs.patch" # landing in 5.15
+ # 5.15: k10temp support for Zen3 APUs
# 5.16 spectre defaults
"x86-change-default-to-spec_store_bypass_disable-prct.patch"
- # squelch overzealous 802.11 regdomain not set warnings
+ # -- squelch overzealous 802.11 regdomain not set warnings
"cfg80211-dont-WARN-if-a-self-managed-device.patch"
- # r8152 s0i3 wake fix
+ # -- r8152 s0i3 wake fix
"r8152-fix-spurious-wakeups-from-s0i3.patch"
- # r8169 hwIDs for the G14?/G15
- "r8169-Add-device-10ec-8162-to-driver-r8169.patch"
+ # 5.15: r8169 hwIDs for the G14?/G15
# ASUS ROG enablement
- "asus-wmi-Add-panel-overdrive-functionality.patch" # landing in 5.15
- "asus-wmi-Add-dgpu-disable-method.patch" # "
- "asus-wmi-Add-egpu-enable-method.patch" # "
- "HID-asus-Prevent-Claymore-sending-suspend-event.patch" # "
- "HID-asus-Reduce-object-size-by-consolidating-calls.patch" # awaiting ack ...
- "v5-asus-wmi-Add-support-for-platform_profile.patch" # landing in 5.15
- "v16-asus-wmi-Add-support-for-custom-fan-curves.patch" # -next
+ "HID-asus-Reduce-object-size-by-consolidating-calls.patch"
+ "v16-asus-wmi-Add-support-for-custom-fan-curves.patch"
# mediatek mt7921 bt/wifi patches
"mt76-mt7921-Fix-out-of-order-process-by-invalid-even.patch"
"mt76-mt7921-Add-mt7922-support.patch"
- "1-1-Bluetooth-btusb-Enable-MSFT-extension-for-Mediatek-Chip-MT7921.patch"
+ #"1-1-Bluetooth-btusb-Enable-MSFT-extension-for-Mediatek-Chip-MT7921.patch"
"1-2-mt76-mt7915-send-EAPOL-frames-at-lowest-rate.patch"
"2-2-mt76-mt7921-send-EAPOL-frames-at-lowest-rate.patch"
"mt76-mt7921-enable-VO-tx-aggregation.patch"
@@ -161,37 +156,28 @@ source=("https://cdn.kernel.org/pub/linux/kernel/v${_branch}/linux-${_major}.tar
"Bluetooth-btusb-Add-support-for-IMC-Networks-Mediatek-Chip-MT7921.patch"
# squashed s0ix enablement
- "9001-v5.14.16-s0ix-patch-2021-11-02.patch"
+ "9001-v5.15-s0ix-patch-2021-11-04.patch"
)
validpgpkeys=(
'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linux Torvalds
'647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
)
-sha256sums=('7e068b5e0d26a62b10e5320b25dce57588cbbc6f781c090442138c9c9c3271b2'
+sha256sums=('57b2cf6991910e3b67a1b3490022e8a0674b6965c74c12da1e99d138d1991ee8'
'SKIP'
- 'e3999a9e5957b425656bcda2a6d938175478ae9b17d15d38010e486ffbcf2076'
+ '8209a82fe051a99f8fd6df23966278d329b98c27899d4eea4b75b5f96c6f9010'
'1ac18cad2578df4a70f9346f7c6fccbb62f042a0ee0594817fdef9f2704904ee'
'52fc0fcd806f34e774e36570b2a739dbdf337f7ff679b1c1139bee54d03301eb'
- '3c7ae911838cda30992d5a7fdf34b40494d31ba5765b834549aa276b1fa833e3'
- 'deffeac14f6d9393e82595f6b6ec0e2a71f3b873a1996159577aa2522d6207c4'
+ '98fc296ed8f68d77e0655298ac1775edde06234007a17dc32617bc9801b030a9'
'923230ed8367e28adfdeed75d3cdba9eec6b781818c37f6f3d3eb64101d2e716'
'f7a4bf6293912bfc4a20743e58a5a266be8c4dbe3c1862d196d3a3b45f2f7c90'
- 'de8c9747637768c4356c06aa65c3f157c526aa420f21fdd5edd0ed06f720a62e'
'cc401107f1bf7b7d8e8a78ee594f9db4b6fa252b7239b6aa88f678aef84d935c'
'3d8961438b5c8110588ff0b881d472fc71a4304d306808d78a4055a4150f351e'
'f47a5a5e329e410a0ae7d46b450707d5575a4deda5b3b58281f5eca14938fb21'
- 'e4e55dd548c7689596a7c5c42e49c8f072bd2613bd416c6910b5c6410120eb1d'
- '1ab75535772c63567384eb2ac74753e4d5db2f3317cb265aedf6151b9f18c6c2'
- '8cc771f37ee08ad5796e6db64f180c1415a5f6e03eb3045272dade30ca754b53'
- 'f3461e7cc759fd4cef2ec5c4fa15b80fa6d37e16008db223f77ed88a65aa938e'
- 'ec317cc2c2c8c1186c4f553fdd010adc013c37600a499802473653fd8e7564df'
'544464bf0807b324120767d55867f03014a9fda4e1804768ca341be902d7ade4'
- '4ef12029ea73ca924b6397e1de4911e84d9e77ddaccdab1ef579823d848524e8'
'0c422d8f420c1518aab1b980c6cdb6e029a4fa9cde1fd99a63670bb105a44f36'
'2163cb2e394a013042a40cd3b00dae788603284b20d71e262995366c5534e480'
'a01cf700d79b983807e2285be1b30df6e02db6adfd9c9027fe2dfa8ca5a74bc9'
- '9f6b8c3ea6e1c285e0a7efda4d743dbae343bc6ee7ad599a4ab7d380c750bc83'
'4bfbff4eba07fc9de2ce78097a4a269509468ba0e24c15a82905cd94e093ad55'
'021f8539ab2fb722b46937b95fdab22a2308236a24ecc1a9ea8db4853721dd39'
'1ce9fd988201c4d2e48794c58acda5b768ec0fea1d29555e99d35cd2712281e4'
@@ -207,7 +193,7 @@ sha256sums=('7e068b5e0d26a62b10e5320b25dce57588cbbc6f781c090442138c9c9c3271b2'
'292a7e32b248c7eee6e2f5407d609d03d985f367d329adb02b9d6dba1f85b44c'
'7dbfdd120bc155cad1879579cb9dd1185eb5e37078c8c93fef604a275a163812'
'1444af2e125080934c67b6adb4561fd354a72ce47d3de393b24f53832ee492ac'
- '67421174b6dfd18beb9e6f06a54c15e425a9568cd9412cd0625d11fee65d3ab7')
+ '03a01e5caa9aa79c9f3643668f4b1e5d52ea2aeed191b8a5e3c869bca07f8c82')
export KBUILD_BUILD_HOST=${KBUILD_BUILD_HOST:-archlinux}
export KBUILD_BUILD_USER=${KBUILD_BUILD_USER:-"$pkgbase"}
@@ -283,11 +269,10 @@ prepare() {
fi
# Compress modules by default (following Arch's kernel)
- if [ "$_compress_modules" = "y" ]; then
- scripts/config --disable CONFIG_MODULE_COMPRESS_NONE \
- --enable CONFIG_MODULE_COMPRESS_ZSTD
- fi
+ scripts/config --disable CONFIG_MODULE_COMPRESS_NONE \
+ --enable CONFIG_MODULE_COMPRESS_ZSTD
+ # Toggle AMD pstate if requested
if [ "$amd_pstate" = "n" ]; then
msg2 "Disabling amd-pstate driver..."
scripts/config --disable CONFIG_X86_AMD_PSTATE
@@ -298,11 +283,17 @@ prepare() {
# let user choose microarchitecture optimization target;
sh "${srcdir}/choose-gcc-optimization.sh" $_microarchitecture
+ # apply package config customizations
+ if [[ -s ${startdir}/xanmod-rog-config ]]; then
+ msg2 "Applying package config customization..."
+ bash -x "${startdir}/xanmod-rog-config"
+ fi
+
# This is intended for the people that want to build this package with their own config
- # Put the file "myconfig" at the package folder (this will take preference) or "${XDG_CONFIG_HOME}/linux-xanmod/myconfig"
+ # Put the file "myconfig" at the package folder (this will take precedence) or "${XDG_CONFIG_HOME}/linux-xanmod-rog/myconfig"
# If we detect partial file with scripts/config commands, we execute as a script
# If not, it's a full config, will be replaced
- for _myconfig in "${startdir}/myconfig" "${HOME}/.config/linux-xanmod/myconfig" "${XDG_CONFIG_HOME}/linux-xanmod/myconfig" ; do
+ for _myconfig in "${SRCDEST}/myconfig" "${HOME}/.config/linux-xanmod-rog/myconfig" "${XDG_CONFIG_HOME}/linux-xanmod-rog/myconfig" ; do
# if file exists and size > 0 bytes
if [ -s "${_myconfig}" ]; then
if grep -q 'scripts/config' "${_myconfig}"; then
diff --git a/amd-pstate-v3.diff b/amd-pstate-v3.diff
deleted file mode 100644
index f4f65f28deaa..000000000000
--- a/amd-pstate-v3.diff
+++ /dev/null
@@ -1,876 +0,0 @@
-diff --git a/Documentation/admin-guide/pm/amd_pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst
-similarity index 90%
-rename from Documentation/admin-guide/pm/amd_pstate.rst
-rename to Documentation/admin-guide/pm/amd-pstate.rst
-index c3659dde0cee..375374e3eb80 100644
---- a/Documentation/admin-guide/pm/amd_pstate.rst
-+++ b/Documentation/admin-guide/pm/amd-pstate.rst
-@@ -195,8 +195,8 @@ driver.
-
- There are two types of hardware implementations for ``amd-pstate``: one is
- `Full MSR Support <perf_cap_>`_ and another is `Shared Memory Support
--<perf_cap_>`_. It can use :c:macro:`X86_FEATURE_AMD_CPPC_EXT` feature flag
--(for details refer to Processor Programming Reference (PPR) for AMD Family
-+<perf_cap_>`_. It can use :c:macro:`X86_FEATURE_AMD_CPPC` feature flag (for
-+details refer to Processor Programming Reference (PPR) for AMD Family
- 19h Model 21h, Revision B0 Processors [3]_) to indicate the different
- types. ``amd-pstate`` is to register different ``amd_pstate_perf_funcs``
- instances for different hardware implementations.
-@@ -208,7 +208,7 @@ Full MSR Support
- -----------------
-
- Some new Zen3 processors such as Cezanne provide the MSR registers directly
--while the :c:macro:`X86_FEATURE_AMD_CPPC_EXT` CPU feature flag is set.
-+while the :c:macro:`X86_FEATURE_AMD_CPPC` CPU feature flag is set.
- ``amd-pstate`` can handle the MSR register to implement the fast switch
- function in ``CPUFreq`` that can shrink latency of frequency control on the
- interrupt context.
-@@ -216,10 +216,10 @@ interrupt context.
- Shared Memory Support
- ----------------------
-
--If :c:macro:`X86_FEATURE_AMD_CPPC_EXT` CPU feature flag is not set, that
--means the processor supports shared memory solution. In this case,
--``amd-pstate`` uses the ``cppc_acpi`` helper methods to implement the
--callback functions of ``amd_pstate_perf_funcs``.
-+If :c:macro:`X86_FEATURE_AMD_CPPC` CPU feature flag is not set, that means
-+the processor supports shared memory solution. In this case, ``amd-pstate``
-+uses the ``cppc_acpi`` helper methods to implement the callback functions
-+of ``amd_pstate_perf_funcs``.
-
-
- AMD P-States and ACPI hardware P-States always can be supported in one
-@@ -244,15 +244,8 @@ control its functionality at the system level. They located in the
- /sys/devices/system/cpu/cpufreq/policy0/amd_pstate_min_freq
- /sys/devices/system/cpu/cpufreq/policy0/amd_pstate_nominal_freq
- /sys/devices/system/cpu/cpufreq/policy0/amd_pstate_nominal_perf
-- /sys/devices/system/cpu/cpufreq/policy0/is_amd_pstate_enabled
-
-
--``is_amd_pstate_enabled``
--
--Query whether current kernel loads ``amd-pstate`` to enable the AMD
--P-States functionality.
--This attribute is read-only.
--
- ``amd_pstate_highest_perf / amd_pstate_max_freq``
-
- Maximum CPPC performance and CPU frequency that the driver is allowed to
-@@ -275,9 +268,11 @@ allowed to set in percent of the maximum supported CPPC performance level
- Capability <perf_cap_>`_).
- This attribute is read-only.
-
--``amd_pstate_lowest_perf / amd_pstate_min_freq``
-+``amd_pstate_lowest_perf``
-
--The lowest physical CPPC performance and CPU frequency.
-+The lowest physical CPPC performance. The minimum CPU frequency can be read
-+back from ``cpuinfo`` member of ``cpufreq_policy``, so we won't expose it
-+here.
- This attribute is read-only.
-
-
-@@ -351,12 +346,13 @@ configured to support event tracing). ::
- # ||| / delay
- # TASK-PID CPU# |||| TIMESTAMP FUNCTION
- # | | | |||| | |
-- <idle>-0 [000] d.s. 244057.464842: amd_pstate_perf: amd_min_perf=39 amd_des_perf=39 amd_max_perf=166 cpu_id=0 prev=0x2727a6 value=0x2727a6
-- <idle>-0 [000] d.h. 244057.475436: amd_pstate_perf: amd_min_perf=39 amd_des_perf=39 amd_max_perf=166 cpu_id=0 prev=0x2727a6 value=0x2727a6
-- <idle>-0 [000] d.h. 244057.476629: amd_pstate_perf: amd_min_perf=39 amd_des_perf=39 amd_max_perf=166 cpu_id=0 prev=0x2727a6 value=0x2727a6
-- <idle>-0 [000] d.s. 244057.484847: amd_pstate_perf: amd_min_perf=39 amd_des_perf=39 amd_max_perf=166 cpu_id=0 prev=0x2727a6 value=0x2727a6
-- <idle>-0 [000] d.h. 244057.499821: amd_pstate_perf: amd_min_perf=39 amd_des_perf=39 amd_max_perf=166 cpu_id=0 prev=0x2727a6 value=0x2727a6
-- avahi-daemon-528 [000] d... 244057.513568: amd_pstate_perf: amd_min_perf=39 amd_des_perf=39 amd_max_perf=166 cpu_id=0 prev=0x2727a6 value=0x2727a6
-+ <idle>-0 [015] dN... 4995.979886: amd_pstate_perf: amd_min_perf=85 amd_des_perf=85 amd_max_perf=166 cpu_id=15 changed=false fast_switch=true
-+ <idle>-0 [007] d.h.. 4995.979893: amd_pstate_perf: amd_min_perf=85 amd_des_perf=85 amd_max_perf=166 cpu_id=7 changed=false fast_switch=true
-+ cat-2161 [000] d.... 4995.980841: amd_pstate_perf: amd_min_perf=85 amd_des_perf=85 amd_max_perf=166 cpu_id=0 changed=false fast_switch=true
-+ sshd-2125 [004] d.s.. 4995.980968: amd_pstate_perf: amd_min_perf=85 amd_des_perf=85 amd_max_perf=166 cpu_id=4 changed=false fast_switch=true
-+ <idle>-0 [007] d.s.. 4995.980968: amd_pstate_perf: amd_min_perf=85 amd_des_perf=85 amd_max_perf=166 cpu_id=7 changed=false fast_switch=true
-+ <idle>-0 [003] d.s.. 4995.980971: amd_pstate_perf: amd_min_perf=85 amd_des_perf=85 amd_max_perf=166 cpu_id=3 changed=false fast_switch=true
-+ <idle>-0 [011] d.s.. 4995.980996: amd_pstate_perf: amd_min_perf=85 amd_des_perf=85 amd_max_perf=166 cpu_id=11 changed=false fast_switch=true
-
- The cpu_frequency trace event will be triggered either by the ``schedutil`` scaling
- governor (for the policies it is attached to), or by the ``CPUFreq`` core (for the
-diff --git a/Documentation/admin-guide/pm/working-state.rst b/Documentation/admin-guide/pm/working-state.rst
-index 28db6156b55d..5d2757e2de65 100644
---- a/Documentation/admin-guide/pm/working-state.rst
-+++ b/Documentation/admin-guide/pm/working-state.rst
-@@ -11,7 +11,7 @@ Working-State Power Management
- intel_idle
- cpufreq
- intel_pstate
-- amd_pstate
-+ amd-pstate
- cpufreq_drivers
- intel_epb
- intel-speed-select
-diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
-index b285960c35e7..9d25341fdfc5 100644
---- a/drivers/acpi/cppc_acpi.c
-+++ b/drivers/acpi/cppc_acpi.c
-@@ -411,7 +411,7 @@ bool acpi_cpc_valid(void)
- struct cpc_desc *cpc_ptr;
- int cpu;
-
-- for_each_online_cpu(cpu) {
-+ for_each_present_cpu(cpu) {
- cpc_ptr = per_cpu(cpc_desc_ptr, cpu);
- if (!cpc_ptr)
- return false;
-@@ -759,9 +759,24 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
- goto out_free;
- cpc_ptr->cpc_regs[i-2].sys_mem_vaddr = addr;
- }
-+ } else if (gas_t->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {
-+ if (gas_t->access_width < 1 || gas_t->access_width > 3) {
-+ /* 1 = 8-bit, 2 = 16-bit, and 3 = 32-bit. SystemIO doesn't
-+ * implement 64-bit registers.
-+ */
-+ pr_debug("Invalid access width %d for SystemIO register\n",
-+ gas_t->access_width);
-+ goto out_free;
-+ }
-+ if (gas_t->address & ~0xFFFFULL) {
-+ /* SystemIO registers use 16-bit integer addresses */
-+ pr_debug("Invalid IO port %llu for SystemIO register\n",
-+ gas_t->address);
-+ goto out_free;
-+ }
- } else {
- if (gas_t->space_id != ACPI_ADR_SPACE_FIXED_HARDWARE || !cpc_ffh_supported()) {
-- /* Support only PCC ,SYS MEM and FFH type regs */
-+ /* Support only PCC, SystemMemory, SystemIO, and FFH type regs. */
- pr_debug("Unsupported register type: %d\n", gas_t->space_id);
- goto out_free;
- }
-@@ -936,7 +951,20 @@ static int cpc_read(int cpu, struct cpc_register_resource *reg_res, u64 *val)
- }
-
- *val = 0;
-- if (reg->space_id == ACPI_ADR_SPACE_PLATFORM_COMM && pcc_ss_id >= 0)
-+
-+ if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {
-+ u32 width = 8 << (reg->access_width - 1);
-+ acpi_status status;
-+
-+ status = acpi_os_read_port((acpi_io_address)reg->address, (u32 *)val, width);
-+
-+ if (status != AE_OK) {
-+ pr_debug("Error: Failed to read SystemIO port %llx\n", reg->address);
-+ return -EFAULT;
-+ }
-+
-+ return 0;
-+ } else if (reg->space_id == ACPI_ADR_SPACE_PLATFORM_COMM && pcc_ss_id >= 0)
- vaddr = GET_PCC_VADDR(reg->address, pcc_ss_id);
- else if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY)
- vaddr = reg_res->sys_mem_vaddr;
-@@ -975,7 +1003,19 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val)
- int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpu);
- struct cpc_reg *reg = &reg_res->cpc_entry.reg;
-
-- if (reg->space_id == ACPI_ADR_SPACE_PLATFORM_COMM && pcc_ss_id >= 0)
-+ if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {
-+ u32 width = 8 << (reg->access_width - 1);
-+ acpi_status status;
-+
-+ status = acpi_os_write_port((acpi_io_address)reg->address, (u32)val, width);
-+
-+ if (status != AE_OK) {
-+ pr_debug("Error: Failed to write SystemIO port %llx\n", reg->address);
-+ return -EFAULT;
-+ }
-+
-+ return 0;
-+ } else if (reg->space_id == ACPI_ADR_SPACE_PLATFORM_COMM && pcc_ss_id >= 0)
- vaddr = GET_PCC_VADDR(reg->address, pcc_ss_id);
- else if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY)
- vaddr = reg_res->sys_mem_vaddr;
-@@ -1228,21 +1268,17 @@ EXPORT_SYMBOL_GPL(cppc_get_perf_ctrs);
- *
- * Return: 0 for success, -ERRNO or -EIO otherwise.
- */
--int cppc_set_enable(int cpu, u32 enable)
-+int cppc_set_enable(int cpu, bool enable)
- {
- int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpu);
- struct cpc_register_resource *enable_reg;
- struct cpc_desc *cpc_desc = per_cpu(cpc_desc_ptr, cpu);
- struct cppc_pcc_data *pcc_ss_data = NULL;
-- int ret = -1;
--
-- /* check the input value*/
-- if (cpu < 0 || cpu > num_possible_cpus() - 1 || enable > 1)
-- return -ENODEV;
-+ int ret = -EINVAL;
-
- if (!cpc_desc) {
- pr_debug("No CPC descriptor for CPU:%d\n", cpu);
-- return -ENODEV;
-+ return -EINVAL;
- }
-
- enable_reg = &cpc_desc->cpc_regs[ENABLE];
-@@ -1262,9 +1298,10 @@ int cppc_set_enable(int cpu, u32 enable)
- /* after writing CPC, transfer the ownership of PCC to platfrom */
- ret = send_pcc_cmd(pcc_ss_id, CMD_WRITE);
- up_write(&pcc_ss_data->pcc_lock);
-+ return ret;
- }
-
-- return ret;
-+ return cpc_write(cpu, enable_reg, enable);
- }
- EXPORT_SYMBOL_GPL(cppc_set_enable);
-
-diff --git a/drivers/cpufreq/Kconfig.x86 b/drivers/cpufreq/Kconfig.x86
-index 9cd7e338bdcd..2e798b2c0bdb 100644
---- a/drivers/cpufreq/Kconfig.x86
-+++ b/drivers/cpufreq/Kconfig.x86
-@@ -35,7 +35,7 @@ config X86_PCC_CPUFREQ
- If in doubt, say N.
-
- config X86_AMD_PSTATE
-- tristate "AMD Processor P-State driver"
-+ bool "AMD Processor P-State driver"
- depends on X86
- select ACPI_PROCESSOR if ACPI
- select ACPI_CPPC_LIB if X86_64 && ACPI && SCHED_MC_PRIO
-@@ -43,7 +43,11 @@ config X86_AMD_PSTATE
- help
- This driver adds a CPUFreq driver which utilizes a fine grain
- processor performance freqency control range instead of legacy
-- performance levels. This driver also supports newer AMD CPUs.
-+ performance levels. This driver supports the AMD processors with
-+ _CPC object in the SBIOS.
-+
-+ For details, take a look at:
-+ <file:Documentation/admin-guide/pm/amd-pstate.rst>.
-
- If in doubt, say N.
-
-diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
-index 04882bc4b145..5c9a2a1ee8dc 100644
---- a/drivers/cpufreq/Makefile
-+++ b/drivers/cpufreq/Makefile
-@@ -17,10 +17,6 @@ obj-$(CONFIG_CPU_FREQ_GOV_ATTR_SET) += cpufreq_governor_attr_set.o
- obj-$(CONFIG_CPUFREQ_DT) += cpufreq-dt.o
- obj-$(CONFIG_CPUFREQ_DT_PLATDEV) += cpufreq-dt-platdev.o
-
--# Traces
--CFLAGS_amd-pstate-trace.o := -I$(src)
--amd_pstate-y := amd-pstate.o amd-pstate-trace.o
--
- ##################################################################################
- # x86 drivers.
- # Link order matters. K8 is preferred to ACPI because of firmware bugs in early
-@@ -29,7 +25,7 @@ amd_pstate-y := amd-pstate.o amd-pstate-trace.o
- # speedstep-* is preferred over p4-clockmod.
-
- obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o
--obj-$(CONFIG_X86_AMD_PSTATE) += amd_pstate.o
-+obj-$(CONFIG_X86_AMD_PSTATE) += amd-pstate.o
- obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o
- obj-$(CONFIG_X86_PCC_CPUFREQ) += pcc-cpufreq.o
- obj-$(CONFIG_X86_POWERNOW_K6) += powernow-k6.o
-diff --git a/drivers/cpufreq/amd-pstate-trace.c b/drivers/cpufreq/amd-pstate-trace.c
-deleted file mode 100644
-index 891b696dcd69..000000000000
---- a/drivers/cpufreq/amd-pstate-trace.c
-+++ /dev/null
-@@ -1,2 +0,0 @@
--#define CREATE_TRACE_POINTS
--#include "amd-pstate-trace.h"
-diff --git a/drivers/cpufreq/amd-pstate-trace.h b/drivers/cpufreq/amd-pstate-trace.h
-deleted file mode 100644
-index 50c85e150f30..000000000000
---- a/drivers/cpufreq/amd-pstate-trace.h
-+++ /dev/null
-@@ -1,96 +0,0 @@
--/* SPDX-License-Identifier: GPL-2.0 */
--/*
-- * amd-pstate-trace.h - AMD Processor P-state Frequency Driver Tracer
-- *
-- * Copyright (C) 2021 Advanced Micro Devices, Inc. All Rights Reserved.
-- *
-- * This program is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU General Public License
-- * as published by the Free Software Foundation; either version 2
-- * of the License, or (at your option) any later version.
-- *
-- * This program is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- * GNU General Public License for more details.
-- *
-- * You should have received a copy of the GNU General Public License along with
-- * this program; if not, write to the Free Software
-- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-- *
-- * Author: Huang Rui <ray.huang@amd.com>
-- */
--
--#if !defined(_AMD_PSTATE_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
--#define _AMD_PSTATE_TRACE_H
--
--#include <linux/cpufreq.h>
--#include <linux/tracepoint.h>
--#include <linux/trace_events.h>
--
--#undef TRACE_SYSTEM
--#define TRACE_SYSTEM amd_cpu
--
--#undef TRACE_INCLUDE_FILE
--#define TRACE_INCLUDE_FILE amd-pstate-trace
--
--#define TPS(x) tracepoint_string(x)
--
--TRACE_EVENT(amd_pstate_perf,
--
-- TP_PROTO(unsigned long min_perf,
-- unsigned long target_perf,
-- unsigned long capacity,
-- unsigned int cpu_id,
-- u64 prev,
-- u64 value,
-- int type
-- ),
--
-- TP_ARGS(min_perf,
-- target_perf,
-- capacity,
-- cpu_id,
-- prev,
-- value,
-- type
-- ),
--
-- TP_STRUCT__entry(
-- __field(unsigned long, min_perf)
-- __field(unsigned long, target_perf)
-- __field(unsigned long, capacity)
-- __field(unsigned int, cpu_id)
-- __field(u64, prev)
-- __field(u64, value)
-- __field(int, type)
-- ),
--
-- TP_fast_assign(
-- __entry->min_perf = min_perf;
-- __entry->target_perf = target_perf;
-- __entry->capacity = capacity;
-- __entry->cpu_id = cpu_id;
-- __entry->prev = prev;
-- __entry->value = value;
-- __entry->type = type;
-- ),
--
-- TP_printk("amd_min_perf=%lu amd_des_perf=%lu amd_max_perf=%lu cpu_id=%u prev=0x%llx value=0x%llx type=0x%d",
-- (unsigned long)__entry->min_perf,
-- (unsigned long)__entry->target_perf,
-- (unsigned long)__entry->capacity,
-- (unsigned int)__entry->cpu_id,
-- (u64)__entry->prev,
-- (u64)__entry->value,
-- (int)__entry->type
-- )
--);
--
--#endif /* _AMD_PSTATE_TRACE_H */
--
--/* This part must be outside protection */
--#undef TRACE_INCLUDE_PATH
--#define TRACE_INCLUDE_PATH .
--
--#include <trace/define_trace.h>
-diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
-index b0353d13f74a..58ee50bf492b 100644
---- a/drivers/cpufreq/amd-pstate.c
-+++ b/drivers/cpufreq/amd-pstate.c
-@@ -1,4 +1,3 @@
--// SPDX-License-Identifier: GPL-2.0-or-later
- /*
- * amd-pstate.c - AMD Processor P-state Frequency Driver
- *
-@@ -37,6 +36,7 @@
- #include <linux/delay.h>
- #include <linux/uaccess.h>
- #include <linux/static_call.h>
-+#include <trace/events/power.h>
-
- #include <acpi/processor.h>
- #include <acpi/cppc_acpi.h>
-@@ -45,24 +45,16 @@
- #include <asm/processor.h>
- #include <asm/cpufeature.h>
- #include <asm/cpu_device_id.h>
--#include "amd-pstate-trace.h"
-
- #define AMD_PSTATE_TRANSITION_LATENCY 0x20000
- #define AMD_PSTATE_TRANSITION_DELAY 500
-
--enum switch_type
--{
-- AMD_TARGET = 0,
-- AMD_ADJUST_PERF
--};
--
- static struct cpufreq_driver amd_pstate_driver;
-
- struct amd_cpudata {
- int cpu;
-
- struct freq_qos_request req[2];
-- struct cpufreq_policy *policy;
-
- u64 cppc_req_cached;
-
-@@ -153,8 +145,7 @@ static inline int amd_pstate_init_perf(struct amd_cpudata *cpudata)
- }
-
- static void pstate_update_perf(struct amd_cpudata *cpudata, u32 min_perf,
-- u32 des_perf, u32 max_perf,
-- bool fast_switch)
-+ u32 des_perf, u32 max_perf, bool fast_switch)
- {
- if (fast_switch)
- wrmsrl(MSR_AMD_CPPC_REQ, READ_ONCE(cpudata->cppc_req_cached));
-@@ -178,21 +169,19 @@ static void cppc_update_perf(struct amd_cpudata *cpudata,
-
- DEFINE_STATIC_CALL(amd_pstate_update_perf, pstate_update_perf);
-
--static inline void
--amd_pstate_update_perf(struct amd_cpudata *cpudata, u32 min_perf,
-- u32 des_perf, u32 max_perf, bool fast_switch)
-+static inline void amd_pstate_update_perf(struct amd_cpudata *cpudata,
-+ u32 min_perf, u32 des_perf,
-+ u32 max_perf, bool fast_switch)
- {
- static_call(amd_pstate_update_perf)(cpudata, min_perf, des_perf,
- max_perf, fast_switch);
- }
-
--static void
--amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf,
-- u32 des_perf, u32 max_perf, bool fast_switch)
-+static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf,
-+ u32 des_perf, u32 max_perf, bool fast_switch)
- {
- u64 prev = READ_ONCE(cpudata->cppc_req_cached);
- u64 value = prev;
-- enum switch_type type = fast_switch ? AMD_ADJUST_PERF : AMD_TARGET;
-
- value &= ~REQ_MIN_PERF(~0L);
- value |= REQ_MIN_PERF(min_perf);
-@@ -203,8 +192,8 @@ amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf,
- value &= ~REQ_MAX_PERF(~0L);
- value |= REQ_MAX_PERF(max_perf);
-
-- trace_amd_pstate_perf(min_perf, des_perf, max_perf,
-- cpudata->cpu, prev, value, type);
-+ trace_amd_pstate_perf(min_perf, des_perf, max_perf, cpudata->cpu,
-+ (value != prev), fast_switch);
-
- if (value == prev)
- return;
-@@ -401,23 +390,6 @@ static void amd_pstate_boost_init(struct amd_cpudata *cpudata)
- amd_pstate_driver.boost_enabled = true;
- }
-
--static int amd_pstate_init_freqs_in_cpudata(struct amd_cpudata *cpudata,
-- u32 max_freq, u32 min_freq,
-- u32 nominal_freq,
-- u32 lowest_nonlinear_freq)
--{
-- if (!cpudata)
-- return -EINVAL;
--
-- /* Initial processor data capability frequencies */
-- cpudata->max_freq = max_freq;
-- cpudata->min_freq = min_freq;
-- cpudata->nominal_freq = nominal_freq;
-- cpudata->lowest_nonlinear_freq = lowest_nonlinear_freq;
--
-- return 0;
--}
--
- static int amd_pstate_cpu_init(struct cpufreq_policy *policy)
- {
- int min_freq, max_freq, nominal_freq, lowest_nonlinear_freq, ret;
-@@ -434,7 +406,6 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy)
- return -ENOMEM;
-
- cpudata->cpu = cpu;
-- cpudata->policy = policy;
-
- ret = amd_pstate_init_perf(cpudata);
- if (ret)
-@@ -481,13 +452,11 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy)
- goto free_cpudata2;
- }
-
-- ret = amd_pstate_init_freqs_in_cpudata(cpudata, max_freq, min_freq,
-- nominal_freq,
-- lowest_nonlinear_freq);
-- if (ret) {
-- dev_err(dev, "Failed to init cpudata (%d)\n", ret);
-- goto free_cpudata3;
-- }
-+ /* Initial processor data capability frequencies */
-+ cpudata->max_freq = max_freq;
-+ cpudata->min_freq = min_freq;
-+ cpudata->nominal_freq = nominal_freq;
-+ cpudata->lowest_nonlinear_freq = lowest_nonlinear_freq;
-
- policy->driver_data = cpudata;
-
-@@ -495,7 +464,6 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy)
-
- return 0;
-
--free_cpudata3:
- freq_qos_remove_request(&cpudata->req[1]);
- free_cpudata2:
- freq_qos_remove_request(&cpudata->req[0]);
-@@ -519,6 +487,10 @@ static int amd_pstate_cpu_exit(struct cpufreq_policy *policy)
-
- /* Sysfs attributes */
-
-+/* This frequency is to indicate the maximum hardware frequency.
-+ * If boost is not active but supported, the frequency will be larger than the
-+ * one in cpuinfo.
-+ */
- static ssize_t show_amd_pstate_max_freq(struct cpufreq_policy *policy,
- char *buf)
- {
-@@ -549,8 +521,8 @@ static ssize_t show_amd_pstate_nominal_freq(struct cpufreq_policy *policy,
- return sprintf(&buf[0], "%u\n", nominal_freq);
- }
-
--static ssize_t
--show_amd_pstate_lowest_nonlinear_freq(struct cpufreq_policy *policy, char *buf)
-+static ssize_t show_amd_pstate_lowest_nonlinear_freq(struct cpufreq_policy *policy,
-+ char *buf)
- {
- int freq;
- struct amd_cpudata *cpudata;
-@@ -564,22 +536,8 @@ show_amd_pstate_lowest_nonlinear_freq(struct cpufreq_policy *policy, char *buf)
- return sprintf(&buf[0], "%u\n", freq);
- }
-
--static ssize_t show_amd_pstate_min_freq(struct cpufreq_policy *policy, char *buf)
--{
-- int min_freq;
-- struct amd_cpudata *cpudata;
--
-- cpudata = policy->driver_data;
--
-- min_freq = amd_get_min_freq(cpudata);
-- if (min_freq < 0)
-- return min_freq;
--
-- return sprintf(&buf[0], "%u\n", min_freq);
--}
--
--static ssize_t
--show_amd_pstate_highest_perf(struct cpufreq_policy *policy, char *buf)
-+static ssize_t show_amd_pstate_highest_perf(struct cpufreq_policy *policy,
-+ char *buf)
- {
- u32 perf;
- struct amd_cpudata *cpudata = policy->driver_data;
-@@ -589,8 +547,8 @@ show_amd_pstate_highest_perf(struct cpufreq_policy *policy, char *buf)
- return sprintf(&buf[0], "%u\n", perf);
- }
-
--static ssize_t
--show_amd_pstate_nominal_perf(struct cpufreq_policy *policy, char *buf)
-+static ssize_t show_amd_pstate_nominal_perf(struct cpufreq_policy *policy,
-+ char *buf)
- {
- u32 perf;
- struct amd_cpudata *cpudata = policy->driver_data;
-@@ -600,8 +558,8 @@ show_amd_pstate_nominal_perf(struct cpufreq_policy *policy, char *buf)
- return sprintf(&buf[0], "%u\n", perf);
- }
-
--static ssize_t
--show_amd_pstate_lowest_nonlinear_perf(struct cpufreq_policy *policy, char *buf)
-+static ssize_t show_amd_pstate_lowest_nonlinear_perf(struct cpufreq_policy *policy,
-+ char *buf)
- {
- u32 perf;
- struct amd_cpudata *cpudata = policy->driver_data;
-@@ -611,8 +569,8 @@ show_amd_pstate_lowest_nonlinear_perf(struct cpufreq_policy *policy, char *buf)
- return sprintf(&buf[0], "%u\n", perf);
- }
-
--static ssize_t
--show_amd_pstate_lowest_perf(struct cpufreq_policy *policy, char *buf)
-+static ssize_t show_amd_pstate_lowest_perf(struct cpufreq_policy *policy,
-+ char *buf)
- {
- u32 perf;
- struct amd_cpudata *cpudata = policy->driver_data;
-@@ -622,18 +580,9 @@ show_amd_pstate_lowest_perf(struct cpufreq_policy *policy, char *buf)
- return sprintf(&buf[0], "%u\n", perf);
- }
-
--static ssize_t show_is_amd_pstate_enabled(struct cpufreq_policy *policy,
-- char *buf)
--{
-- return sprintf(&buf[0], "%d\n", acpi_cpc_valid() ? 1 : 0);
--}
--
--cpufreq_freq_attr_ro(is_amd_pstate_enabled);
--
- cpufreq_freq_attr_ro(amd_pstate_max_freq);
- cpufreq_freq_attr_ro(amd_pstate_nominal_freq);
- cpufreq_freq_attr_ro(amd_pstate_lowest_nonlinear_freq);
--cpufreq_freq_attr_ro(amd_pstate_min_freq);
-
- cpufreq_freq_attr_ro(amd_pstate_highest_perf);
- cpufreq_freq_attr_ro(amd_pstate_nominal_perf);
-@@ -641,11 +590,9 @@ cpufreq_freq_attr_ro(amd_pstate_lowest_nonlinear_perf);
- cpufreq_freq_attr_ro(amd_pstate_lowest_perf);
-
- static struct freq_attr *amd_pstate_attr[] = {
-- &is_amd_pstate_enabled,
- &amd_pstate_max_freq,
- &amd_pstate_nominal_freq,
- &amd_pstate_lowest_nonlinear_freq,
-- &amd_pstate_min_freq,
- &amd_pstate_highest_perf,
- &amd_pstate_nominal_perf,
- &amd_pstate_lowest_nonlinear_perf,
-@@ -661,7 +608,7 @@ static struct cpufreq_driver amd_pstate_driver = {
- .exit = amd_pstate_cpu_exit,
- .set_boost = amd_pstate_set_boost,
- .name = "amd-pstate",
-- .attr = amd_pstate_attr,
-+ .attr = amd_pstate_attr,
- };
-
- static int __init amd_pstate_init(void)
-@@ -709,15 +656,7 @@ static int __init amd_pstate_init(void)
- return 0;
- }
-
--static void __exit amd_pstate_exit(void)
--{
-- cpufreq_unregister_driver(&amd_pstate_driver);
--
-- amd_pstate_enable(false);
--}
--
--module_init(amd_pstate_init);
--module_exit(amd_pstate_exit);
-+device_initcall(amd_pstate_init);
-
- MODULE_AUTHOR("Huang Rui <ray.huang@amd.com>");
- MODULE_DESCRIPTION("AMD Processor P-state Frequency Driver");
-diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h
-index 3fdae40a75fc..550fa88cff86 100644
---- a/include/acpi/cppc_acpi.h
-+++ b/include/acpi/cppc_acpi.h
-@@ -137,7 +137,7 @@ struct cppc_cpudata {
- extern int cppc_get_desired_perf(int cpunum, u64 *desired_perf);
- extern int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs);
- extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls);
--extern int cppc_set_enable(int cpu, u32 enable);
-+extern int cppc_set_enable(int cpu, bool enable);
- extern int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps);
- extern bool acpi_cpc_valid(void);
- extern int acpi_get_psd_map(unsigned int cpu, struct cppc_cpudata *cpu_data);
-@@ -158,7 +158,7 @@ static inline int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls)
- {
- return -ENOTSUPP;
- }
--static inline int cppc_set_enable(int cpu, u32 enable)
-+static inline int cppc_set_enable(int cpu, bool enable)
- {
- return -ENOTSUPP;
- }
-diff --git a/include/trace/events/power.h b/include/trace/events/power.h
-index af5018aa9517..c95c0b8d443d 100644
---- a/include/trace/events/power.h
-+++ b/include/trace/events/power.h
-@@ -173,6 +173,52 @@ TRACE_EVENT(cpu_frequency_limits,
- (unsigned long)__entry->cpu_id)
- );
-
-+TRACE_EVENT(amd_pstate_perf,
-+
-+ TP_PROTO(unsigned long min_perf,
-+ unsigned long target_perf,
-+ unsigned long capacity,
-+ unsigned int cpu_id,
-+ bool changed,
-+ bool fast_switch
-+ ),
-+
-+ TP_ARGS(min_perf,
-+ target_perf,
-+ capacity,
-+ cpu_id,
-+ changed,
-+ fast_switch
-+ ),
-+
-+ TP_STRUCT__entry(
-+ __field(unsigned long, min_perf)
-+ __field(unsigned long, target_perf)
-+ __field(unsigned long, capacity)
-+ __field(unsigned int, cpu_id)
-+ __field(bool, changed)
-+ __field(bool, fast_switch)
-+ ),
-+
-+ TP_fast_assign(
-+ __entry->min_perf = min_perf;
-+ __entry->target_perf = target_perf;
-+ __entry->capacity = capacity;
-+ __entry->cpu_id = cpu_id;
-+ __entry->changed = changed;
-+ __entry->fast_switch = fast_switch;
-+ ),
-+
-+ TP_printk("amd_min_perf=%lu amd_des_perf=%lu amd_max_perf=%lu cpu_id=%u changed=%s fast_switch=%s",
-+ (unsigned long)__entry->min_perf,
-+ (unsigned long)__entry->target_perf,
-+ (unsigned long)__entry->capacity,
-+ (unsigned int)__entry->cpu_id,
-+ (__entry->changed) ? "true" : "false",
-+ (__entry->fast_switch) ? "true" : "false"
-+ )
-+);
-+
- TRACE_EVENT(device_pm_callback_start,
-
- TP_PROTO(struct device *dev, const char *pm_ops, int event),
-diff --git a/tools/power/cpupower/utils/helpers/amd.c b/tools/power/cpupower/utils/helpers/amd.c
-index d68d052ee4cb..fa38d3da42ce 100644
---- a/tools/power/cpupower/utils/helpers/amd.c
-+++ b/tools/power/cpupower/utils/helpers/amd.c
-@@ -160,7 +160,6 @@ enum amd_pstate_value {
- AMD_PSTATE_MAX_FREQ,
- AMD_PSTATE_NOMINAL_FREQ,
- AMD_PSTATE_LOWEST_NONLINEAR_FREQ,
-- AMD_PSTATE_MIN_FREQ,
- MAX_AMD_PSTATE_VALUE_READ_FILES
- };
-
-@@ -172,7 +171,6 @@ static const char *amd_pstate_value_files[MAX_AMD_PSTATE_VALUE_READ_FILES] = {
- [AMD_PSTATE_MAX_FREQ] = "amd_pstate_max_freq",
- [AMD_PSTATE_NOMINAL_FREQ] = "amd_pstate_nominal_freq",
- [AMD_PSTATE_LOWEST_NONLINEAR_FREQ] = "amd_pstate_lowest_nonlinear_freq",
-- [AMD_PSTATE_MIN_FREQ] = "amd_pstate_min_freq"
- };
-
- static unsigned long amd_pstate_get_data(unsigned int cpu,
-@@ -204,8 +202,15 @@ void amd_pstate_boost_init(unsigned int cpu, int *support, int *active)
-
- void amd_pstate_show_perf_and_freq(unsigned int cpu, int no_rounding)
- {
-+ unsigned long cpuinfo_max, cpuinfo_min;
-+
-+ cpufreq_get_hardware_limits(cpu, &cpuinfo_min, &cpuinfo_max);
-+
- printf(_(" AMD PSTATE Highest Performance: %lu. Maximum Frequency: "),
- amd_pstate_get_data(cpu, AMD_PSTATE_HIGHEST_PERF));
-+ /* If boost isn't active, the cpuinfo_max doesn't indicate real max
-+ * frequency. So we read it back from amd-pstate sysfs entry.
-+ */
- print_speed(amd_pstate_get_data(cpu, AMD_PSTATE_MAX_FREQ), no_rounding);
- printf(".\n");
-
-@@ -223,7 +228,7 @@ void amd_pstate_show_perf_and_freq(unsigned int cpu, int no_rounding)
-
- printf(_(" AMD PSTATE Lowest Performance: %lu. Lowest Frequency: "),
- amd_pstate_get_data(cpu, AMD_PSTATE_LOWEST_PERF));
-- print_speed(amd_pstate_get_data(cpu, AMD_PSTATE_MIN_FREQ), no_rounding);
-+ print_speed(cpuinfo_min, no_rounding);
- printf(".\n");
- }
-
-diff --git a/tools/power/cpupower/utils/helpers/helpers.h b/tools/power/cpupower/utils/helpers/helpers.h
-index 80755568afc4..5f6862502dbf 100644
---- a/tools/power/cpupower/utils/helpers/helpers.h
-+++ b/tools/power/cpupower/utils/helpers/helpers.h
-@@ -11,6 +11,7 @@
-
- #include <libintl.h>
- #include <locale.h>
-+#include <stdbool.h>
-
- #include "helpers/bitmask.h"
- #include <cpupower.h>
-@@ -138,7 +139,7 @@ extern int cpufreq_has_boost_support(unsigned int cpu, int *support,
- int *active, int * states);
-
- /* AMD P-States stuff **************************/
--extern unsigned long cpupower_amd_pstate_enabled(void);
-+extern bool cpupower_amd_pstate_enabled(void);
- extern void amd_pstate_boost_init(unsigned int cpu,
- int *support, int *active);
- extern void amd_pstate_show_perf_and_freq(unsigned int cpu,
-@@ -178,8 +179,8 @@ static inline int cpufreq_has_boost_support(unsigned int cpu, int *support,
- int *active, int * states)
- { return -1; }
-
--static inline unsigned long cpupower_amd_pstate_enabled(void)
--{ return 0; }
-+static inline bool cpupower_amd_pstate_enabled(void)
-+{ return false; }
- static void amd_pstate_boost_init(unsigned int cpu,
- int *support, int *active)
- { return; }
-diff --git a/tools/power/cpupower/utils/helpers/misc.c b/tools/power/cpupower/utils/helpers/misc.c
-index 730f670ab90d..d693c96cd09c 100644
---- a/tools/power/cpupower/utils/helpers/misc.c
-+++ b/tools/power/cpupower/utils/helpers/misc.c
-@@ -3,9 +3,11 @@
- #include <stdio.h>
- #include <errno.h>
- #include <stdlib.h>
-+#include <string.h>
-
- #include "helpers/helpers.h"
- #include "helpers/sysfs.h"
-+#include "cpufreq.h"
-
- #if defined(__i386__) || defined(__x86_64__)
-
-@@ -85,24 +87,20 @@ int cpupower_intel_set_perf_bias(unsigned int cpu, unsigned int val)
- return 0;
- }
-
--unsigned long cpupower_amd_pstate_enabled(void)
-+bool cpupower_amd_pstate_enabled(void)
- {
-- char linebuf[MAX_LINE_LEN];
-- char path[SYSFS_PATH_MAX];
-- unsigned long val;
-- char *endp;
-+ char *driver = cpufreq_get_driver(0);
-+ bool ret = false;
-
-- snprintf(path, sizeof(path),
-- PATH_TO_CPU "cpu0/cpufreq/is_amd_pstate_enabled");
-+ if (!driver)
-+ return ret;
-
-- if (cpupower_read_sysfs(path, linebuf, MAX_LINE_LEN) == 0)
-- return 0;
-+ if (!strcmp(driver, "amd-pstate"))
-+ ret = true;
-
-- val = strtoul(linebuf, &endp, 0);
-- if (endp == linebuf || errno == ERANGE)
-- return 0;
-+ cpufreq_put_driver(driver);
-
-- return val;
-+ return ret;
- }
-
- #endif /* #if defined(__i386__) || defined(__x86_64__) */
diff --git a/asus-wmi-Add-dgpu-disable-method.patch b/asus-wmi-Add-dgpu-disable-method.patch
deleted file mode 100644
index 415590fd6094..000000000000
--- a/asus-wmi-Add-dgpu-disable-method.patch
+++ /dev/null
@@ -1,182 +0,0 @@
-From de08016c5ef567c853dcf2ff8d9c9b352af253b6 Mon Sep 17 00:00:00 2001
-From: "Luke D. Jones" <luke@ljones.dev>
-Date: Sat, 17 Jul 2021 20:13:22 +1200
-Subject: [PATCH 102/103] asus-wmi: Add dgpu disable method
-
-In Windows the ASUS Armory Crate program can enable or disable the
-dGPU via a WMI call. This functions much the same as various Linux
-methods in software where the dGPU is removed from the device tree.
-
-However the WMI call saves the state of dGPU (enabled or not) and
-this then changes the dGPU visibility in Linux with no way for
-Linux users to re-enable it. We expose the WMI method so users can
-see and change the dGPU ACPI state.
-
-Signed-off-by: Luke D. Jones <luke@ljones.dev>
----
- drivers/platform/x86/asus-wmi.c | 99 ++++++++++++++++++++++
- include/linux/platform_data/x86/asus-wmi.h | 3 +
- 2 files changed, 102 insertions(+)
-
-diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
-index cd881443bc2f..02762a60d27a 100644
---- a/drivers/platform/x86/asus-wmi.c
-+++ b/drivers/platform/x86/asus-wmi.c
-@@ -210,6 +210,9 @@ struct asus_wmi {
- u8 fan_boost_mode_mask;
- u8 fan_boost_mode;
-
-+ bool dgpu_disable_available;
-+ bool dgpu_disable;
-+
- bool throttle_thermal_policy_available;
- u8 throttle_thermal_policy_mode;
-
-@@ -427,6 +430,94 @@ static void lid_flip_tablet_mode_get_state(struct asus_wmi *asus)
- }
- }
-
-+/* dGPU ********************************************************************/
-+static int dgpu_disable_check_present(struct asus_wmi *asus)
-+{
-+ u32 result;
-+ int err;
-+
-+ asus->dgpu_disable_available = false;
-+
-+ err = asus_wmi_get_devstate(asus, ASUS_WMI_DEVID_DGPU, &result);
-+ if (err) {
-+ if (err == -ENODEV)
-+ return 0;
-+ return err;
-+ }
-+
-+ if (result & ASUS_WMI_DSTS_PRESENCE_BIT) {
-+ asus->dgpu_disable_available = true;
-+ asus->dgpu_disable = result & ASUS_WMI_DSTS_STATUS_BIT;
-+ }
-+
-+ return 0;
-+}
-+
-+static int dgpu_disable_write(struct asus_wmi *asus)
-+{
-+ int err;
-+ u8 value;
-+ u32 retval;
-+
-+ value = asus->dgpu_disable;
-+
-+ err = asus_wmi_set_devstate(ASUS_WMI_DEVID_DGPU, value, &retval);
-+
-+ if (err) {
-+ pr_warn("Failed to set dgpu disable: %d\n", err);
-+ return err;
-+ }
-+
-+ if (retval > 1 || retval < 0) {
-+ pr_warn("Failed to set dgpu disable (retval): 0x%x\n", retval);
-+ return -EIO;
-+ }
-+
-+ sysfs_notify(&asus->platform_device->dev.kobj, NULL, "dgpu_disable");
-+
-+ return 0;
-+}
-+
-+static ssize_t dgpu_disable_show(struct device *dev,
-+ struct device_attribute *attr, char *buf)
-+{
-+ struct asus_wmi *asus = dev_get_drvdata(dev);
-+ bool mode = asus->dgpu_disable;
-+
-+ return sysfs_emit(buf, "%d\n", mode);
-+}
-+
-+static ssize_t dgpu_disable_store(struct device *dev,
-+ struct device_attribute *attr,
-+ const char *buf, size_t count)
-+{
-+ int result;
-+ bool disable;
-+ struct asus_wmi *asus = dev_get_drvdata(dev);
-+
-+ result = kstrtobool(buf, &disable);
-+ if (result == -EINVAL)
-+ return result;
-+
-+ asus->dgpu_disable = disable;
-+ /*
-+ * The ACPI call used does not save the mode unless the call is run twice.
-+ * Once to disable, then once to check status and save - this is two code
-+ * paths in the method in the ACPI dumps.
-+ */
-+ result = dgpu_disable_write(asus);
-+ if (result != 0)
-+ return result;
-+
-+ result = dgpu_disable_write(asus);
-+ if (result != 0)
-+ return result;
-+
-+ return count;
-+}
-+
-+static DEVICE_ATTR_RW(dgpu_disable);
-+
- /* Battery ********************************************************************/
-
- /* The battery maximum charging percentage */
-@@ -2411,6 +2502,7 @@ static struct attribute *platform_attributes[] = {
- &dev_attr_camera.attr,
- &dev_attr_cardr.attr,
- &dev_attr_touchpad.attr,
-+ &dev_attr_dgpu_disable.attr,
- &dev_attr_lid_resume.attr,
- &dev_attr_als_enable.attr,
- &dev_attr_fan_boost_mode.attr,
-@@ -2437,6 +2529,8 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj,
- devid = ASUS_WMI_DEVID_LID_RESUME;
- else if (attr == &dev_attr_als_enable.attr)
- devid = ASUS_WMI_DEVID_ALS_ENABLE;
-+ else if (attr == &dev_attr_dgpu_disable.attr)
-+ ok = asus->dgpu_disable_available;
- else if (attr == &dev_attr_fan_boost_mode.attr)
- ok = asus->fan_boost_mode_available;
- else if (attr == &dev_attr_throttle_thermal_policy.attr)
-@@ -2698,6 +2792,10 @@ static int asus_wmi_add(struct platform_device *pdev)
- if (err)
- goto fail_platform;
-
-+ err = dgpu_disable_check_present(asus);
-+ if (err)
-+ goto fail_dgpu_disable;
-+
- err = fan_boost_mode_check_present(asus);
- if (err)
- goto fail_fan_boost_mode;
-@@ -2798,6 +2896,7 @@ static int asus_wmi_add(struct platform_device *pdev)
- fail_sysfs:
- fail_throttle_thermal_policy:
- fail_fan_boost_mode:
-+fail_dgpu_disable:
- fail_platform:
- fail_panel_od:
- kfree(asus);
-diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
-index 428aea701c7b..a528f9d0e4b7 100644
---- a/include/linux/platform_data/x86/asus-wmi.h
-+++ b/include/linux/platform_data/x86/asus-wmi.h
-@@ -90,6 +90,9 @@
- /* Keyboard dock */
- #define ASUS_WMI_DEVID_KBD_DOCK 0x00120063
-
-+/* dgpu on/off */
-+#define ASUS_WMI_DEVID_DGPU 0x00090020
-+
- /* DSTS masks */
- #define ASUS_WMI_DSTS_STATUS_BIT 0x00000001
- #define ASUS_WMI_DSTS_UNKNOWN_BIT 0x00000002
---
-2.32.0
-
diff --git a/asus-wmi-Add-egpu-enable-method.patch b/asus-wmi-Add-egpu-enable-method.patch
deleted file mode 100644
index 13804605dc37..000000000000
--- a/asus-wmi-Add-egpu-enable-method.patch
+++ /dev/null
@@ -1,169 +0,0 @@
-From 49872973ce89a5778cd57094eb2eebba530b1244 Mon Sep 17 00:00:00 2001
-From: "Luke D. Jones" <luke@ljones.dev>
-Date: Sat, 17 Jul 2021 20:13:23 +1200
-Subject: [PATCH 103/103] asus-wmi: Add egpu enable method
-
-The X13 Flow laptops can utilise an external GPU. This requires
-toggling an ACPI method which will first disable the internal
-dGPU, and then enable the eGPU.
-
-Signed-off-by: Luke D. Jones <luke@ljones.dev>
----
- drivers/platform/x86/asus-wmi.c | 91 ++++++++++++++++++++++
- include/linux/platform_data/x86/asus-wmi.h | 3 +
- 2 files changed, 94 insertions(+)
-
-diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
-index 02762a60d27a..ee5d8656641e 100644
---- a/drivers/platform/x86/asus-wmi.c
-+++ b/drivers/platform/x86/asus-wmi.c
-@@ -210,6 +210,9 @@ struct asus_wmi {
- u8 fan_boost_mode_mask;
- u8 fan_boost_mode;
-
-+ bool egpu_enable_available; // 0 = enable
-+ bool egpu_enable;
-+
- bool dgpu_disable_available;
- bool dgpu_disable;
-
-@@ -430,6 +433,86 @@ static void lid_flip_tablet_mode_get_state(struct asus_wmi *asus)
- }
- }
-
-+/* eGPU ********************************************************************/
-+static int egpu_enable_check_present(struct asus_wmi *asus)
-+{
-+ u32 result;
-+ int err;
-+
-+ asus->egpu_enable_available = false;
-+
-+ err = asus_wmi_get_devstate(asus, ASUS_WMI_DEVID_EGPU, &result);
-+ if (err) {
-+ if (err == -ENODEV)
-+ return 0;
-+ return err;
-+ }
-+
-+ if (result & ASUS_WMI_DSTS_PRESENCE_BIT) {
-+ asus->egpu_enable_available = true;
-+ asus->egpu_enable = result & ASUS_WMI_DSTS_STATUS_BIT;
-+ }
-+
-+ return 0;
-+}
-+
-+static int egpu_enable_write(struct asus_wmi *asus)
-+{
-+ int err;
-+ u8 value;
-+ u32 retval;
-+
-+ value = asus->egpu_enable;
-+
-+ err = asus_wmi_set_devstate(ASUS_WMI_DEVID_EGPU, value, &retval);
-+
-+ if (err) {
-+ pr_warn("Failed to set egpu disable: %d\n", err);
-+ return err;
-+ }
-+
-+ if (retval > 1 || retval < 0) {
-+ pr_warn("Failed to set egpu disable (retval): 0x%x\n", retval);
-+ return -EIO;
-+ }
-+
-+ sysfs_notify(&asus->platform_device->dev.kobj, NULL, "egpu_enable");
-+
-+ return 0;
-+}
-+
-+static ssize_t egpu_enable_show(struct device *dev,
-+ struct device_attribute *attr, char *buf)
-+{
-+ struct asus_wmi *asus = dev_get_drvdata(dev);
-+ bool mode = asus->egpu_enable;
-+
-+ return sysfs_emit(buf, "%d\n", mode);
-+}
-+
-+static ssize_t egpu_enable_store(struct device *dev,
-+ struct device_attribute *attr,
-+ const char *buf, size_t count)
-+{
-+ int result;
-+ bool disable;
-+ struct asus_wmi *asus = dev_get_drvdata(dev);
-+
-+ result = kstrtobool(buf, &disable);
-+ if (result == -EINVAL)
-+ return result;
-+
-+ asus->egpu_enable = disable;
-+
-+ result = egpu_enable_write(asus);
-+ if (result != 0)
-+ return result;
-+
-+ return count;
-+}
-+
-+static DEVICE_ATTR_RW(egpu_enable);
-+
- /* dGPU ********************************************************************/
- static int dgpu_disable_check_present(struct asus_wmi *asus)
- {
-@@ -2502,6 +2585,7 @@ static struct attribute *platform_attributes[] = {
- &dev_attr_camera.attr,
- &dev_attr_cardr.attr,
- &dev_attr_touchpad.attr,
-+ &dev_attr_egpu_enable.attr,
- &dev_attr_dgpu_disable.attr,
- &dev_attr_lid_resume.attr,
- &dev_attr_als_enable.attr,
-@@ -2529,6 +2613,8 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj,
- devid = ASUS_WMI_DEVID_LID_RESUME;
- else if (attr == &dev_attr_als_enable.attr)
- devid = ASUS_WMI_DEVID_ALS_ENABLE;
-+ else if (attr == &dev_attr_egpu_enable.attr)
-+ ok = asus->egpu_enable_available;
- else if (attr == &dev_attr_dgpu_disable.attr)
- ok = asus->dgpu_disable_available;
- else if (attr == &dev_attr_fan_boost_mode.attr)
-@@ -2792,6 +2878,10 @@ static int asus_wmi_add(struct platform_device *pdev)
- if (err)
- goto fail_platform;
-
-+ err = egpu_enable_check_present(asus);
-+ if (err)
-+ goto fail_egpu_enable;
-+
- err = dgpu_disable_check_present(asus);
- if (err)
- goto fail_dgpu_disable;
-@@ -2896,6 +2986,7 @@ static int asus_wmi_add(struct platform_device *pdev)
- fail_sysfs:
- fail_throttle_thermal_policy:
- fail_fan_boost_mode:
-+fail_egpu_enable:
- fail_dgpu_disable:
- fail_platform:
- fail_panel_od:
-diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
-index a528f9d0e4b7..17dc5cb6f3f2 100644
---- a/include/linux/platform_data/x86/asus-wmi.h
-+++ b/include/linux/platform_data/x86/asus-wmi.h
-@@ -90,6 +90,9 @@
- /* Keyboard dock */
- #define ASUS_WMI_DEVID_KBD_DOCK 0x00120063
-
-+/* dgpu on/off */
-+#define ASUS_WMI_DEVID_EGPU 0x00090019
-+
- /* dgpu on/off */
- #define ASUS_WMI_DEVID_DGPU 0x00090020
-
---
-2.32.0
-
diff --git a/asus-wmi-Add-panel-overdrive-functionality.patch b/asus-wmi-Add-panel-overdrive-functionality.patch
deleted file mode 100644
index 9ee246ce3398..000000000000
--- a/asus-wmi-Add-panel-overdrive-functionality.patch
+++ /dev/null
@@ -1,166 +0,0 @@
-From 4fb0353bff3b881de7709b114d4607a0988c3420 Mon Sep 17 00:00:00 2001
-From: "Luke D. Jones" <luke@ljones.dev>
-Date: Sat, 17 Jul 2021 20:13:21 +1200
-Subject: [PATCH 101/103] asus-wmi: Add panel overdrive functionality
-
-Some ASUS ROG laptops have the ability to drive the display panel
-a higher rate to eliminate or reduce ghosting.
-
-Signed-off-by: Luke D. Jones <luke@ljones.dev>
----
- drivers/platform/x86/asus-wmi.c | 91 ++++++++++++++++++++++
- include/linux/platform_data/x86/asus-wmi.h | 1 +
- 2 files changed, 92 insertions(+)
-
-diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
-index ebaeb7bb80f5..cd881443bc2f 100644
---- a/drivers/platform/x86/asus-wmi.c
-+++ b/drivers/platform/x86/asus-wmi.c
-@@ -216,6 +216,9 @@ struct asus_wmi {
- // The RSOC controls the maximum charging percentage.
- bool battery_rsoc_available;
-
-+ bool panel_overdrive_available;
-+ bool panel_overdrive;
-+
- struct hotplug_slot hotplug_slot;
- struct mutex hotplug_lock;
- struct mutex wmi_lock;
-@@ -1221,6 +1224,86 @@ static int asus_wmi_rfkill_init(struct asus_wmi *asus)
- return result;
- }
-
-+/* Panel Overdrive ************************************************************/
-+static int panel_od_check_present(struct asus_wmi *asus)
-+{
-+ u32 result;
-+ int err;
-+
-+ asus->panel_overdrive_available = false;
-+
-+ err = asus_wmi_get_devstate(asus, ASUS_WMI_DEVID_PANEL_OD, &result);
-+ if (err) {
-+ if (err == -ENODEV)
-+ return 0;
-+ return err;
-+ }
-+
-+ if (result & ASUS_WMI_DSTS_PRESENCE_BIT) {
-+ asus->panel_overdrive_available = true;
-+ asus->panel_overdrive = result & ASUS_WMI_DSTS_STATUS_BIT;
-+ }
-+
-+ return 0;
-+}
-+
-+static int panel_od_write(struct asus_wmi *asus)
-+{
-+ int err;
-+ u8 value;
-+ u32 retval;
-+
-+ value = asus->panel_overdrive;
-+
-+ err = asus_wmi_set_devstate(ASUS_WMI_DEVID_PANEL_OD, value, &retval);
-+
-+ if (err) {
-+ pr_warn("Failed to set panel overdrive: %d\n", err);
-+ return err;
-+ }
-+
-+ if (retval > 1 || retval < 0) {
-+ pr_warn("Failed to set panel overdrive (retval): 0x%x\n", retval);
-+ return -EIO;
-+ }
-+
-+ sysfs_notify(&asus->platform_device->dev.kobj, NULL, "panel_od");
-+
-+ return 0;
-+}
-+
-+static ssize_t panel_od_show(struct device *dev,
-+ struct device_attribute *attr, char *buf)
-+{
-+ struct asus_wmi *asus = dev_get_drvdata(dev);
-+ bool mode = asus->panel_overdrive;
-+
-+ return sysfs_emit(buf, "%d\n", mode);
-+}
-+
-+static ssize_t panel_od_store(struct device *dev,
-+ struct device_attribute *attr,
-+ const char *buf, size_t count)
-+{
-+ int result;
-+ bool overdrive;
-+ struct asus_wmi *asus = dev_get_drvdata(dev);
-+
-+ result = kstrtobool(buf, &overdrive);
-+ if (result == -EINVAL)
-+ return result;
-+
-+ asus->panel_overdrive = overdrive;
-+ result = panel_od_write(asus);
-+
-+ if (result != 0)
-+ return result;
-+
-+ return count;
-+}
-+
-+static DEVICE_ATTR_RW(panel_od);
-+
- /* Quirks *********************************************************************/
-
- static void asus_wmi_set_xusb2pr(struct asus_wmi *asus)
-@@ -2332,6 +2415,7 @@ static struct attribute *platform_attributes[] = {
- &dev_attr_als_enable.attr,
- &dev_attr_fan_boost_mode.attr,
- &dev_attr_throttle_thermal_policy.attr,
-+ &dev_attr_panel_od.attr,
- NULL
- };
-
-@@ -2357,6 +2441,8 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj,
- ok = asus->fan_boost_mode_available;
- else if (attr == &dev_attr_throttle_thermal_policy.attr)
- ok = asus->throttle_thermal_policy_available;
-+ else if (attr == &dev_attr_panel_od.attr)
-+ ok = asus->panel_overdrive_available;
-
- if (devid != -1)
- ok = !(asus_wmi_get_devstate_simple(asus, devid) < 0);
-@@ -2622,6 +2708,10 @@ static int asus_wmi_add(struct platform_device *pdev)
- else
- throttle_thermal_policy_set_default(asus);
-
-+ err = panel_od_check_present(asus);
-+ if (err)
-+ goto fail_panel_od;
-+
- err = asus_wmi_sysfs_init(asus->platform_device);
- if (err)
- goto fail_sysfs;
-@@ -2709,6 +2799,7 @@ static int asus_wmi_add(struct platform_device *pdev)
- fail_throttle_thermal_policy:
- fail_fan_boost_mode:
- fail_platform:
-+fail_panel_od:
- kfree(asus);
- return err;
- }
-diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
-index 2f274cf52805..428aea701c7b 100644
---- a/include/linux/platform_data/x86/asus-wmi.h
-+++ b/include/linux/platform_data/x86/asus-wmi.h
-@@ -61,6 +61,7 @@
- #define ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY 0x00120075
-
- /* Misc */
-+#define ASUS_WMI_DEVID_PANEL_OD 0x00050019
- #define ASUS_WMI_DEVID_CAMERA 0x00060013
- #define ASUS_WMI_DEVID_LID_FLIP 0x00060062
-
---
-2.32.0
-
diff --git a/hwmon-k10temp-support-Zen3-APUs.patch b/hwmon-k10temp-support-Zen3-APUs.patch
deleted file mode 100644
index 9f117f8f4365..000000000000
--- a/hwmon-k10temp-support-Zen3-APUs.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 02c6edd4b1a07f24b187a550d413a07260eb696d Mon Sep 17 00:00:00 2001
-From: David Bartley <andareed@gmail.com>
-Date: Sun, 16 May 2021 23:41:31 -0700
-Subject: hwmon: (k10temp) support Zen3 APUs
-
-Add support for Zen3 Ryzen APU.
-
-Signed-off-by: David Bartley <andareed@gmail.com>
-Link: https://lore.kernel.org/r/20210517064131.4369-1-andareed@gmail.com
-Signed-off-by: Guenter Roeck <linux@roeck-us.net>
----
- drivers/hwmon/k10temp.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c
-index 5ff3669c2b608..fe3d92152e359 100644
---- a/drivers/hwmon/k10temp.c
-+++ b/drivers/hwmon/k10temp.c
-@@ -450,6 +450,7 @@ static int k10temp_probe(struct pci_dev *pdev, const struct pci_device_id *id)
- switch (boot_cpu_data.x86_model) {
- case 0x0 ... 0x1: /* Zen3 SP3/TR */
- case 0x21: /* Zen3 Ryzen Desktop */
-+ case 0x50: /* Zen3 Ryzen APU */
- k10temp_get_ccd_support(pdev, data, 8);
- break;
- }
-@@ -491,6 +492,7 @@ static const struct pci_device_id k10temp_id_table[] = {
- { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M60H_DF_F3) },
- { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F3) },
- { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_DF_F3) },
-+ { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F3) },
- { PCI_VDEVICE(HYGON, PCI_DEVICE_ID_AMD_17H_DF_F3) },
- {}
- };
---
-cgit 1.2.3-1.el7
-
diff --git a/myconfig b/myconfig
deleted file mode 100644
index 71fc2e1d49ea..000000000000
--- a/myconfig
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/bin/bash
-
-## XXX: As this kernel package is primarily targeted at ASUS laptops we default to schedutil so the machine properly clocks down
-
-scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
-scripts/config --enable CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL
-
-## s0ix debugging moved into PKGBUILD
-
-## asusctl/supergfxctl compatibility
-scripts/config --module CONFIG_VFIO_IOMMU_TYPE1 \
- --module CONFIG_VFIO_VIRQFD \
- --disable CONFIG_VFIO_NOIOMMU \
- --module CONFIG_VFIO_PCI
-
-## NOTE: Add any options here that you'd like to change from kernel defaults
-
-# sync default hostname with Arch
-scripts/config --set-val CONFIG_DEFAULT_HOSTNAME archlinux
-
-# sync up BPF defaults with mainline
-scripts/config --enable CONFIG_BPF_PRELOAD \
- --module CONFIG_BPF_PRELOAD_UMD
-scripts/config --enable CONFIG_BPF_LSM \
- --disable CONFIG_BPF_UNPRIV_DEFAULT_OFF
-
-# sync some settings with Arch:
-scripts/config --enable CONFIG_TASKS_RUDE_RCU \
- --disable CONFIG_X86_MCELOG_LEGACY \
- --enable CONFIG_X86_CPA_STATISTICS \
- --module CONFIG_X86_PMEM_LEGACY \
- --enable CONFIG_KPROBES_ON_FTRACE \
- --enable CONFIG_UPROBES \
- --enable CONFIG_LOCK_EVENT_COUNTS \
- --enable CONFIG_MODULE_FORCE_LOAD \
- --enable CONFIG_MODULE_FORCE_UNLOAD \
- --enable CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS \
- --enable CONFIG_BLK_DEV_THROTTLING_LOW \
- --enable CONFIG_BLK_CGROUP_IOCOST \
- --enable CONFIG_CMA \
- --enable CONFIG_CMA_DEBUGFS \
- --enable CONFIG_CMA_SYSFS \
- --set-val CONFIG_CMA_AREAS 7 \
- --enable CONFIG_ZSWAP_DEFAULT_ON \
- --enable CONFIG_READ_ONLY_THP_FOR_FS \
- --enable CONFIG_XFRM_SUB_POLICY \
- --enable CONFIG_XFRM_MIGRATE \
- --enable CONFIG_NET_KEY_MIGRATE \
- --enable CONFIG_IPV6_OPTIMISTIC_DAD \
- --enable CONFIG_IPV6_RPL_LWTUNNEL \
- --enable CONFIG_NF_CONNTRACK_PROCFS \
- --module CONFIG_NETFILTER_XT_TARGET_NOTRACK \
- --disable CONFIG_DECNET \
- --module CONFIG_IPDDP \
- --enable CONFIG_IPDDP_ENCAP \
- --disable CONFIG_X25 \
- --disable CONFIG_LAPB
-
-scripts/config --enable CONFIG_TRACEPOINTS \
- --disable CONFIG_IOSF_MBI_DEBUG \
- --enable CONFIG_KVM_MMU_AUDIT \
- --disable CONFIG_BLK_CMDLINE_PARSER \
- --enable CONFIG_6LOWPAN_DEBUGFS \
- --module CONFIG_6LOWPAN_GHC_EXT_HDR_HOP \
- --module CONFIG_6LOWPAN_GHC_UDP \
- --module CONFIG_6LOWPAN_GHC_ICMPV6 \
- --module CONFIG_6LOWPAN_GHC_EXT_HDR_DEST \
- --module CONFIG_6LOWPAN_GHC_EXT_HDR_FRAG \
- --module CONFIG_6LOWPAN_GHC_EXT_HDR_ROUTE \
- --enable CONFIG_IEEE802154_NL802154_EXPERIMENTAL \
- --enable CONFIG_CLS_U32_PERF \
- --module CONFIG_NET_ACT_IFE \
- --enable CONFIG_BATMAN_ADV_BATMAN_V \
- --enable CONFIG_CEPH_LIB_PRETTYDEBUG \
- --module CONFIG_PCIEAER_INJECT \
- --enable CONFIG_PCIE_ECRC \
- --enable CONFIG_PCI_P2PDMA
-
-scripts/config --disable CONFIG_RAPIDIO \
- --module CONFIG_CDROM \
- --disable CONFIG_PARIDE \
- --enable CONFIG_NVME_CORE \
- --enable CONFIG_BLK_DEV_NVME \
- --module CONFIG_FDDI \
- --module CONFIG_PPP \
- --module CONFIG_SLHC
-
-# package is throwing a warning re: lack of binutils support
-scripts/config --disable CONFIG_X86_X32
-# larger log buffer
-scripts/config --set-val CONFIG_LOG_BUF_SHIFT 18
-# msr as a module
-scripts/config --module CONFIG_X86_MSR
-# enable EFI var access
-scripts/config --enable CONFIG_EFI_VARS
-# enable module versioning
-scripts/config --enable CONFIG_MODVERSIONS
-# use a smaller connection tracking table
-scripts/config --set-val CONFIG_IP_VS_TAB_BITS 12
-# enable bluetooth high speed
-scripts/config --enable CONFIG_BT_HS
-# nein
-scripts/config --disable CONFIG_UEVENT_HELPER
-scripts/config --disable CONFIG_FW_LOADER_USER_HELPER
-# enable zram memory tracking
-scripts/config --enable CONFIG_ZRAM_MEMORY_TRACKING
-
-# enable another ACPI debugging module
-scripts/config --module CONFIG_ACPI_APEI_ERST_DEBUG
-
-# enable multigen LRU by default
-scripts/config --enable CONFIG_LRU_GEN_ENABLED
-
diff --git a/r8169-Add-device-10ec-8162-to-driver-r8169.patch b/r8169-Add-device-10ec-8162-to-driver-r8169.patch
deleted file mode 100644
index 08fd526045ae..000000000000
--- a/r8169-Add-device-10ec-8162-to-driver-r8169.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 72f898ca0ab85fde6facf78b14d9f67a4a7b32d1 Mon Sep 17 00:00:00 2001
-From: Janghyub Seo <jhyub06@gmail.com>
-Date: Tue, 26 Oct 2021 07:12:42 +0000
-Subject: [PATCH] r8169: Add device 10ec:8162 to driver r8169
-
-This patch makes the driver r8169 pick up device Realtek Semiconductor Co.
-, Ltd. Device [10ec:8162].
-
-Signed-off-by: Janghyub Seo <jhyub06@gmail.com>
-Suggested-by: Rushab Shah <rushabshah32@gmail.com>
-Link: https://lore.kernel.org/r/1635231849296.1489250046.441294000@gmail.com
-Signed-off-by: Jakub Kicinski <kuba@kernel.org>
----
- drivers/net/ethernet/realtek/r8169_main.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
-index 46a6ff9a782d..2918947dd57c 100644
---- a/drivers/net/ethernet/realtek/r8169_main.c
-+++ b/drivers/net/ethernet/realtek/r8169_main.c
-@@ -157,6 +157,7 @@ static const struct pci_device_id rtl8169_pci_tbl[] = {
- { PCI_VDEVICE(REALTEK, 0x8129) },
- { PCI_VDEVICE(REALTEK, 0x8136), RTL_CFG_NO_GBIT },
- { PCI_VDEVICE(REALTEK, 0x8161) },
-+ { PCI_VDEVICE(REALTEK, 0x8162) },
- { PCI_VDEVICE(REALTEK, 0x8167) },
- { PCI_VDEVICE(REALTEK, 0x8168) },
- { PCI_VDEVICE(NCUBE, 0x8168) },
---
-2.33.1
-
diff --git a/v5-asus-wmi-Add-support-for-platform_profile.patch b/v5-asus-wmi-Add-support-for-platform_profile.patch
deleted file mode 100644
index 737c3bd2c15c..000000000000
--- a/v5-asus-wmi-Add-support-for-platform_profile.patch
+++ /dev/null
@@ -1,239 +0,0 @@
-From ecb125585d4e69dda57647af19b8a8736b876cee Mon Sep 17 00:00:00 2001
-From: "Luke D. Jones" <luke@ljones.dev>
-Date: Fri, 13 Aug 2021 14:36:01 +1200
-Subject: [PATCH v5 1/1] asus-wmi: Add support for platform_profile
-
-Add initial support for platform_profile where the support is
-based on availability of ASUS_THROTTLE_THERMAL_POLICY.
-
-Because throttle_thermal_policy is used by platform_profile and is
-writeable separately to platform_profile any userspace changes to
-throttle_thermal_policy need to notify platform_profile.
-
-In future throttle_thermal_policy sysfs should be removed so that
-only one method controls the laptop power profile.
-
-Signed-off-by: Luke D. Jones <luke@ljones.dev>
----
- drivers/platform/x86/Kconfig | 1 +
- drivers/platform/x86/asus-wmi.c | 130 +++++++++++++++++++++++++++++++-
- 2 files changed, 127 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
-index d12db6c316ea..46dec48a36c1 100644
---- a/drivers/platform/x86/Kconfig
-+++ b/drivers/platform/x86/Kconfig
-@@ -281,6 +281,7 @@ config ASUS_WMI
- select INPUT_SPARSEKMAP
- select LEDS_CLASS
- select NEW_LEDS
-+ select ACPI_PLATFORM_PROFILE
- help
- Say Y here if you have a WMI aware Asus laptop (like Eee PCs or new
- Asus Notebooks).
-diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
-index 90a6a0d00deb..cc5811844012 100644
---- a/drivers/platform/x86/asus-wmi.c
-+++ b/drivers/platform/x86/asus-wmi.c
-@@ -26,6 +26,7 @@
- #include <linux/rfkill.h>
- #include <linux/pci.h>
- #include <linux/pci_hotplug.h>
-+#include <linux/platform_profile.h>
- #include <linux/power_supply.h>
- #include <linux/hwmon.h>
- #include <linux/hwmon-sysfs.h>
-@@ -219,6 +220,9 @@ struct asus_wmi {
- bool throttle_thermal_policy_available;
- u8 throttle_thermal_policy_mode;
-
-+ struct platform_profile_handler platform_profile_handler;
-+ bool platform_profile_support;
-+
- // The RSOC controls the maximum charging percentage.
- bool battery_rsoc_available;
-
-@@ -2103,12 +2107,23 @@ static int throttle_thermal_policy_set_default(struct asus_wmi *asus)
- static int throttle_thermal_policy_switch_next(struct asus_wmi *asus)
- {
- u8 new_mode = asus->throttle_thermal_policy_mode + 1;
-+ int err;
-
- if (new_mode > ASUS_THROTTLE_THERMAL_POLICY_SILENT)
- new_mode = ASUS_THROTTLE_THERMAL_POLICY_DEFAULT;
-
- asus->throttle_thermal_policy_mode = new_mode;
-- return throttle_thermal_policy_write(asus);
-+ err = throttle_thermal_policy_write(asus);
-+ if (err)
-+ return err;
-+
-+ /*
-+ * Ensure that platform_profile updates userspace with the change to ensure
-+ * that platform_profile and throttle_thermal_policy_mode are in sync.
-+ */
-+ platform_profile_notify();
-+
-+ return 0;
- }
-
- static ssize_t throttle_thermal_policy_show(struct device *dev,
-@@ -2124,9 +2139,10 @@ static ssize_t throttle_thermal_policy_store(struct device *dev,
- struct device_attribute *attr,
- const char *buf, size_t count)
- {
-- int result;
-- u8 new_mode;
- struct asus_wmi *asus = dev_get_drvdata(dev);
-+ u8 new_mode;
-+ int result;
-+ int err;
-
- result = kstrtou8(buf, 10, &new_mode);
- if (result < 0)
-@@ -2136,7 +2152,15 @@ static ssize_t throttle_thermal_policy_store(struct device *dev,
- return -EINVAL;
-
- asus->throttle_thermal_policy_mode = new_mode;
-- throttle_thermal_policy_write(asus);
-+ err = throttle_thermal_policy_write(asus);
-+ if (err)
-+ return err;
-+
-+ /*
-+ * Ensure that platform_profile updates userspace with the change to ensure
-+ * that platform_profile and throttle_thermal_policy_mode are in sync.
-+ */
-+ platform_profile_notify();
-
- return count;
- }
-@@ -2144,6 +2168,94 @@ static ssize_t throttle_thermal_policy_store(struct device *dev,
- // Throttle thermal policy: 0 - default, 1 - overboost, 2 - silent
- static DEVICE_ATTR_RW(throttle_thermal_policy);
-
-+/* Platform profile ***********************************************************/
-+static int platform_profile_get(struct platform_profile_handler *pprof,
-+ enum platform_profile_option *profile)
-+{
-+ struct asus_wmi *asus;
-+ int tp;
-+
-+ asus = container_of(pprof, struct asus_wmi, platform_profile_handler);
-+
-+ tp = asus->throttle_thermal_policy_mode;
-+
-+ if (tp < 0)
-+ return tp;
-+
-+ switch (tp) {
-+ case ASUS_THROTTLE_THERMAL_POLICY_DEFAULT:
-+ *profile = PLATFORM_PROFILE_BALANCED;
-+ break;
-+ case ASUS_THROTTLE_THERMAL_POLICY_OVERBOOST:
-+ *profile = PLATFORM_PROFILE_PERFORMANCE;
-+ break;
-+ case ASUS_THROTTLE_THERMAL_POLICY_SILENT:
-+ *profile = PLATFORM_PROFILE_QUIET;
-+ break;
-+ default:
-+ return -EINVAL;
-+ }
-+
-+ return 0;
-+}
-+
-+static int platform_profile_set(struct platform_profile_handler *pprof,
-+ enum platform_profile_option profile)
-+{
-+ struct asus_wmi *asus;
-+ int tp;
-+
-+ asus = container_of(pprof, struct asus_wmi, platform_profile_handler);
-+
-+ switch (profile) {
-+ case PLATFORM_PROFILE_PERFORMANCE:
-+ tp = ASUS_THROTTLE_THERMAL_POLICY_OVERBOOST;
-+ break;
-+ case PLATFORM_PROFILE_BALANCED:
-+ tp = ASUS_THROTTLE_THERMAL_POLICY_DEFAULT;
-+ break;
-+ case PLATFORM_PROFILE_QUIET:
-+ tp = ASUS_THROTTLE_THERMAL_POLICY_SILENT;
-+ break;
-+ default:
-+ return -EOPNOTSUPP;
-+ }
-+
-+ asus->throttle_thermal_policy_mode = tp;
-+ return throttle_thermal_policy_write(asus);
-+}
-+
-+static int platform_profile_setup(struct asus_wmi *asus)
-+{
-+ struct device *dev = &asus->platform_device->dev;
-+ int err;
-+
-+ /*
-+ * Not an error if a component platform_profile relies on is unavailable
-+ * so early return, skipping the setup of platform_profile.
-+ */
-+ if (!asus->throttle_thermal_policy_available)
-+ return 0;
-+
-+ dev_info(dev, "Using throttle_thermal_policy for platform_profile support\n");
-+
-+ asus->platform_profile_handler.profile_get = platform_profile_get;
-+ asus->platform_profile_handler.profile_set = platform_profile_set;
-+
-+ set_bit(PLATFORM_PROFILE_QUIET, asus->platform_profile_handler.choices);
-+ set_bit(PLATFORM_PROFILE_BALANCED,
-+ asus->platform_profile_handler.choices);
-+ set_bit(PLATFORM_PROFILE_PERFORMANCE,
-+ asus->platform_profile_handler.choices);
-+
-+ err = platform_profile_register(&asus->platform_profile_handler);
-+ if (err)
-+ return err;
-+
-+ asus->platform_profile_support = true;
-+ return 0;
-+}
-+
- /* Backlight ******************************************************************/
-
- static int read_backlight_power(struct asus_wmi *asus)
-@@ -2904,6 +3016,10 @@ static int asus_wmi_add(struct platform_device *pdev)
- else
- throttle_thermal_policy_set_default(asus);
-
-+ err = platform_profile_setup(asus);
-+ if (err)
-+ goto fail_platform_profile_setup;
-+
- err = panel_od_check_present(asus);
- if (err)
- goto fail_panel_od;
-@@ -2993,6 +3109,9 @@ static int asus_wmi_add(struct platform_device *pdev)
- asus_wmi_sysfs_exit(asus->platform_device);
- fail_sysfs:
- fail_throttle_thermal_policy:
-+fail_platform_profile_setup:
-+ if (asus->platform_profile_support)
-+ platform_profile_remove();
- fail_fan_boost_mode:
- fail_egpu_enable:
- fail_dgpu_disable:
-@@ -3017,6 +3136,9 @@ static int asus_wmi_remove(struct platform_device *device)
- asus_fan_set_auto(asus);
- asus_wmi_battery_exit(asus);
-
-+ if (asus->platform_profile_support)
-+ platform_profile_remove();
-+
- kfree(asus);
- return 0;
- }
---
-2.31.1
-
diff --git a/xanmod-rog-config b/xanmod-rog-config
new file mode 100644
index 000000000000..13b1e0f0ff48
--- /dev/null
+++ b/xanmod-rog-config
@@ -0,0 +1,111 @@
+#!/bin/bash
+
+## Xanmod-ROG configuration script; this script is called during package creation and tunes kernel configuration
+## where we want to differ from upstream Xanmod
+
+## Any user customization should be done in $PKGDIR/myconfig or $HOME/.config/linux-xanmod-rog/myconfig; if either
+## of these scripts exists they'll be called during package build after this script ends
+
+## XXX: As this kernel package is primarily targeted at ASUS laptops we default to schedutil so the machine properly clocks down
+
+scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE \
+ --enable CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL
+
+## NOTE: s0ix debugging moved into PKGBUILD
+
+## asusctl/supergfxctl compatibility
+scripts/config --module CONFIG_VFIO_IOMMU_TYPE1 \
+ --module CONFIG_VFIO_VIRQFD \
+ --disable CONFIG_VFIO_NOIOMMU \
+ --module CONFIG_VFIO_PCI
+
+# package is throwing a warning re: lack of binutils support for this
+scripts/config --disable CONFIG_X86_X32
+
+# sync default hostname with Arch
+scripts/config --set-str CONFIG_DEFAULT_HOSTNAME archlinux
+
+# sync up BPF defaults with mainline
+scripts/config --enable CONFIG_BPF_PRELOAD \
+ --module CONFIG_BPF_PRELOAD_UMD \
+ --enable CONFIG_BPF_LSM #\
+ #--disable CONFIG_BPF_UNPRIV_DEFAULT_OFF
+
+# sync some settings with Arch:
+scripts/config --enable CONFIG_TASKS_RUDE_RCU \
+ --disable CONFIG_X86_MCELOG_LEGACY \
+ --enable CONFIG_X86_CPA_STATISTICS \
+ --module CONFIG_X86_PMEM_LEGACY \
+ --enable CONFIG_KPROBES_ON_FTRACE \
+ --enable CONFIG_UPROBES \
+ --enable CONFIG_LOCK_EVENT_COUNTS \
+ --enable CONFIG_MODULE_FORCE_LOAD \
+ --enable CONFIG_MODULE_FORCE_UNLOAD \
+ --enable CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS \
+ --enable CONFIG_BLK_DEV_THROTTLING_LOW \
+ --enable CONFIG_BLK_CGROUP_IOCOST \
+ --enable CONFIG_CMA \
+ --enable CONFIG_CMA_DEBUGFS \
+ --enable CONFIG_CMA_SYSFS \
+ --set-val CONFIG_CMA_AREAS 7 \
+ --enable CONFIG_ZSWAP_DEFAULT_ON \
+ --enable CONFIG_READ_ONLY_THP_FOR_FS \
+ --enable CONFIG_XFRM_SUB_POLICY \
+ --enable CONFIG_XFRM_MIGRATE \
+ --enable CONFIG_NET_KEY_MIGRATE \
+ --enable CONFIG_IPV6_OPTIMISTIC_DAD \
+ --enable CONFIG_IPV6_RPL_LWTUNNEL \
+ --enable CONFIG_NF_CONNTRACK_PROCFS \
+ --module CONFIG_NETFILTER_XT_TARGET_NOTRACK \
+ --disable CONFIG_DECNET \
+ --module CONFIG_IPDDP \
+ --enable CONFIG_IPDDP_ENCAP \
+ --disable CONFIG_X25 \
+ --disable CONFIG_LAPB
+
+scripts/config --enable CONFIG_TRACEPOINTS \
+ --disable CONFIG_IOSF_MBI_DEBUG \
+ --enable CONFIG_KVM_MMU_AUDIT \
+ --disable CONFIG_BLK_CMDLINE_PARSER \
+ --enable CONFIG_6LOWPAN_DEBUGFS \
+ --module CONFIG_6LOWPAN_GHC_EXT_HDR_HOP \
+ --module CONFIG_6LOWPAN_GHC_UDP \
+ --module CONFIG_6LOWPAN_GHC_ICMPV6 \
+ --module CONFIG_6LOWPAN_GHC_EXT_HDR_DEST \
+ --module CONFIG_6LOWPAN_GHC_EXT_HDR_FRAG \
+ --module CONFIG_6LOWPAN_GHC_EXT_HDR_ROUTE \
+ --enable CONFIG_IEEE802154_NL802154_EXPERIMENTAL \
+ --enable CONFIG_CLS_U32_PERF \
+ --module CONFIG_NET_ACT_IFE \
+ --enable CONFIG_BATMAN_ADV_BATMAN_V \
+ --enable CONFIG_CEPH_LIB_PRETTYDEBUG \
+ --module CONFIG_PCIEAER_INJECT \
+ --enable CONFIG_PCIE_ECRC \
+ --enable CONFIG_PCI_P2PDMA
+
+scripts/config --disable CONFIG_RAPIDIO \
+ --module CONFIG_CDROM \
+ --disable CONFIG_PARIDE \
+ --enable CONFIG_NVME_CORE \
+ --enable CONFIG_BLK_DEV_NVME \
+ --module CONFIG_FDDI \
+ --module CONFIG_PPP \
+ --module CONFIG_SLHC
+
+# larger kernel log buffer (256KB)
+scripts/config --set-val CONFIG_LOG_BUF_SHIFT 18
+# MSR as a module
+scripts/config --module CONFIG_X86_MSR
+# enable EFI var access
+scripts/config --module CONFIG_EFI_VARS
+# enable bluetooth high speed
+scripts/config --enable CONFIG_BT_HS
+# disable user event hooks
+scripts/config --disable CONFIG_UEVENT_HELPER
+scripts/config --disable CONFIG_FW_LOADER_USER_HELPER
+# enable scheduler autogrouping
+scripts/config --enable CONFIG_SCHED_AUTOGROUP_DEFAULT_ENABLED
+
+# enable multigen LRU by default
+#scripts/config --enable CONFIG_LRU_GEN_ENABLED # TODO: Not yet supported on 5.15
+