Thread (119 messages) 119 messages, 7 authors, 2021-08-26

Re: [PATCH v8 01/34] opp: Add dev_pm_opp_sync() helper

From: Dmitry Osipenko <digetx@gmail.com>
Date: 2021-08-18 04:12:12
Also in: dri-devel, linux-clk, linux-media, linux-mmc, linux-pm, linux-pwm, linux-spi, linux-staging, linux-tegra, linux-usb, lkml

18.08.2021 06:55, Viresh Kumar пишет:
On 17-08-21, 18:49, Dmitry Osipenko wrote:
quoted
17.08.2021 10:55, Viresh Kumar пишет:
...
quoted
quoted
+int dev_pm_opp_sync(struct device *dev)
+{
+	struct opp_table *opp_table;
+	struct dev_pm_opp *opp;
+	int ret = 0;
+
+	/* Device may not have OPP table */
+	opp_table = _find_opp_table(dev);
+	if (IS_ERR(opp_table))
+		return 0;
+
+	if (!_get_opp_count(opp_table))
+		goto put_table;
+
+	opp = _find_current_opp(dev, opp_table);
+	ret = _set_opp(dev, opp_table, opp, opp->rate);
And I am not sure how this will end up working, since new OPP will be
equal to old one. Since I see you call this from resume() at many
places.
Initially OPP table is "uninitialized" and opp_table->enabled=false,
hence the first sync always works even if OPP is equal to old one. Once
OPP has been synced, all further syncs are NO-OPs, hence it doesn't
matter how many times syncing is called.

https://elixir.bootlin.com/linux/v5.14-rc6/source/drivers/opp/core.c#L1012
Right, but how will this work from Resume ? Won't that be a no-op ?
The first resume initializes the OPP state on sync, all further syncs on
resume are no-ops.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help