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 85145C678D4 for ; Fri, 3 Mar 2023 09:42:31 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 608BE85CF8; Fri, 3 Mar 2023 10:42:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b="mqOujIfX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 038B585CD4; Fri, 3 Mar 2023 10:42:27 +0100 (CET) Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) (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 C3A2A85CFA for ; Fri, 3 Mar 2023 10:42:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=chf.fritz@googlemail.com Received: by mail-wm1-x333.google.com with SMTP id o38-20020a05600c512600b003e8320d1c11so3057933wms.1 for ; Fri, 03 Mar 2023 01:42:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; t=1677836542; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:reply-to:from:subject:message-id:from:to:cc :subject:date:message-id:reply-to; bh=lLCxEqBnAHSbcsQ8h42uqdGqB9+T4wxlQLpGPiaqlb4=; b=mqOujIfXC+M+eKWdB7CKoDGwrSqFD53MdNqHjP+xrgZ9GnDGcic9BSGjYbn64zN5QI 6SCsR1GzQji8Sx1E3bxvwBGOhvsrK9UMhnd9vpZDRLhopLyBK8bvfSPixapbIk6mfmXB Ui5X7TFhgAU5P0pcH/pe3EpkdaJ4CIfoYo5/TKN/SGE01qCST2CUre1wN2FKMCJj7IZb EFp4yWo1psj//ah3IWayyz+Ad3tlNyuz2aoxwD2/waUnhfNh8f7f3rY5osFqA/wdSimq CBJlBrNNWxAzz2RHLuK0XrV3MM5i10ZJidtq6FZt1Wh/tl4dX3ENPBjgE+CQfWHfLs84 jAQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677836542; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:reply-to:from:subject:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lLCxEqBnAHSbcsQ8h42uqdGqB9+T4wxlQLpGPiaqlb4=; b=ELmVdFNRux6GjsF5BQbeQYJkhMRmMOfFKmhgrdZinJbCOWuSEFK4pNyNmBkf4w48X6 2pAuJTsg48OvG0kJ/FrhQ4Dj3cV9BMYgBi5miF7D/YKC1ObMQZq7rZyC7CZRrEKsCapj Mq3CUvCVK8stA2tvEc6QgbPAGk2UfZEyrcmn6MfCSUGkZ6rHtzfnNQMKL1T+aCdm5SCc fMVCOjSPtK1lj8MvRgPr0TBvdbQpeknDju6ZXH/ueU5zU2qmoOXAT5CeIXY4owyBrH4J Wl9ysFZXuB2pvNtLhV0JExLgDxzfRez4c+8FmKUG+I5nLl5IrtODTsPGdPHDu/D/tsci qthw== X-Gm-Message-State: AO0yUKUa5YZ2BHV7xRvu/WUEz/L8Thpk9kqBQYxXGjlV+h+cZUXavvcA lfNT8+FlXdCCycsvfqkCO18= X-Google-Smtp-Source: AK7set8qtjiw1X6rzkgwsXaaL85HUdAOO8JWhS4zbZLqWyAmAXuexPPoXaIVCVEMbbMXWqyLX7kzoA== X-Received: by 2002:a05:600c:4748:b0:3df:e4b4:de69 with SMTP id w8-20020a05600c474800b003dfe4b4de69mr996719wmo.27.1677836542089; Fri, 03 Mar 2023 01:42:22 -0800 (PST) Received: from mars.fritz.box ([2a02:8070:b80:7760:b352:6d7:c693:9659]) by smtp.gmail.com with ESMTPSA id l8-20020a05600c4f0800b003b47b80cec3sm6332229wmq.42.2023.03.03.01.42.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 01:42:21 -0800 (PST) Message-ID: <5d158190ee4e5da9e34b377331da338af6223eef.camel@googlemail.com> Subject: Re: [PATCH v5 0/2] arm: dts: rockchip: rk3399: usb: ehci: Fix EHCI probe in rk3399 to access peripherals by USB 2. From: Christoph Fritz To: Xavier Drudis Ferran , u-boot@lists.denx.de Cc: Simon Glass , Philipp Tomsich , Kever Yang , Lukasz Majewski , Sean Anderson , Marek Vasut Date: Fri, 03 Mar 2023 10:42:20 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1+deb11u1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: , Reply-To: chf.fritz@googlemail.com 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 >    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: => 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 Totally unrelated to your patches, stopping usb still crashes (with or without your patch) but only when a USB-Ethernet-Dongle (+HUB) is connected: => 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 => 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 => 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.