How do i apply patch to kernel

Hi
I am using corectrl and faced an issue which should be solved by applying a patch to my kernel. Please read here.

i went through some forums and arch wiki page but my dumb ass didn't understand anything, so a detailed guide would be helpful that how can i patch my kernel with that file?

i tried patch -i /home/muza/Downloads/0001-drm-amdgpu-pm-fix-powerplay-OD-interface.patch
output:

can't find file to patch at input line 25
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|From 42791d8ca2eb407d178d3f269485b6eb6f119fba Mon Sep 17 00:00:00 2001
|From: Alex Deucher <[email protected]>
|Date: Tue, 23 Nov 2021 11:36:01 -0500
|Subject: [PATCH] drm/amdgpu/pm: fix powerplay OD interface
|
|The overclocking interface currently appends data to a
|string.  Revert back to using sprintf().
|
|Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1774
|Fixes: 6db0c87a0a8ee1 ("amdgpu/pm: Replace hwmgr smu usage of sprintf with sysfs_emit")
|Signed-off-by: Alex Deucher <[email protected]>
|---
| .../drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c  | 20 +++----
| .../drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c   | 24 ++++----
| .../drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c   |  6 +-
| .../drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c | 28 +++++----
| .../drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c | 10 ++--
| .../drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c | 58 +++++++++----------
| 6 files changed, 67 insertions(+), 79 deletions(-)
|
|diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c
|index 258c573acc97..1f406f21b452 100644
|--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c
|+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c
--------------------------
File to patch:

I don't think you can find better guidelines than those two mentioned in your link (update from a few minutes ago, anyway :slight_smile: ).
It is not easy, and seems to me not a blocking issue.
So, in my opinion, if you don't feel confident with this process, you'd better wait for the patch to get into a next kernel update hopefully.
It happened to me recently on 5.15.2. I had a minor issue for which a patch existed and was confirmed to be working, and luckily it entered in the very next kernel version 5.15.3, so it was only a matter of a few days.

5 Likes

waiting then :..: :slight_smile:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.