From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756749AbcILTFS (ORCPT ); Mon, 12 Sep 2016 15:05:18 -0400 Received: from mail-lf0-f43.google.com ([209.85.215.43]:33104 "EHLO mail-lf0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752340AbcILTFN (ORCPT ); Mon, 12 Sep 2016 15:05:13 -0400 From: Felipe Balbi To: Guenter Roeck Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Question about suspend/resume clock handling in dwc3-of-simple.c In-Reply-To: <20160912185629.GA25929@roeck-us.net> References: <20160912185629.GA25929@roeck-us.net> User-Agent: Notmuch/0.22+58~g3a45d29 (https://notmuchmail.org) Emacs/25.1.2 (x86_64-pc-linux-gnu) Date: Mon, 12 Sep 2016 22:05:00 +0300 Message-ID: <87wpihaqhv.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Guenter, Guenter Roeck writes: > Hi folks, > > In dwc3-of-simple.c:dwc3_of_simple_remove(), I see the following code. > > for (i =3D 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=3Dlinux-usb&m=3D147343692631868&w=3D2 > 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. ;-) =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJX1vxcAAoJEMy+uJnhGpkGW/cQAJnsjHIgsKZnIoffCF5o9+m5 2ExGkheBf6YBtBVlfX5GDpYqoFbN7LSLruyJGC+7TOaYG8gbBEM8pRdlRN3Xnjzt IMDxfWGg78dulyxa5D6Kky4bfSAWiZTo3hmT+FAZsn66RhIxq09rPMH/Gzij9aBu /7aapczLPu9J8+07HznXBE9NuvY1bW5e7nh8h5tgVLrXNs5lU2MHTN78de/ozHbl NDsFj2ClKtRd94mJlBc0G34KYI/JxpMurcgFYvfdiPTdBSo1y987uxH0mqp5xwbA 7tsT9mdJTVX6nRWpPRr9XOp7GXKyOIt+O0BOxEXxe7zwtV1tSqKSx9tWvHgMI90w B3Jpe6F+1Lt9C4EQKrexnK8z+W3cpTb72X/q131XskguFgQK6rUak3ZAQBAb8Bpj 7fV4InVrWgryvOBL6feXewsnv12OyoIXM488sd/Sev1TFfOxEc8NBWZfhNetamLO DIaoEjIGjDTtczCRDpMtYXHESZQcvpJF9Iu2+h01kViIA4FBGN6rAmaFzuIDbXSp JmJlerbwOrRUUEWqaTlv4d4DJapqQvu47VZ61p2wH0PitDzwFXGKQC+OLqml880S 9XYUBzkTLsySr1rR6No06/C8Yv5KCQ5YD0tlbyZCUCM0Awp4gGbWesF5MDQQzmc2 VvJIaDT6o2J4jOzcLka7 =x8Hl -----END PGP SIGNATURE----- --=-=-=--