From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Felipe Balbi To: Roger Quadros Cc: vigneshr@ti.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, "linux-stable # \= v4 . 13" Subject: Re: [PATCH] usb: dwc3: core: Don't try to get PHYs during suspend/resume In-Reply-To: <327eac7d-80e2-bbd6-4fb4-98d947335698@ti.com> References: <1515589914-23460-1-git-send-email-rogerq@ti.com> <0c2c7e45-9324-316a-d44b-dd17a3a2c68b@ti.com> <87373dzvmi.fsf@linux.intel.com> <327eac7d-80e2-bbd6-4fb4-98d947335698@ti.com> Date: Wed, 10 Jan 2018 16:04:15 +0200 Message-ID: <87wp0pyfmo.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Roger Quadros writes: >> Roger Quadros writes: >>> Felipe, >>> >>> On 10/01/18 15:11, Roger Quadros wrote: >>>> The USB PHYs should be requested only once during the life cycle of >>>> this driver. >>>> >>>> As dwc3_core_init() is called during system suspend/resume >>>> it will result in multiple calls to dwc3_core_get_phy() which is wrong. >>>> >>>> To prevent that let's move dwc3_core_get_phy() call >>>> outside dwc3_core_init(). >>>> >>>> Fixes: 541768b08a4 ("usb: dwc3: core: Call dwc3_core_get_phy() before = initializing phys") >>>> Cc: linux-stable # >=3D v4.13 >>>> Signed-off-by: Roger Quadros >>> >>> FYI. this patch brings the code back to >>> revert 541768b08a40 ("usb: dwc3: core: Call dwc3_core_get_phy() before = initializing phys") >>> revert f54edb539c11 ("usb: dwc3: core: initialize ULPI before trying to= get the PHY") >>> >>> So looks like this will break ULPI PHY case? >>> >>> Where do we initialize ULPI PHY, in dwc3_phy_setup()? >>> >>> if so then 541768b08a40 breaks the ULPI PHY case as well, right? >>=20 >> indeed, that commit regressed ULPI PHYs :-( >>=20 >> Seems like it should be more like below: >>=20 >> @@ -754,15 +754,15 @@ static int dwc3_core_init(struct dwc3 *dwc) >> dwc->maximum_speed =3D USB_SPEED_HIGH; >> } >>=20=20 >> - ret =3D dwc3_core_get_phy(dwc); >> + ret =3D dwc3_phy_setup(dwc); > > But can we do a dwc3_phy_setup() without doing the soft reset of the cont= roller first? as long as clocks are running, we can do that, yes. >> - ret =3D dwc3_core_soft_reset(dwc); >> + ret =3D dwc3_core_get_phy(dwc); > > we can get_phy in dwc3_core_init() as it will get called on resume(). > This was the $subject of this patch. indeed. thanks :-) =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAlpWHV8ACgkQzL64meEa mQYjvA/+PFB411cF2zuxOO9JnIvX43hBDkNLwZAQpjLddP+EHgg49/lvMxawZNWx zLO02qAxvUMs+TR0YO8VeakgCnU8bVD/KNFBv3fTz0qxNXd0IvsF7/DHjuHslzmm eMw6+cvhjWF7mJ0UpU6Urvfx6fnzieBs9v72KUa5MWWA11um8eMwzNl20AgabDkD 5and2dVileBB+COabXxlQSs0HsC5WkW/gstT8XKBrpVznsj+PgUqnohSvK8AHAS/ d0caMTNWYnam0ilZMqwYEARqajkuLZD6RDxtGL+xf9ahLS9C6L4lbFgPQX9wdq2v jG4z/H4cDs4vOcJuBXMhvr5+VpyZa2EvY+qoidzQf+PsRfOmxZwpZS1SoqOaPwL/ 8fUvnePi57J+B72T8A/Bx7SU/9HW9QeeHrIPpcN6anIlPysHOdHMf8jDDMoQs0I/ 55T5heFGoJA3zZHqA7dHdriXaqrr4SFZO5mBYTLL5ULtlUEbqABxbJ+EUUr3x5rE O57EBw/Z/zl0Y2osuRSrloUmrxfH6yfacQF5nwJtf4qZDCMlm+Im7so0lOIOUvGR RH1zJrHIiyhnAKm6dV0pPb2HY2UJsobCc/xz1pvV+BDwYWApjXBNBHBMVcaVhH3v +QJLhKS5O8EWGeg71tx7yiuz1T5AHp8oQs9AXurchsTHhbvXZ70= =9AXJ -----END PGP SIGNATURE----- --=-=-=--