Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3583562pxk; Mon, 5 Oct 2020 13:36:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkVRXwsLtYxfugQpTWk+4CVy2I6OUVSKf6eBszYKtCvPVdC/Ao6gCMgqXhiq7lmc0LCq4q X-Received: by 2002:aa7:d30f:: with SMTP id p15mr1536946edq.256.1601930185486; Mon, 05 Oct 2020 13:36:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601930185; cv=none; d=google.com; s=arc-20160816; b=iDCCZF3wnThl8CEgOifQZjfZtS46qbEvn2DCSjWvbulJWJ9pO5elFrqMZKn3w/56r9 u0+rGFOugQD9i2g5aMDu961aeN9YP9noK1vXRYZY/PRAc6mlWdIjXi+EktD6BHHVy8xR XSA/OyJikctK+cmkY5AeNH0ayAtyPBddyncqFBFhQNPBBkIvr+WFGfrW01WO0bgLPm2B tXcdqQDf4QbLkGZXt73YWZBpJEUm/xhFcYyseIDj7zGS8MyZGdPgcbMXeJ1JRabOxbk+ U4+AzOlwcYAy4+e5sjvprDuJ5avpDN6T7dNJx03xxFOyaFG7wBkZoLjmYGy8szDhIS4F RfSQ== 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=OcTocqYHhUxR0UFhj2evV013yOUe/iQVFOZwtgTlcj0=; b=ht7wE1S8rfsaJ3EDbioZaGbv5P5L3kd2+vH0oeOat5F8nAtPXHHajJsCjBcqg3Bhvd SCH6Rk5Lgb+Cw+FufdXWGj1Eh0rNL/QkTqmFl96B+PGMrc29t+PKZsOThqUsXqkGVGY8 nGtIFf6SaTPbZwdQYFothOBeYVOr7OoLvbfMrK/gkv3tu8FQr8V0KsHEiDHv9ymcOHTK tgynrgfUeo+j+v4lofNtY3BarZSeQ/Z9/OlZsWQpeWR3AA4YFvN5swhTIOqH9GzVAttf wUbt7dXuQ5fRLaaQHjTI8lH13Us5mNF3JiXWh9bgX3EI15g40n8NgohHVsL0g3PYRmeO akGg== 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 q18si865589edi.175.2020.10.05.13.36.03; Mon, 05 Oct 2020 13:36:25 -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 S1729354AbgJETgM (ORCPT + 99 others); Mon, 5 Oct 2020 15:36:12 -0400 Received: from netrider.rowland.org ([192.131.102.5]:45865 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1729302AbgJETgM (ORCPT ); Mon, 5 Oct 2020 15:36:12 -0400 Received: (qmail 390590 invoked by uid 1000); 5 Oct 2020 15:36:11 -0400 Date: Mon, 5 Oct 2020 15:36:11 -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: <20201005193611.GA389867@rowland.harvard.edu> References: <20201002183633.GA296334@rowland.harvard.edu> <20201003124142.GA318272@rowland.harvard.edu> <20201005160655.GA4135817@google.com> <20201005161527.GI376584@rowland.harvard.edu> <20201005191812.GB4135817@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201005191812.GB4135817@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 12:18:12PM -0700, Matthias Kaehlcke wrote: > On Mon, Oct 05, 2020 at 12:15:27PM -0400, Alan Stern wrote: > > 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. > > Wouldn't it be possible to load the module when the DT specifies that > the device exists? For USB the kernel would need the VID/PID to identify > the module, these could be extracted from the compatible string. Loading a driver module whenever DT says a device exists? Not a bad idea. I don't know what would be involved, but no doubt it is possible. Note that, except for a few special cases, the kernel identifies the appropriate driver for USB hubs not by the VID/PID but instead by the device class or interface class. I suppose the compatible string could include that information too? > Having the initialization code outside of the driver could lead to code > duplication, since the driver might want to power the device down in > certain situations (e.g. system suspend). True. On the other hand, how common do you think it would be for drivers not to want to mess with the power settings? Alan Stern