Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3488236pxk; Mon, 5 Oct 2020 10:55:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEOYiUIc+D5gvno07Znuzj/ZLwRVQqhJjdbXAK27uNS851JXth6fntudNIcp83gqDvxnC2 X-Received: by 2002:a50:fa42:: with SMTP id c2mr928750edq.282.1601920544498; Mon, 05 Oct 2020 10:55:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601920544; cv=none; d=google.com; s=arc-20160816; b=ZfgSM7gzpwbJW9Jmhhw5xdpdAtBHv6YdW0SduSYmjilzHBggEDWx3hwtNlH8RnOwA8 8ELXDMl8Cyx53V9e1Yr+fSiheH+49TXfbIRcn7lBgOjHluTHF8TLjuN0fHahblkcPI56 ZOiczRLYW66szCAmASfyw57yFmG+0n+PEy03Kluc/0Obw2wBeWJv6u7B33/3xWEKqACb hp/fXE4j94Q0Drsqz7cPvdUwPHPyZ2lOhuWuByjWM4Y5VFWQg/jyWeDlQgLgEjvKzyAJ hFRE4v8TcN376nzHPa8ZFKVSkfeaYxBFp6rSBuMjxbgLx2Jp+fewpdUa7b7VyX1INAIp BrOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=N6duqxm3QUEju4odE5Ucv54yuwydrjYQ9c68ecBTf1I=; b=F3Nvufyo1XSeQJR5xBexGQ/CpD5AE0/nzX3YSKby58JidGm7vtT0VFWXVwRgxtZ+Fb j+/xvWQlG+b6cSKQL5qWAfyCSiGXAwVxKOPLDtMKGatrOMvg7HP6DCm6vdLLwkbyDx7m iIzJ2NxgA6O7eUZrfGtBRPIt9kobDqDmm+Ib0K3r0Enj4ikNugTXWRSYf3tGGBe+xl+o wKzdH6c4kYoHisG9WdttChu35i+SzqS2Iyog8Givi8BMe4g9BZPFZ5ywlErtARhB78DK LVVIY89HQf+L70EH1iSS4Vo6EQYXRITUUKO7yRO+Mp/liqsOSOAgPCq69pIrPIHutQ+5 iw7A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id os25si240305ejb.454.2020.10.05.10.55.22; Mon, 05 Oct 2020 10:55:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728370AbgJEQP2 (ORCPT + 99 others); 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