Frogging-Family / linux-tkg

linux-tkg custom kernels
GNU General Public License v2.0
1.35k stars 170 forks source link

overdrive fix missing for 5.9 #48

Closed aufkrawall closed 4 years ago

aufkrawall commented 4 years ago

Hello, just dropping a note that the patch to fix overdrive with 5.9-rc1 still seems to be required, but _misc_adds="true" doesn't apply it.

Thanks!

Tk-Glitch commented 4 years ago

I haven't had much time to play with 5.9 yet :frog:

aufkrawall commented 4 years ago

The commits that caused it to break have been reverted.

aufkrawall commented 4 years ago

I was mistaken, we still need this patch for overdrive to work with 5.9: https://patchwork.freedesktop.org/patch/381849/

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index ebb8a28ff002..cbf623ff03bd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -778,12 +778,14 @@ static ssize_t amdgpu_set_pp_od_clk_voltage(struct device *dev,
        tmp_str++;
    while (isspace(*++tmp_str));

-   while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
+   while ((sub_str = strsep(&tmp_str, delimiter)) && *sub_str) {
        ret = kstrtol(sub_str, 0, &parameter[parameter_size]);
        if (ret)
            return -EINVAL;
        parameter_size++;

+       if (!tmp_str)
+           break;
        while (isspace(*tmp_str))
            tmp_str++;
    }
@@ -1635,11 +1637,14 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev,
            i++;
        memcpy(buf_cpy, buf, count-i);
        tmp_str = buf_cpy;
-       while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
+       while ((sub_str = strsep(&tmp_str, delimiter)) && *sub_str) {
            ret = kstrtol(sub_str, 0, &parameter[parameter_size]);
            if (ret)
                return -EINVAL;
            parameter_size++;
+
+           if (!tmp_str)
+               break;
            while (isspace(*tmp_str))
                tmp_str++;
        }
AdelKS commented 4 years ago

Can you enlighten me on what's "overdrive" ? Thank you !

aufkrawall commented 4 years ago

To allow overclocking/undervolting with amdgpu. It has regressed with 5.9 mainline vs. 5.8.

AdelKS commented 4 years ago

Oh I see! Thank you, I will need that too. I haven't tried overclocking yet on 5.9

terencode commented 4 years ago

The revert shouldn't be needed for 5.9.1 as it has been applied: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.9.y&id=ffdf9f8550ee675d4270bbaa5721a6f3116d137e