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 6D2E7C7EE24 for ; Fri, 2 Jun 2023 06:41:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4C7EC863A7; Fri, 2 Jun 2023 08:41:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="D6gkwuo9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2987B847D3; Fri, 2 Jun 2023 08:41:30 +0200 (CEST) Received: from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com [IPv6:2607:f8b0:4864:20::1134]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 817E2863A7 for ; Fri, 2 Jun 2023 08:41:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jagan@amarulasolutions.com Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-565eb83efe4so17542237b3.0 for ; Thu, 01 Jun 2023 23:41:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1685688085; x=1688280085; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=EtKkXUjiR6Hr/o3As+B8CkfoWpMMPLHKlj6aQxK74TA=; b=D6gkwuo9YtjPc3B+im3Mdlusa4xIY+DzMjshR2cTcmZrFhDpp7X5ArZcHLLpGvxNPf OZptouDBVgfytY7nmjEKmBGfzSKYdW6S/MQAFxK4xh9WN7yfPMknAUhC5ToHxt7Mfrsw gd14kGOoUrCBDWfY2D10fXz9iXBfgAPVYBRtA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685688085; x=1688280085; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EtKkXUjiR6Hr/o3As+B8CkfoWpMMPLHKlj6aQxK74TA=; b=QXYJBea2gbuH9O3jY0+iDXvOZYGlDJscmYKqa3VRhvb6bf0fvxomEciJF6QMzDayUQ xZJWp6wCGU8eu5E/28wjR9jF/e+7gYdCEAuHHuB7T+90v7mPIrmmpESjhcDMOPvqNuVO OyT1AbrOEuStfjRjsUW6i2E8AyfWOqQGbhBTVOpSBfRz6et82coyjIFYNA6Y0n1ETzv/ Xv/oeITs4SsHUm+LqL9Z5GgLTgpGZ/qszjGtaw6NE6nZQDZgZmwPrUxa70RwAvIflNWG 4mSM+RqUJuFqx28RkFOYJD/Gj6yMZecP0t6o9MFStkh/BAEkyD+ap+1+dG13C3utnCu3 lg0A== X-Gm-Message-State: AC+VfDyTX15gWPSAKappTAy8GeJxlgAecxC40ztFCi+zdC6tqmqjF+gT mFk5Mc9QZeOmW+OkRucpDSXlRk5wHpawOOv1uKaNtQ== X-Google-Smtp-Source: ACHHUZ4VTJOv+J728vFfUzJ+HmWyFvubq3tu4UrL8/LeNPDm7S3HGE7hTS+QXZbTMSTNFg+WR/pX2ka8bJp0wOg/Mm8= X-Received: by 2002:a81:914c:0:b0:569:4fcc:1784 with SMTP id i73-20020a81914c000000b005694fcc1784mr866307ywg.51.1685688085235; Thu, 01 Jun 2023 23:41:25 -0700 (PDT) MIME-Version: 1.0 References: <5d158190ee4e5da9e34b377331da338af6223eef.camel@googlemail.com> In-Reply-To: From: Jagan Teki Date: Fri, 2 Jun 2023 12:11:13 +0530 Message-ID: Subject: Re: [PATCH v5 0/2] arm: dts: rockchip: rk3399: usb: ehci: Fix EHCI probe in rk3399 to access peripherals by USB 2. To: Xavier Drudis Ferran Cc: Christoph Fritz , u-boot@lists.denx.de, Simon Glass , Philipp Tomsich , Kever Yang , Lukasz Majewski , Sean Anderson , Marek Vasut Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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.8 at phobos.denx.de X-Virus-Status: Clean On Fri, Mar 3, 2023 at 3:57=E2=80=AFPM Xavier Drudis Ferran wrote: > > 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..= . > > > =3D> 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 > > =3D> 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? > > > =3D> usb stop > > stopping USB.. > > =3D> 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 > > =3D> 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? > > > > =3D> 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... Any news about the next revision of this patch? RK3399 has broken since release due to this issue. This fix might make upcoming release workable. Please let us know. Thanks, Jagan.