unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob d1abb419ea26a50075d94263d273f41edb9312a9 2031 bytes (raw)
name: gnu/packages/patches/amlogic-0012-FROMGIT-drm-lima-Fix-opp-clkname-setting-in-case-of-.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
 
From 7712306891a8e02c0253f4b6f68101cf4e567e3a Mon Sep 17 00:00:00 2001
From: Erico Nunes <nunes.erico@gmail.com>
Date: Fri, 18 Nov 2022 03:00:39 +0000
Subject: [PATCH 12/73] FROMGIT: drm/lima: Fix opp clkname setting in case of
 missing regulator

Commit d8c32d3971e4 ("drm/lima: Migrate to dev_pm_opp_set_config()")
introduced a regression as it may undo the clk_names setting in case
the optional regulator is missing. This resulted in test and performance
regressions with lima.

Restore the old behavior where clk_names is set separately so it is not
undone in case of a missing optional regulator.

Fixes: d8c32d3971e4 ("drm/lima: Migrate to dev_pm_opp_set_config()")
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/gpu/drm/lima/lima_devfreq.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/lima/lima_devfreq.c b/drivers/gpu/drm/lima/lima_devfreq.c
index 011be7ff51e1..bc8fb4e38d0a 100644
--- a/drivers/gpu/drm/lima/lima_devfreq.c
+++ b/drivers/gpu/drm/lima/lima_devfreq.c
@@ -112,11 +112,6 @@ int lima_devfreq_init(struct lima_device *ldev)
 	unsigned long cur_freq;
 	int ret;
 	const char *regulator_names[] = { "mali", NULL };
-	const char *clk_names[] = { "core", NULL };
-	struct dev_pm_opp_config config = {
-		.regulator_names = regulator_names,
-		.clk_names = clk_names,
-	};
 
 	if (!device_property_present(dev, "operating-points-v2"))
 		/* Optional, continue without devfreq */
@@ -124,7 +119,15 @@ int lima_devfreq_init(struct lima_device *ldev)
 
 	spin_lock_init(&ldevfreq->lock);
 
-	ret = devm_pm_opp_set_config(dev, &config);
+	/*
+	 * clkname is set separately so it is not affected by the optional
+	 * regulator setting which may return error.
+	 */
+	ret = devm_pm_opp_set_clkname(dev, "core");
+	if (ret)
+		return ret;
+
+	ret = devm_pm_opp_set_regulators(dev, regulator_names);
 	if (ret) {
 		/* Continue if the optional regulator is missing */
 		if (ret != -ENODEV)
-- 
2.17.1


debug log:

solving d1abb419ea ...
found d1abb419ea in https://yhetil.org/guix-patches/C2ORkCSHJz-4jxwCauZznk4tZlP9KS4u_3Ywe4q2QrfJ7tvIswRWw4vX6OuzXDIHRriNNTQaCiYC67GgL30p8g80J9OcduCgaoZ8XNf-amE=@protonmail.com/

applying [1/1] https://yhetil.org/guix-patches/C2ORkCSHJz-4jxwCauZznk4tZlP9KS4u_3Ywe4q2QrfJ7tvIswRWw4vX6OuzXDIHRriNNTQaCiYC67GgL30p8g80J9OcduCgaoZ8XNf-amE=@protonmail.com/
diff --git a/gnu/packages/patches/amlogic-0012-FROMGIT-drm-lima-Fix-opp-clkname-setting-in-case-of-.patch b/gnu/packages/patches/amlogic-0012-FROMGIT-drm-lima-Fix-opp-clkname-setting-in-case-of-.patch
new file mode 100644
index 0000000000..d1abb419ea

1:33: space before tab in indent.
 	unsigned long cur_freq;
1:34: space before tab in indent.
 	int ret;
1:35: space before tab in indent.
 	const char *regulator_names[] = { "mali", NULL };
1:41: trailing whitespace.
 
1:42: space before tab in indent.
 	if (!device_property_present(dev, "operating-points-v2"))
Checking patch gnu/packages/patches/amlogic-0012-FROMGIT-drm-lima-Fix-opp-clkname-setting-in-case-of-.patch...
Applied patch gnu/packages/patches/amlogic-0012-FROMGIT-drm-lima-Fix-opp-clkname-setting-in-case-of-.patch cleanly.
warning: squelched 9 whitespace errors
warning: 14 lines add whitespace errors.

index at:
100644 d1abb419ea26a50075d94263d273f41edb9312a9	gnu/packages/patches/amlogic-0012-FROMGIT-drm-lima-Fix-opp-clkname-setting-in-case-of-.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).