public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Question about suspend/resume clock handling in dwc3-of-simple.c
@ 2016-09-12 18:56 Guenter Roeck
  2016-09-12 19:05 ` Felipe Balbi
  0 siblings, 1 reply; 6+ messages in thread
From: Guenter Roeck @ 2016-09-12 18:56 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: linux-usb, linux-kernel

Hi folks,

In dwc3-of-simple.c:dwc3_of_simple_remove(), I see the following code.

	for (i = 0; i < simple->num_clocks; i++) {
                clk_unprepare(simple->clks[i]);
		clk_put(simple->clks[i]);
	}

What I don't understand is why clk_unprepare() is called instead
of clk_disable_unprepare(). Someone told me that it was due to
dwc3_of_simple_runtime_suspend(), which would call clk_disable().

That doesn't really make sense to me, since after all CONFIG_PM
can be disabled.

Should it be clk_disable_unprepare(), or maybe something like the
following

	if (!pm_runtime_status_suspended(dev))
		clk_disable_unprepare();
	else
		clk_unprepare();

or am I missing something ?

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-09-13 14:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-12 18:56 Question about suspend/resume clock handling in dwc3-of-simple.c Guenter Roeck
2016-09-12 19:05 ` Felipe Balbi
2016-09-12 19:43   ` Guenter Roeck
2016-09-13  5:35     ` Felipe Balbi
2016-09-13 13:10       ` Guenter Roeck
2016-09-13 14:05         ` Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox