Skip to content

Commit d76034a

Browse files
clementperonSteven Price
authored andcommitted
drm/panfrost: devfreq: set opp to the recommended one to configure regulator
Enabling panfrost GPU OPP with dynamic regulator will make OPP responsible to enable and configure it. Unfortunately OPP configure and enable the regulator when an OPP is asked to be set, which is not the case during panfrost_devfreq_init(). This leave the regulator unconfigured and if no GPU load is triggered, no OPP is asked to be set which make the regulator framework switching it off during regulator_late_cleanup() without noticing and therefore make the board hang as any access to GPU memory space make bus locks up. Call dev_pm_opp_set_opp() with the recommend OPP in panfrost_devfreq_init() to enable the regulator, this will properly configure and enable the regulator and will avoid any switch off by regulator_late_cleanup(). Suggested-by: Viresh Kumar <[email protected]> Signed-off-by: Clément Péron <[email protected]> Reviewed-by: Steven Price <[email protected]> Signed-off-by: Steven Price <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent e3d3fd1 commit d76034a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/gpu/drm/panfrost/panfrost_devfreq.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,17 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev)
131131
return PTR_ERR(opp);
132132

133133
panfrost_devfreq_profile.initial_freq = cur_freq;
134+
135+
/*
136+
* Set the recommend OPP this will enable and configure the regulator
137+
* if any and will avoid a switch off by regulator_late_cleanup()
138+
*/
139+
ret = dev_pm_opp_set_opp(dev, opp);
140+
if (ret) {
141+
DRM_DEV_ERROR(dev, "Couldn't set recommended OPP\n");
142+
return ret;
143+
}
144+
134145
dev_pm_opp_put(opp);
135146

136147
/*

0 commit comments

Comments
 (0)