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 3A49BC64ED6 for ; Mon, 27 Feb 2023 12:22:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 04F84859A9; Mon, 27 Feb 2023 13:22:41 +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 8E06785942; Mon, 27 Feb 2023 13:22:39 +0100 (CET) Received: from mx1.tinet.cat (mx1.tinet.org [195.77.216.146]) (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 3BF95859B9 for ; Mon, 27 Feb 2023 13:22:36 +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: 1677500554-163e7b1a0807ac0001-4l7tJC Received: from smtp01.tinet.cat (smtp.tinet.cat [195.77.216.131]) by mx1.tinet.cat with ESMTP id nbt8yDDQUdESpz0L; Mon, 27 Feb 2023 13:22:34 +0100 (CET) X-Barracuda-Envelope-From: xdrudis@tinet.cat X-Barracuda-Effective-Source-IP: smtp.tinet.cat[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 88EF5605DE44; Mon, 27 Feb 2023 13:22:34 +0100 (CET) Date: Mon, 27 Feb 2023 13:22:19 +0100 From: Xavier Drudis Ferran To: Christoph Fritz Cc: Xavier Drudis Ferran , Simon Glass , Philipp Tomsich , Kever Yang , Lukasz Majewski , Sean Anderson , Marek Vasut , u-boot@lists.denx.de Subject: Re: [PATCH v4 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 v4 0/2] arm: dts: rockchip: rk3399: usb: ehci: Fix EHCI probe in rk3399 to access peripherals by USB 2. References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Barracuda-Connect: smtp.tinet.cat[195.77.216.131] X-Barracuda-Start-Time: 1677500554 X-Barracuda-URL: https://webmail.tinet.cat:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 1709 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= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.105343 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 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 Sun, Feb 19, 2023 at 08:48:57PM +0100, Christoph Fritz deia: > > I have tested both of your patches on an rk3399: > > without patches applied: > > | starting USB... > | Bus usb@fe380000: ehci_generic usb@fe380000: Failed to get clocks (ret=-19) > | Port not available. > > with patches applied: > > | starting USB... > | Bus usb@fe380000: USB EHCI 1.00 > | Bus usb@fe3c0000: USB EHCI 1.00 > | Bus usb@fe800000: Register 2000140 NbrPorts 2 > > > 'usb stop' still makes u-boot hang, but with your patches applied > following output gets printed before: > > | => usb stop > | stopping USB.. > | device_remove: Device 'usb@fe380000' failed to remove, but children are gone > | device_remove: Device 'usb@fe3c0000' failed to remove, but children are gone > > > Without CONFIG_USB_EHCI_HCD 'usb stop' works just fine. > > Thanks > -- Christoph > Thank you a lot for testing and reporting. I think I found the cause. property_enable() returns an error code in linux but just the value written to the register in U-Boot. So I'll be sending an v5 with a change to ignore the return from property_enable() when enabling and disabling the clock, just as other calls in the file do. Alternatively one could use v1, v2 or v3 of the patch. But since they weren't accepted I'll try an v5. I wellcome help testing or ideas on how to test whether an output clock is correctly enabled or disabled when everything seems to work fine already without enabling it, but it needs to be enabled simply because of a dts coming from linux where it seems to have effects on suspend/resume. Thanks, -- Xavier Drudis Ferran