Skip to content

Commit e17a025

Browse files
enunesyuq
authored andcommitted
drm/lima: Fix opp clkname setting in case of missing regulator
Commit d8c32d3 ("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: d8c32d3 ("drm/lima: Migrate to dev_pm_opp_set_config()") Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Erico Nunes <[email protected]> Signed-off-by: Qiang Yu <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 4979524 commit e17a025

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

drivers/gpu/drm/lima/lima_devfreq.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,22 @@ int lima_devfreq_init(struct lima_device *ldev)
112112
unsigned long cur_freq;
113113
int ret;
114114
const char *regulator_names[] = { "mali", NULL };
115-
const char *clk_names[] = { "core", NULL };
116-
struct dev_pm_opp_config config = {
117-
.regulator_names = regulator_names,
118-
.clk_names = clk_names,
119-
};
120115

121116
if (!device_property_present(dev, "operating-points-v2"))
122117
/* Optional, continue without devfreq */
123118
return 0;
124119

125120
spin_lock_init(&ldevfreq->lock);
126121

127-
ret = devm_pm_opp_set_config(dev, &config);
122+
/*
123+
* clkname is set separately so it is not affected by the optional
124+
* regulator setting which may return error.
125+
*/
126+
ret = devm_pm_opp_set_clkname(dev, "core");
127+
if (ret)
128+
return ret;
129+
130+
ret = devm_pm_opp_set_regulators(dev, regulator_names);
128131
if (ret) {
129132
/* Continue if the optional regulator is missing */
130133
if (ret != -ENODEV)

0 commit comments

Comments
 (0)