lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87wpihaqhv.fsf@linux.intel.com>
Date:   Mon, 12 Sep 2016 22:05:00 +0300
From:   Felipe Balbi <balbi@...nel.org>
To:     Guenter Roeck <linux@...ck-us.net>
Cc:     linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: Question about suspend/resume clock handling in dwc3-of-simple.c


Hi Guenter,

Guenter Roeck <linux@...ck-us.net> writes:
> 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().

good eyes :-) That was fixed though:

https://marc.info/?l=linux-usb&m=147343692631868&w=2

> Should it be clk_disable_unprepare(), or maybe something like the
> following
>
> 	if (!pm_runtime_status_suspended(dev))
> 		clk_disable_unprepare();
> 	else
> 		clk_unprepare();

I'm not sure how balanced those calls are, yeah. I don't have HW to test
PM with. But note that as it is, there is no actual runtime PM support,
so clk_disable_unprepare() will always be necessary.

Perhaps we will find further issues when someone tries to use runtime PM
with dwc3-of-simple. ;-)

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (801 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