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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D73D6C433F5 for ; Tue, 19 Oct 2021 22:55:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9DAB761074 for ; Tue, 19 Oct 2021 22:55:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9DAB761074 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Tv+R+Kbf0vBZQDYvbRBhBjUV6gtALjH78cL8jO56MP4=; b=L1FUFBXzPWDp/S Ou5aY1xAfuyZ/D+QC1B1ncevdolBHMlyWm8633Nt7W7xfhkm7CscLq+2v3Moh9p77jyoFlXfdvG3n FwI+PzcABda9ngdtMgv76fOSyYfgOjOc9U+bbO/+rNAlArTTLQ5hUnmVcKEUInPEw7vB2T1JP12ej ZbeOZ1rZE2GKemYzKBlEGqrbcJWFz8UULsSc2hqdxD2Mktb4d2pDm7guA6jNXbAh/S0/U8UHAa/N2 CIWeP/ybNcjjZD1ndtR09LBM0AuLGeyRwmaB7lSZhywykW5YewbwpSbaC6bwW89LF8LghqnYhragC dzZbVNzVfVpP80GI5TEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcy02-002u5k-Em; Tue, 19 Oct 2021 22:54:26 +0000 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcxzy-002u59-BZ for linux-arm-kernel@lists.infradead.org; Tue, 19 Oct 2021 22:54:24 +0000 Received: by mail-pf1-x42b.google.com with SMTP id c29so1272446pfp.2 for ; Tue, 19 Oct 2021 15:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=cU3HJbTF7v8oN4m9QpyNLUi7Z2VsnXCEZXyNBnXavMs=; b=cuhVndCamK8/716BHL8VV3m6G8gcGkThTiSVQ6WCdR23cmkvS8BAdf5MUWNZ3+xdJh SXNvDs9u/lEzXmzt2H4VqFJR13EW1nC9xTyUpNjgvdyajBpGbxaWkVSkwru2zDmzhJL5 9+BvigGJweB1Imcox7fO16zbnV5IFg9bzbcUo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cU3HJbTF7v8oN4m9QpyNLUi7Z2VsnXCEZXyNBnXavMs=; b=oZja0LW4UVDyJBv4uLrL3HXYYBA1vC/gdf9saPk+MD0bvcgoiinynobFq4IuyLx+Cs qjW2RVpSnjE/AbPaCCEOVCYPSK3M/SuH7aIQDSksVY2rfwWNuwvIQUPj85lXuuNgIkun yHm2eBa/vjAJwYh3i2ujVf9WlCOuRt2L19KZ/8lv75H/bXkv1lklfL0is1MzXkLrrrzx 6TzNiZQRxm0zr4Lyp0cWALriNvyun5aRtivAmouxtpi8T/zOMi5/ZKfHyzSNYGCUU3xT YIRZGAHVPAXj87Gm58rI5gNphW6B8CGUYdN0GcPKm/MPpPYpiCXRHKUHmSINCzP5CP9g fHCA== X-Gm-Message-State: AOAM531XlpOWyla0KOyMtoJt2jf3Z0qnuvH4RPgiFJKiIc23gL9lgrFq nJPw2b4TnpjfSI/Ncu/HtHPvww== X-Google-Smtp-Source: ABdhPJwhFFyHmKUMVfxbdbUIRSGmuKpqlVMRtb5XW/S/r0SYWKyVbrnMtwygjRKH7m1CQn1PDJPYsw== X-Received: by 2002:a62:5804:0:b0:44b:b75b:ec8f with SMTP id m4-20020a625804000000b0044bb75bec8fmr2499812pfb.63.1634684061497; Tue, 19 Oct 2021 15:54:21 -0700 (PDT) Received: from localhost ([2620:15c:202:201:6c1f:a561:f56:7d16]) by smtp.gmail.com with UTF8SMTPSA id q6sm245804pgc.1.2021.10.19.15.54.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Oct 2021 15:54:21 -0700 (PDT) Date: Tue, 19 Oct 2021 15:54:18 -0700 From: Matthias Kaehlcke To: Dmitry Baryshkov Cc: Greg Kroah-Hartman , Alan Stern , Rob Herring , Frank Rowand , Mathias Nyman , Felipe Balbi , Bastien Nocera , Peter Chen , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Michal Simek , open list , Douglas Anderson , Krzysztof Kozlowski , linux-usb@vger.kernel.org, Ravi Chandra Sadineni , Stephen Boyd , Al Cooper , Andrey Zhizhikin , Andy Gross , Aswath Govindraju , Bjorn Andersson , Catalin Marinas , Dmitry Osipenko , Enric Balletbo i Serra , Fabio Estevam , Guido =?utf-8?Q?G=C3=BCnther?= , Jagan Teki , Nishanth Menon , Pawel Laszczak , Roger Quadros , Shawn Guo , Vinod Koul , Will Deacon , Linux ARM , "open list:DRM DRIVER FOR MSM ADRENO GPU" Subject: Re: [PATCH v15 0/6] usb: misc: Add onboard_usb_hub driver Message-ID: References: <20210727004118.2583774-1-mka@chromium.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211019_155422_445835_6ECC6CA8 X-CRM114-Status: GOOD ( 34.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Dmitry, On Tue, Oct 19, 2021 at 07:24:41PM +0300, Dmitry Baryshkov wrote: > On Tue, 27 Jul 2021 at 03:41, Matthias Kaehlcke wrote: > > > > This series adds: > > - the onboard_usb_hub_driver > > - glue in the xhci-plat driver to create and destroy the > > onboard_usb_hub platform devices if needed > > - a device tree binding for the Realtek RTS5411 USB hub controller > > - device tree changes that add RTS5411 entries for the QCA SC7180 > > based boards trogdor and lazor > > - a couple of stubs for platform device functions to avoid > > unresolved symbols with certain kernel configs > > > > The main issue the driver addresses is that a USB hub needs to be > > powered before it can be discovered. For discrete onboard hubs (an > > example for such a hub is the Realtek RTS5411) this is often solved > > by supplying the hub with an 'always-on' regulator, which is kind > > of a hack. Some onboard hubs may require further initialization > > steps, like changing the state of a GPIO or enabling a clock, which > > requires even more hacks. This driver creates a platform device > > representing the hub which performs the necessary initialization. > > Currently it only supports switching on a single regulator, support > > for multiple regulators or other actions can be added as needed. > > Different initialization sequences can be supported based on the > > compatible string. > > I have the feeling that you might want to check if you can use pwrseq > subsystem being proposed at > https://lore.kernel.org/linux-arm-msm/20211006035407.1147909-1-dmitry.baryshkov@linaro.org/. > It has been created for exactly the same reason of handling complex > power up/down requirements in a bus-neutral way. So instead of > creating an onboard-usb-hub, you might want to populate the hub node > with the reference to pwrseq device and make usb core call into > pwrseq. How does that sound to you? Thanks for the pointer, it's good to see another attempt to sort out power sequencing. The pwrseq framework could potentially be used by the onboard_usb_hub driver, but it probably can't replace it completely. Besides powering the USB hub on before enumeration the driver also can optionally power it off during system suspend when no wakeup capable USB devices are connected, which can result in signifcant power savings on battery powered devices. For this the driver needs knowledge about the USB (hub) devices that are provided by a hub chip. That part is probably best implemented by a driver under drivers/usb/. It might be an option to have the USB core and the onboard_usb_hub driver use the pwrseq framework, though we'd have to ensure that it isn't a problem that the USB core turns power on (before enumeration) and the onboard_usb_hub driver turns it off during system suspend (and on again on resume). _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel