From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751121AbdAWLpu (ORCPT ); Mon, 23 Jan 2017 06:45:50 -0500 Received: from mga04.intel.com ([192.55.52.120]:53253 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751034AbdAWLpt (ORCPT ); Mon, 23 Jan 2017 06:45:49 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,274,1477983600"; d="asc'?scan'208";a="1116550368" From: Felipe Balbi To: Richard Genoud , Huang Rui , Heikki Krogerus Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [BISSECTED]: BUG: usb: dwc3: usb ports not working anymore on odroid-XU4 In-Reply-To: References: <1f6ae153-1033-b3cb-614f-489b2e3d6b34@gmail.com> <87fukfjx2x.fsf@linux.intel.com> Date: Mon, 23 Jan 2017 13:45:24 +0200 Message-ID: <87shoa6luz.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, Richard Genoud writes: > On 19/01/2017 09:03, Felipe Balbi wrote: >>=20 >> Hi, >>=20 >> Richard Genoud writes: >>> Hi, >>> Since commit c499ff71ff2a2 ("usb: dwc3: core: re-factor init and exit p= aths") >>> (merged in 4.8), the usb ports on odroid-XU4 don't work anymore. >>> >>> [ Actually, it's commit 2164a476205ccc ("usb: dwc3: set SUSPHY bit for = all cores"), cf below ] >>> >>> Inserting an usb key (USB2.0) on the USB3.0 port result in: >>> [ 64.488264] xhci-hcd xhci-hcd.2.auto: Port resume took longer than 2= 0000 msec, port status =3D 0xc400fe3 >>> [ 74.568156] xhci-hcd xhci-hcd.2.auto: xHCI host not responding to st= op endpoint command. >>> [ 74.574806] xhci-hcd xhci-hcd.2.auto: Assuming host is dying, haltin= g host. >>> [ 74.601970] xhci-hcd xhci-hcd.2.auto: HC died; cleaning up >>> [ 74.606276] usb 3-1: USB disconnect, device number 2 >>> [ 74.613565] usb 4-1: USB disconnect, device number 2 >>> [ 74.621208] usb usb3-port1: couldn't allocate usb_device >>> NB: it's not related to USB2.0 devices, I get the same result with an U= SB3.0 device (SATA to USB3 for instance). >>> NB2: it doesn't happen on an odriod-XU3 board, that doesn't have the re= altek RTL8153 chip. >>> >>> I instrumented what was read/written in the registers before and after = this patch, and I found that the culprit is: >>> if (dwc->revision > DWC3_REVISION_194A) >>> reg |=3D DWC3_GUSB3PIPECTL_SUSPHY; >>> Before commit c499ff71ff2a2 ("usb: dwc3: core: re-factor init and exit = paths"), dwc3_phy_setup() was >>> done early in dwc3_probe() and thus, dwc->revision wasn't set yet (=3D= =3D0) >>> After this commit, dwc3_phy_setup() is done in dwc3_core_init(), after = setting dwc->revision (it's done in dwc3_core_is_valid()). >>> >>> (The dwc3->revision on odroid-XU4 is 5533200a.) >>> >>> If I comment out the 2 lines: >>> if (dwc->revision > DWC3_REVISION_194A) >>> reg |=3D DWC3_GUSB3PIPECTL_SUSPHY; >>> The usb key is recognized right away: >>> [ 38.008158] usb 3-1.2: new high-speed USB device number 3 using xhci= -hcd >>> [ 38.138924] usb 3-1.2: New USB device found, idVendor=3Dabcd, idProd= uct=3D1234 >>> [ 38.144399] usb 3-1.2: New USB device strings: Mfr=3D1, Product=3D2,= SerialNumber=3D3 >>> >>> I took a look at the history behind those 2 lines, and they've been int= roduced by: >>> commit 2164a476205ccc ("usb: dwc3: set SUSPHY bit for all cores") in 3.= 19. >>> In 3.19, the dwc->revision dwc3_phy_setup() was set in dwc3_core_init(). >>> And, booting a 3.19 kernel on XU4 gives the same error (whereas booting= a 3.18 kernel is ok) >>> >>> [ So, I should have started this email with: >>> Since commit 2164a476205ccc ("usb: dwc3: set SUSPHY bit for all cores"), >>> the usb ports on odroid-XU4 don't work anymore. ] >>> >>> The funny thing is that commit 45bb7de213d8("usb: dwc3: setup phys earl= ier") (merged in 4.2) >>> moved dwc3_phy_setup() in dwc3_probe(), way before dwc->revision was se= t, acting like a revert >>> on commit 2164a476205c("usb: dwc3: set SUSPHY bit for all cores") >>> That's why on 4.2, inserting an USB key on odroid-XU4 worked again, >>> >>> So, to make a resume: >>> xxx-> 3.18: usb ok >>> 3.19->4.1: usb error (due to commit 2164a476205ccc ("usb: dwc3: set SUS= PHY bit for all cores")) >>> 4.2->4.7: usb ok (due to commit 45bb7de213d8("usb: dwc3: setup phys ear= lier")) >>> 4.8->now: usb error (due to commit c499ff71ff2a2 ("usb: dwc3: core: re-= factor init and exit paths")) >>> >>> >>> any idea on this ? >>=20 >> Thanks for bisecting. This could be caused by a similar case as >> described at [1]. Can you check if adding quirk >> "snps,dis_u3_susphy_quirk" helps ? >>=20 >> [1] https://marc.info/?i=3D2B3535C5ECE8B5419E3ECBE300772909021B3FD37E@US= 01WEMBX2.internal.synopsys.com >>=20 > Thanks for your quick answer ! > > yes, adding this patch: > > diff --git a/arch/arm/boot/dts/exynos5422-odroidxu4.dts b/arch/arm/boot/d= ts/exynos5422-odroidxu4.dts > index 2faf88627a48..c76e76bc9ade 100644 > --- a/arch/arm/boot/dts/exynos5422-odroidxu4.dts > +++ b/arch/arm/boot/dts/exynos5422-odroidxu4.dts > @@ -43,6 +43,9 @@ > status =3D "okay"; > }; >=20=20 > +&usbdrd_dwc3_0 { > + snps,dis_u3_susphy_quirk; > +}; > &usbdrd_dwc3_1 { > dr_mode =3D "host"; > }; > > removes the error "Port resume took longer than 20000 msec, port > status =3D 0xc400fe3" and the USB devices are detected. okay great. Temporarily, you can probably push a patch doing that to your DTS. At least you're gonna have things working until we understand what's going on with DWC3. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAliF7NQACgkQzL64meEa mQbzOBAA3ry/nkQq6Qggas4B7pNtfaOrRreep8TvSljxbDLX/sMt9pKp20q4vO97 SSFGp42RjroVTqF6bYS1R4wCBHiSMzzt8SdTwlB7m34gBTtn5vdruSBwG51TCGby wTcO5N2qj1CyR2HkKuzG/ULpCKsit18ZsX4WkTsict/RqkFISWNRDwLTE4nW8VnR SO8kDbcto7Tz1wx36c4q8e5EVt9rFaJuB6ccqStX/Cu2uGzcmQFIRpfhq8kPEa2a Zo63vQjaynfB3K1mm8X/7fqlNYyRASw4tHVR+Ai87aX3z1xJbAsAjz++pu2lKrIA DRi/TbhheiilhDf25C9x1XrKzJtkFBwVqdDA+/Sw+Suyh751qO7KGbKyLg0A+k3X jnNpZbEBgQtLydcReD5cFeLdybnwOqqtA2u5xMFXLh4Ge+rfqMOQ4VGBaEVCMQYe Hs0etT9Wv44exwF3D86u3Q5NbzUWrsD+tmbNGzHAKM11uL2eN0C3+AI627LcBl5b tlapHNUL39bGptvxsdQiyauCw19sxghylcvh74Y4WpH/J+hDI5EGy2cri4zRdkoj nd6aH6jqrtfjqQZSgBAaXReMKHUo5VvhEk1yKuXJYHwRzGzGWf8xR24ZgKBdq2/V x+x0YVSrdQOC1HdRCPf+V2TGjU8cnirk0GcYdx6mSanh7LomnL8= =WRwF -----END PGP SIGNATURE----- --=-=-=--