Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1481847

Question about suspend/resume clock handling in dwc3-of-simple.c

From Guenter Roeck <linux@roeck-us.net>
Newsgroups linux.kernel
Subject Question about suspend/resume clock handling in dwc3-of-simple.c
Date 2016-09-12 21:00 +0200
Message-ID <sgECu-7at-43@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Question about suspend/resume clock handling in dwc3-of-simple.c Guenter Roeck <linux@roeck-us.net> - 2016-09-12 21:00 +0200
  Re: Question about suspend/resume clock handling in dwc3-of-simple.c Felipe Balbi <balbi@kernel.org> - 2016-09-12 21:10 +0200
    Re: Question about suspend/resume clock handling in dwc3-of-simple.c Guenter Roeck <linux@roeck-us.net> - 2016-09-12 21:50 +0200
      Re: Question about suspend/resume clock handling in dwc3-of-simple.c Felipe Balbi <balbi@kernel.org> - 2016-09-13 07:40 +0200
        Re: Question about suspend/resume clock handling in dwc3-of-simple.c Guenter Roeck <linux@roeck-us.net> - 2016-09-13 15:20 +0200
          Re: Question about suspend/resume clock handling in dwc3-of-simple.c Felipe Balbi <balbi@kernel.org> - 2016-09-13 16:10 +0200

csiph-web