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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F18CC4363A for ; Mon, 5 Oct 2020 16:15:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D0D162075A for ; Mon, 5 Oct 2020 16:15:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727950AbgJEQP2 (ORCPT ); Mon, 5 Oct 2020 12:15:28 -0400 Received: from netrider.rowland.org ([192.131.102.5]:57549 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1727224AbgJEQP2 (ORCPT ); Mon, 5 Oct 2020 12:15:28 -0400 Received: (qmail 382715 invoked by uid 1000); 5 Oct 2020 12:15:27 -0400 Date: Mon, 5 Oct 2020 12:15:27 -0400 From: Alan Stern To: Matthias Kaehlcke Cc: Rob Herring , Doug Anderson , Greg Kroah-Hartman , Frank Rowand , "linux-kernel@vger.kernel.org" , Linux USB List , Bastien Nocera , Stephen Boyd , Ravi Chandra Sadineni , Krzysztof Kozlowski , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Peter Chen Subject: Re: [PATCH v4 1/2] dt-bindings: usb: Add binding for discrete onboard USB hubs Message-ID: <20201005161527.GI376584@rowland.harvard.edu> References: <20200930013229.GB194665@rowland.harvard.edu> <20200930124915.GA1826870@google.com> <20201002183633.GA296334@rowland.harvard.edu> <20201003124142.GA318272@rowland.harvard.edu> <20201005160655.GA4135817@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201005160655.GA4135817@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 05, 2020 at 09:06:55AM -0700, Matthias Kaehlcke wrote: > On Sat, Oct 03, 2020 at 08:41:42AM -0400, Alan Stern wrote: > > The decision to enable the power regulator at system startup would be > > kernel policy, not a part of the DT description. But there ought to be > > a standard way of recognizing which resource requirements of this sort > > should be handled at startup. Then there could be a special module (in > > the driver model core? -- that doesn't really seem appropriate) which > > would search through the whole DT database for resources of this kind > > and enable them. > > This might work for some cases that only have a single resource or multiple > resources but no timing/sequencing requirements. For the more complex cases > it would probably end up in something similar to the pwrseq series > (https://lore.kernel.org/patchwork/project/lkml/list/?series=314989&state=%2A&archive=both), > which was nack-ed by Rafael, Rob also expressed he didn't want to go > down that road. > > It seems to me that initialization of the resources needs to be done by > the/a driver for the device, which knows about the sequencing requirements. > Potentially this could be done in a pre-probe function that you brought up > earlier. One of the important points of my suggestion was that the resource init should be done _outside_ of the device's driver, precisely because the driver module might not even be loaded until the resources are set up and the device is discovered. The conclusion is that we need to have code that is aware of some detailed needs of a specific device but is not part of the device's driver. I'm not sure what the best way to implement this would be. Alan Stern