Thread (11 messages) flat view 11 messages, 4 authors, 2020-02-26

Re: [PATCH v3 4/4] drm/panfrost: Register to the Energy Model with devfreq device

From: Robin Murphy <robin.murphy@arm.com>
Date: 2020-02-26 13:56:15
Also in: dri-devel, linux-mediatek

On 26/02/2020 10:06 am, Lukasz Luba wrote:
[...]
quoted
quoted
@@ -118,6 +120,7 @@ void panfrost_devfreq_fini(struct panfrost_device 
*pfdev)
  {
         if (pfdev->devfreq.cooling)
                 devfreq_cooling_unregister(pfdev->devfreq.cooling);
+       dev_pm_opp_of_unregister_em(&pfdev->pdev->dev);
         dev_pm_opp_of_remove_table(&pfdev->pdev->dev);
Does it make sense to keep this (and the registration side) as
separate calls? Perhaps there's some ordering requirement with
everything between dev_pm_opp_of_add_table() and
dev_pm_opp_of_register_em()?
Yes, dev_pm_opp_of_register_em() uses em_data_callback which operates
on OPPs to calculate power values and costs, so the the OPP table should
be already there.
quoted
While you're just adding 2 lines, it seems there's a lot of complexity
exposed to the driver just to initialize devfreq/opp.
It depends, for example devfreq devices like buses would likely never
use the energy model. Potential clients would be GPUs, DSPs, ISPs.
Still, it seems less than ideal for every client to have to remember to 
make all these individual calls, all in the right order (especially when 
it comes to undoing them in failure paths).

I haven't quite grasped whether the energy model is conceptually "owned" 
by the OPP table or by the cooling device, but either way it would seem 
to be a much nicer API if there were simply an additional "with energy 
model" variant of the registration call, and the standard removal call 
just automatically cleaned up an energy model as well if one was present.

Robin.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help