From a3c869423db54cfb853cd0cba8c3e10ffef41b1b Mon Sep 17 00:00:00 2001 From: Tk-Glitch Date: Fri, 31 Jul 2020 23:34:13 +0200 Subject: [PATCH] linux57/58-tkg: Add a reverting patch to restore amdgpu overdrive functionality, which has regressed recently. https://gitlab.freedesktop.org/drm/amd/-/issues/1243 --- linux57-tkg/PKGBUILD | 2 +- .../0012-misc-additions.patch | 35 +++++++++++++++++++ linux58-rc-tkg/PKGBUILD | 2 +- .../0012-misc-additions.patch | 35 +++++++++++++++++++ 4 files changed, 72 insertions(+), 2 deletions(-) diff --git a/linux57-tkg/PKGBUILD b/linux57-tkg/PKGBUILD index d71424d..0144840 100644 --- a/linux57-tkg/PKGBUILD +++ b/linux57-tkg/PKGBUILD @@ -151,7 +151,7 @@ sha256sums=('de8163bb62f822d84f7a3983574ec460060bf013a78ff79cd7c979ff1ec1d7e0' 'b2a2ae866fc3f1093f67e69ba59738827e336b8f800fb0487599127f7f3ef881' '49262ce4a8089fa70275aad742fc914baa28d9c384f710c9a62f64796d13e104' '6821f92bd2bde3a3938d17b070d70f18a2f33cae81647567b5a4d94c9cd75f3d' - '78b6d2c1ca0e2bb16619194bc8909903199c259739ecfcfdf5d0965baa8d54a6') + 'b9f724ada90bc7c87c77429278ddbe20cfcbd768bd3cb1e1c132a0f1eda3625f') export KBUILD_BUILD_HOST=archlinux export KBUILD_BUILD_USER=$pkgbase diff --git a/linux57-tkg/linux57-tkg-patches/0012-misc-additions.patch b/linux57-tkg/linux57-tkg-patches/0012-misc-additions.patch index 5c01f24..acad1a2 100644 --- a/linux57-tkg/linux57-tkg-patches/0012-misc-additions.patch +++ b/linux57-tkg/linux57-tkg-patches/0012-misc-additions.patch @@ -104,3 +104,38 @@ index 86ffa0c2880f..710edc70e37e 100644 + } } } + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +index 02e6f8c4dde0..ebb8a28ff002 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +@@ -778,7 +778,8 @@ 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 (tmp_str[0]) { ++ sub_str = strsep(&tmp_str, delimiter); + ret = kstrtol(sub_str, 0, ¶meter[parameter_size]); + if (ret) + return -EINVAL; +@@ -1038,7 +1039,8 @@ static ssize_t amdgpu_read_mask(const char *buf, size_t count, uint32_t *mask) + memcpy(buf_cpy, buf, bytes); + buf_cpy[bytes] = '\0'; + tmp = buf_cpy; +- while ((sub_str = strsep(&tmp, delimiter)) != NULL) { ++ while (tmp[0]) { ++ sub_str = strsep(&tmp, delimiter); + if (strlen(sub_str)) { + ret = kstrtol(sub_str, 0, &level); + if (ret) +@@ -1635,7 +1637,8 @@ 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 (tmp_str[0]) { ++ sub_str = strsep(&tmp_str, delimiter); + ret = kstrtol(sub_str, 0, ¶meter[parameter_size]); + if (ret) + return -EINVAL; diff --git a/linux58-rc-tkg/PKGBUILD b/linux58-rc-tkg/PKGBUILD index 825b7c5..ac5dfee 100644 --- a/linux58-rc-tkg/PKGBUILD +++ b/linux58-rc-tkg/PKGBUILD @@ -135,7 +135,7 @@ sha256sums=('ace7c02ad8577c8fc19b2e6b5d0aeeee06721511527bc38dd975b2c56982ccec' '19661ec0d39f9663452b34433214c755179894528bf73a42f6ba52ccf572832a' 'cd225e86d72eaf6c31ef3d7b20df397f4cc44ddd04389850691292cdf292b204' '49262ce4a8089fa70275aad742fc914baa28d9c384f710c9a62f64796d13e104' - '78b6d2c1ca0e2bb16619194bc8909903199c259739ecfcfdf5d0965baa8d54a6') + 'b9f724ada90bc7c87c77429278ddbe20cfcbd768bd3cb1e1c132a0f1eda3625f') export KBUILD_BUILD_HOST=archlinux export KBUILD_BUILD_USER=$pkgbase diff --git a/linux58-rc-tkg/linux58-tkg-patches/0012-misc-additions.patch b/linux58-rc-tkg/linux58-tkg-patches/0012-misc-additions.patch index 5c01f24..acad1a2 100644 --- a/linux58-rc-tkg/linux58-tkg-patches/0012-misc-additions.patch +++ b/linux58-rc-tkg/linux58-tkg-patches/0012-misc-additions.patch @@ -104,3 +104,38 @@ index 86ffa0c2880f..710edc70e37e 100644 + } } } + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +index 02e6f8c4dde0..ebb8a28ff002 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +@@ -778,7 +778,8 @@ 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 (tmp_str[0]) { ++ sub_str = strsep(&tmp_str, delimiter); + ret = kstrtol(sub_str, 0, ¶meter[parameter_size]); + if (ret) + return -EINVAL; +@@ -1038,7 +1039,8 @@ static ssize_t amdgpu_read_mask(const char *buf, size_t count, uint32_t *mask) + memcpy(buf_cpy, buf, bytes); + buf_cpy[bytes] = '\0'; + tmp = buf_cpy; +- while ((sub_str = strsep(&tmp, delimiter)) != NULL) { ++ while (tmp[0]) { ++ sub_str = strsep(&tmp, delimiter); + if (strlen(sub_str)) { + ret = kstrtol(sub_str, 0, &level); + if (ret) +@@ -1635,7 +1637,8 @@ 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 (tmp_str[0]) { ++ sub_str = strsep(&tmp_str, delimiter); + ret = kstrtol(sub_str, 0, ¶meter[parameter_size]); + if (ret) + return -EINVAL;