Thread (19 messages) 19 messages, 2 authors, 2022-02-24

Re: [PATCH v3 3/4] OPP: Add support of "opp-microwatt" for advanced EM registration

From: Lukasz Luba <lukasz.luba@arm.com>
Date: 2022-02-24 09:43:58
Also in: linux-pm, lkml


On 2/24/22 09:42, Viresh Kumar wrote:
On 24-02-22, 09:33, Lukasz Luba wrote:
quoted
On 2/24/22 09:13, Viresh Kumar wrote:
quoted
On 24-02-22, 08:11, Lukasz Luba wrote:
quoted
diff --git a/drivers/opp/of.c b/drivers/opp/of.c
quoted
quoted
quoted
+static bool _of_has_opp_microwatt_property(struct device *dev)
+{
+	unsigned long power, freq = 0;
+	struct dev_pm_opp *opp;
+
+	/* Check if at least one OPP has needed property */
+	opp = dev_pm_opp_find_freq_ceil(dev, &freq);
+	if (IS_ERR(opp))
+		return false;
+
+	power = dev_pm_opp_get_power(opp);
+	dev_pm_opp_put(opp);
+	if (!power)
Instead of this heavy stuff, just pick the first OPP from the opp
table and see its power-value.
It is the first opp: freq=0.
You mean by parsing the the DT node instead, like I had in v2 version?
No, I was thinking if you can simply do:

opp = list_first_entry(&opp_table->opp_list, struct dev_pm_opp, node);

But that requires locking, etc as well. So maybe this is fine.
  
OK, so I'll leave it as is now.

Thank you for the comments. I'll work on v4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help