Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions linux-cachyos-lts/.SRCINFO
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ pkgbase = linux-cachyos-lts
options = !lto
source = https://github.com/CachyOS/linux/releases/download/cachyos-6.18.21-1/cachyos-6.18.21-1.tar.gz
source = config
source = 0001-amdgpu-disable-securedisplay-ta-on-hp-elitebook-845-g7.patch
source = 0003-amdgpu-disable-s0ix-on-hp-elitebook-845-g7.patch
b2sums = 524902b34e87a4093972c52eefb0347935fe43623459694ac6d4d00481d45e301df9d0c8d3b7b709d4e50aa85162221b1361f8414adec2a0b9b7c9c545511057
b2sums = 81fafd3adcaf3b690d8d4791693e68c7ae921d103ebfd70e8d0ae15cd05ecde5e6672ae43c3a7875686d883c1f5b82d2c8b37b40aee8dcb0563913f9dd6469b6
b2sums = 1b527ff75886f16c880e64e3f3292713495acdfb328c730e4574f9f2aa82aa961b2358eebbaaca3bbf95b66f829d2f0f474e3e2cbb432056d6822e1aae5e3a84
b2sums = c1ea99b4cf24bc4b0860c1448374fd4004fe4be1d3428f843cc3f7df415c448e903679d5367068eb4f99fc9fe0e46b490f74c0b63b1d921102f7d06c7938f174

pkgname = linux-cachyos-lts
pkgdesc = The Linux BORE + Cachy Sauce Kernel by CachyOS with other patches and improvements - Long Term Service kernel and modules
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
--- a/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c
@@ -20,6 +20,7 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/

+#include <linux/dmi.h>
#include <linux/firmware.h>
#include <linux/module.h>
#include "amdgpu.h"
@@ -42,11 +43,28 @@
/* address block */
#define smnMP1_FIRMWARE_FLAGS 0x3010024

+static const struct dmi_system_id psp_v12_0_securedisplay_quirk_table[] = {
+ {
+ .matches = {
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook 845 G7"),
+ },
+ },
+ {}
+};
+
+static bool psp_v12_0_securedisplay_quirk_active(struct amdgpu_device *adev)
+{
+ return (adev->apu_flags & AMD_APU_IS_RENOIR) &&
+ dmi_first_match(psp_v12_0_securedisplay_quirk_table);
+}
+
static int psp_v12_0_init_microcode(struct psp_context *psp)
{
struct amdgpu_device *adev = psp->adev;
char ucode_prefix[30];
int err = 0;
+ bool disable_securedisplay;
DRM_DEBUG("\n");

amdgpu_ucode_ip_version_decode(adev, MP0_HWIP, ucode_prefix, sizeof(ucode_prefix));
@@ -59,9 +77,15 @@
if (err)
return err;

- /* only supported on renoir */
- if (!(adev->apu_flags & AMD_APU_IS_RENOIR))
+ /* SECUREDISPLAY is optional and known to break resume on some Renoir laptops. */
+ disable_securedisplay = !(adev->apu_flags & AMD_APU_IS_RENOIR) ||
+ psp_v12_0_securedisplay_quirk_active(adev);
+ if (disable_securedisplay) {
+ if (adev->apu_flags & AMD_APU_IS_RENOIR)
+ dev_info(adev->dev,
+ "PSP: disabling SECUREDISPLAY TA on HP EliteBook 845 G7\n");
adev->psp.securedisplay_context.context.bin_desc.size_bytes = 0;
+ adev->psp.hdcp_context.context.bin_desc.size_bytes = 0;
+ adev->psp.dtm_context.context.bin_desc.size_bytes = 0;
+ adev->psp.rap_context.context.bin_desc.size_bytes = 0;
+ }

return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -25,6 +25,7 @@
#include <linux/pci.h>
#include <linux/acpi.h>
#include <linux/backlight.h>
+#include <linux/dmi.h>
#include <linux/slab.h>
#include <linux/xarray.h>
#include <linux/power_supply.h>
@@ -1483,12 +1484,51 @@ void amdgpu_acpi_release(void)

#if IS_ENABLED(CONFIG_SUSPEND)
+
+/*
+ * Some Renoir laptops have broken GPU S0ix - the SoC hardware state machine
+ * deadlocks when the GPU driver performs its own suspend handling alongside
+ * the platform s2idle transition. On these systems we force S3-style full
+ * GPU suspend so all IP blocks are properly shut down before s2idle entry.
+ * The amd_pmc driver still handles the platform-level S0i3 transition.
+ */
+static const struct dmi_system_id amdgpu_s0ix_disable_quirk_table[] = {
+ {
+ .matches = {
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook 845 G7"),
+ },
+ },
+ {}
+};
+
/**
* amdgpu_acpi_is_s3_active
*
* @adev: amdgpu_device_pointer
*
* returns true if supported, false if not.
*/
bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev)
{
+ /*
+ * Force S3-style full GPU suspend on platforms where S0ix handling
+ * is broken. This ensures all IP blocks are properly shut down
+ * before the platform enters s2idle, giving SMU a clean state.
+ */
+ if ((adev->flags & AMD_IS_APU) &&
+ dmi_first_match(amdgpu_s0ix_disable_quirk_table)) {
+ dev_info_once(adev->dev,
+ "Forcing S3-style GPU suspend for s2idle due to platform quirk\n");
+ return true;
+ }
+
return !(adev->flags & AMD_IS_APU) ||
(pm_suspend_target_state == PM_SUSPEND_MEM);
}
@@ -1510,6 +1550,10 @@ bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev)
if (!(adev->pm.pp_feature & PP_GFXOFF_MASK))
return false;

