From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 043F8C64EC4 for ; Fri, 3 Mar 2023 10:26:59 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C48A785D08; Fri, 3 Mar 2023 11:26:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinet.cat Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 79DB085D05; Fri, 3 Mar 2023 11:26:55 +0100 (CET) Received: from mx1.tinet.cat (mx1.dipta.cat [195.76.233.59]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5449085D1A for ; Fri, 3 Mar 2023 11:26:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinet.cat Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xdrudis@tinet.cat X-ASG-Debug-ID: 1677839206-12aaf2051109d00001-4l7tJC Received: from smtp01.tinet.cat (smtp01.tinet.org [195.77.216.131]) by mx1.tinet.cat with ESMTP id fyBzVWBXLtRoLmbO; Fri, 03 Mar 2023 11:26:46 +0100 (CET) X-Barracuda-Envelope-From: xdrudis@tinet.cat X-Barracuda-Effective-Source-IP: smtp01.tinet.org[195.77.216.131] X-Barracuda-Apparent-Source-IP: 195.77.216.131 Received: from xdrudis.tinet.cat (9.red-79-152-187.dynamicip.rima-tde.net [79.152.187.9]) by smtp01.tinet.cat (Postfix) with ESMTPSA id B0B52605D0AC; Fri, 3 Mar 2023 11:26:46 +0100 (CET) Date: Fri, 3 Mar 2023 11:26:45 +0100 From: Xavier Drudis Ferran To: Christoph Fritz Cc: Xavier Drudis Ferran , u-boot@lists.denx.de, Simon Glass , Philipp Tomsich , Kever Yang , Lukasz Majewski , Sean Anderson , Marek Vasut Subject: Re: [PATCH v5 0/2] arm: dts: rockchip: rk3399: usb: ehci: Fix EHCI probe in rk3399 to access peripherals by USB 2. Message-ID: X-ASG-Orig-Subj: Re: [PATCH v5 0/2] arm: dts: rockchip: rk3399: usb: ehci: Fix EHCI probe in rk3399 to access peripherals by USB 2. References: <5d158190ee4e5da9e34b377331da338af6223eef.camel@googlemail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5d158190ee4e5da9e34b377331da338af6223eef.camel@googlemail.com> X-Barracuda-Connect: smtp01.tinet.org[195.77.216.131] X-Barracuda-Start-Time: 1677839206 X-Barracuda-URL: https://webmail.tinet.cat:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 4822 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=6.0 KILL_LEVEL=8.0 tests=DRUGS_MUSCLE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.105514 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 DRUGS_MUSCLE Refers to a muscle relaxant X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean El Fri, Mar 03, 2023 at 10:42:20AM +0100, Christoph Fritz deia: > >    Changes: > > > >    v5: fixes a bug that Christoph Fritz discovered, consisting in the > >        wrong eror code returned when enabling or disabling the clock > >        because property_enable() returns an error code in linux but > >        the modified register value in U-Boot. This caused the clk > >        disable to abort before freeing the clock and it apparently > >        left things bad enough to cause a hang or a reset. > > > > With your patches ontop of v2023.04-rc2, xhci works now fine on a > rk3399 board: > Fine, thanks a lot for testing. I thought the problem was with EHCI. > Totally unrelated to your patches, stopping usb still crashes (with or > without your patch) but only when a USB-Ethernet-Dongle (+HUB) is > connected: > Well, but with v4 you got a couple more messages about devices not removed but children gone. With v5 those messages don't show any more. So v5 fixes one of the bugs you were seeing, more bugs remain. Unfortunately I don't think I have any usb-ethernet dongle here to test... > => usb start > starting USB... > do_usb_start, 581 > Bus usb@fe380000: USB EHCI 1.00 > Bus usb@fe3c0000: USB EHCI 1.00 > Bus usb@fe800000: Register 2000140 NbrPorts 2 > Starting the controller > USB XHCI 1.10 > Bus usb@fe900000: Register 2000140 NbrPorts 2 > Starting the controller > USB XHCI 1.10 > scanning bus usb@fe380000 for devices... 3 USB Device(s) found > scanning bus usb@fe3c0000 for devices... 1 USB Device(s) found > scanning bus usb@fe800000 for devices... 1 USB Device(s) found > scanning bus usb@fe900000 for devices... 1 USB Device(s) found > scanning usb for storage devices... 0 Storage Device(s) found > => usb tree > USB device tree: > 1 Hub (480 Mb/s, 0mA) > | u-boot EHCI Host Controller > | > +-2 Hub (480 Mb/s, 100mA) > | USB2.0 Hub > | > +-3 Human Interface (12 Mb/s, 400mA) > ILITEK ILITEK-TP > > 1 Hub (480 Mb/s, 0mA) > u-boot EHCI Host Controller > > 1 Hub (5 Gb/s, 0mA) > U-Boot XHCI Host Controller > > 1 Hub (5 Gb/s, 0mA) > U-Boot XHCI Host Controller > Ok, so this was with a keyboard or something connected to a USB 2 port and nothing in the blue USB 3 port, right? > => usb stop > stopping USB.. > => usb start > starting USB... > Bus usb@fe380000: USB EHCI 1.00 > Bus usb@fe3c0000: USB EHCI 1.00 > Bus usb@fe800000: Register 2000140 NbrPorts 2 > Starting the controller > USB XHCI 1.10 > Bus usb@fe900000: Register 2000140 NbrPorts 2 > Starting the controller > USB XHCI 1.10 > scanning bus usb@fe380000 for devices... 4 USB Device(s) found > scanning bus usb@fe3c0000 for devices... 1 USB Device(s) found > scanning bus usb@fe800000 for devices... 3 USB Device(s) found > scanning bus usb@fe900000 for devices... 1 USB Device(s) found > scanning usb for storage devices... 0 Storage Device(s) found > => usb tree > USB device tree: > 1 Hub (480 Mb/s, 0mA) > | u-boot EHCI Host Controller > | > +-2 Hub (480 Mb/s, 100mA) > | USB2.0 Hub > | > +-3 Hub (480 Mb/s, 0mA) > | VIA Labs, Inc. USB2.0 Hub > | > +-4 Human Interface (12 Mb/s, 400mA) > ILITEK ILITEK-TP > > 1 Hub (480 Mb/s, 0mA) > u-boot EHCI Host Controller > > 1 Hub (5 Gb/s, 0mA) > | U-Boot XHCI Host Controller > | > +-2 Hub (5 Gb/s, 0mA) > | VIA Labs, Inc. USB3.0 Hub > | > +-3 Vendor specific (5 Gb/s, 36mA) > Realtek USB 10/100/1000 LAN 00E04C68034E > > 1 Hub (5 Gb/s, 0mA) > U-Boot XHCI Host Controller > And this was with the keyboard in USB2 and a USB3 VIA Labs hub connected to the USB3 port and a Realtek ethernet-USB dongle attached to that USB3 hub, right? > => usb stop > stopping USB.. > > > I just quirked/masked the underlying issue by not doing usb_stop() at > all in drivers/usb/host/usb-uclass.c. > Does usb reset also hang ? If so the problem then must be that you are left with no way to rescan for devices that were not connected at usb start but get connected later ? Did you say before it all worked if you unconfigured EHCI and worked with XHCI only? (or OHCI + XHCI but no EHCI). Might it have to do with the same hub hanging from the EHCI and XHCI controller? (but it doesn't sound strange to me, the hub doesn't know what devices will be connected to it...) If you leave drivers/usb/host/usb-uclass.c as it was but drop some #define DEBUG in device-remove.c does it give any hint ? I'll try to do some more tests with a USB3 hub and usb storage... Thanks again for testing.