Skip to content

Commit 043e8af

Browse files
larunbeSteven Price
authored andcommitted
drm/panfrost: Add missing OPP table refcnt decremental
Commit f11b041 ("drm/panfrost: Add fdinfo support GPU load metrics") retrieves the OPP for the maximum device clock frequency, but forgets to keep the reference count balanced by putting the returned OPP object. This eventually leads to an OPP core warning when removing the device. Fix it by putting OPP objects as many times as they're retrieved. Also remove an unnecessary whitespace. Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com> Fixes: f11b041 ("drm/panfrost: Add fdinfo support GPU load metrics") Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Steven Price <steven.price@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241105205458.1318989-1-adrian.larumbe@collabora.com
1 parent aadcf58 commit 043e8af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/panfrost/panfrost_devfreq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static int panfrost_devfreq_target(struct device *dev, unsigned long *freq,
3838
return PTR_ERR(opp);
3939
dev_pm_opp_put(opp);
4040

41-
err = dev_pm_opp_set_rate(dev, *freq);
41+
err = dev_pm_opp_set_rate(dev, *freq);
4242
if (!err)
4343
ptdev->pfdevfreq.current_frequency = *freq;
4444

@@ -182,6 +182,7 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev)
182182
* if any and will avoid a switch off by regulator_late_cleanup()
183183
*/
184184
ret = dev_pm_opp_set_opp(dev, opp);
185+
dev_pm_opp_put(opp);
185186
if (ret) {
186187
DRM_DEV_ERROR(dev, "Couldn't set recommended OPP\n");
187188
return ret;

0 commit comments

Comments
 (0)