+ /* Disable amdgpu S0ix on platforms with broken GPU suspend */
+ if (dmi_first_match(amdgpu_s0ix_disable_quirk_table))
+ return false;
+
/*
* If ACPI_FADT_LOW_POWER_S0 is not set in the FADT, it is generally
* risky to do any special firmware-related preparations for entering
8 changes: 6 additions & 2 deletions linux-cachyos-lts/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ _nv_pkg="NVIDIA-Linux-x86_64-${_nv_ver}"
_nv_open_pkg="NVIDIA-kernel-module-source-${_nv_ver}"
source=(
"https://github.com/CachyOS/linux/releases/download/${_srctag}/${_srctag}.tar.gz"
"config")
"config"
"0001-amdgpu-disable-securedisplay-ta-on-hp-elitebook-845-g7.patch"
"0003-amdgpu-disable-s0ix-on-hp-elitebook-845-g7.patch")

# LLVM makedepends
if _is_lto_kernel; then
Expand Down Expand Up @@ -732,4 +734,6 @@ for _p in "${pkgname[@]}"; do
done

b2sums=('524902b34e87a4093972c52eefb0347935fe43623459694ac6d4d00481d45e301df9d0c8d3b7b709d4e50aa85162221b1361f8414adec2a0b9b7c9c545511057'
'81fafd3adcaf3b690d8d4791693e68c7ae921d103ebfd70e8d0ae15cd05ecde5e6672ae43c3a7875686d883c1f5b82d2c8b37b40aee8dcb0563913f9dd6469b6')
'81fafd3adcaf3b690d8d4791693e68c7ae921d103ebfd70e8d0ae15cd05ecde5e6672ae43c3a7875686d883c1f5b82d2c8b37b40aee8dcb0563913f9dd6469b6'
'1b527ff75886f16c880e64e3f3292713495acdfb328c730e4574f9f2aa82aa961b2358eebbaaca3bbf95b66f829d2f0f474e3e2cbb432056d6822e1aae5e3a84'
'c1ea99b4cf24bc4b0860c1448374fd4004fe4be1d3428f843cc3f7df415c448e903679d5367068eb4f99fc9fe0e46b490f74c0b63b1d921102f7d06c7938f174')