Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1865442pxj; Wed, 19 May 2021 16:08:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaUp+xFzqMJmmZ6M25IuJnMOUSk+YyHWbuDC9o6bXyb/R3K0ZvEZK9NMb1+AsVCXX6vVLh X-Received: by 2002:a05:6e02:1c42:: with SMTP id d2mr1620227ilg.286.1621465707052; Wed, 19 May 2021 16:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621465707; cv=none; d=google.com; s=arc-20160816; b=s9VwoC3KC/iIr2YeBLzcfrJReeKn6qDq+d/16U2cvnCFKB/kSYYiVFSxBG7nc+5VU2 f6Q/DG6qN9cxj+PCAz9gF+PG3sHaRlF6ZSDD2K1MQp6kD86e+Mq1U2UNe1bhAh0w2pNs csIvl0wRHICFh/HaahO0Z2DRw/btBtck61jyJN8A8LsbZF/2rcOmZmwq+EIyQM6Rw7ck j8bIF5tp4Wp4Von2gEoV6jDy7STrQHLzDFQ/adftf2zvTx6yRADSkdlCrREvQtslMIPC 6ijcFMGGn27eFxgCL9LRT73i7BLzZ0VlVjOXzSftxVTdq16N+5q+fKYU9eFn59cThx9z CO+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bNc/PWg94RceQRhCF+NWBGbuB6YRbrHAKURevypSwFM=; b=DvHAG7f+2hOVzyyVrE9pNJjlhoQuWAhiIRBvWcfPEQyuimQI/MwLcro8D5Z+QPQwz9 tWylWW/MNC6D6UWgvmtGiXb+RvegRQQ+s5kzWffPn+WJYbacDz54I5ESPHYcm1y7xAAR teBOZw2FquOmuNMTegpOn7d3waWGtFrfyCOMujbBybxqSnzIm7iUtXmw+INExyMoMFyZ FCS+23meUeBtd260S5oPsCx+xFr3kErsHdKLnSmzh4QrAXEr0MwHnqS4TqjPMMsTh8ml 6QV3LRDsuCEqushGFwE38HHMzXsow/1Za4jAGpaGPyvxkuSCwTBcEekBOcnIh/NTwnG5 v2+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mSWFOwAD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a14si1273445ilm.103.2021.05.19.16.08.13; Wed, 19 May 2021 16:08:27 -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; dkim=pass header.i=@chromium.org header.s=google header.b=mSWFOwAD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230004AbhESXIm (ORCPT + 99 others); Wed, 19 May 2021 19:08:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229465AbhESXIm (ORCPT ); Wed, 19 May 2021 19:08:42 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE990C06175F for ; Wed, 19 May 2021 16:07:20 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id i5so10556183pgm.0 for ; Wed, 19 May 2021 16:07:20 -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=bNc/PWg94RceQRhCF+NWBGbuB6YRbrHAKURevypSwFM=; b=mSWFOwADaHEDlE4bh10NpqgWa6CTP9+Sm9dHQ6eoBbWGJHDdMViCN7coGdcVCtEMQE yC0L+DJ9wfdsZp5NBL8n/C7xdGyAf9raRZrWSyAhMMvnFfyjbmbsnQvaQpVuFKuZ7NiH oOIkeQEx0OPk7XKv9FAunwxgRWKkZ8fdnXAEE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bNc/PWg94RceQRhCF+NWBGbuB6YRbrHAKURevypSwFM=; b=NmX6coE/N5268W5fx+vug9/KL0rBVhyTQjBhRSm7yF+xF19jwBEQ6d5A3MMvA3rZhW 4gSmL4Yolofy7DlQq0WtQH1YZ39TQMNwEoKbNpoHiT3Yv2J1tgWDd/ddSm1MFEzUiTki D766WIYLYbpbPMoTnJIjkC159t15u1zV2XkQ8UW6oBlFDLU6uPCt3v4aNTWTMsUtBOMN jHy4g7zHxQNrl/hOsbcoLQG6ifSdbmF4ylm5Xh82XnTLNtQgndpVMQqzTUmu4z6vryNx MlUhZaIjUKiv3q5jXz/41FmLJMK+EySTX79msDKNsD8NBHWNOx3YIOHi/5L2gDc02N+h kE0Q== X-Gm-Message-State: AOAM533odRyaGOtpKtCnVB3pcD2aIk9TNhWpMy46SlUuoOjFWNMffW7A Maa3R3MkM8H4Z+epR0Sy5l10Kw== X-Received: by 2002:a63:4b18:: with SMTP id y24mr1493340pga.438.1621465640249; Wed, 19 May 2021 16:07:20 -0700 (PDT) Received: from localhost ([2620:15c:202:201:3d5d:d560:9fb4:d9d1]) by smtp.gmail.com with UTF8SMTPSA id l15sm422658pjj.23.2021.05.19.16.07.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 May 2021 16:07:19 -0700 (PDT) Date: Wed, 19 May 2021 16:07:17 -0700 From: Matthias Kaehlcke To: Alan Stern Cc: Greg Kroah-Hartman , Rob Herring , Frank Rowand , Michal Simek , devicetree@vger.kernel.org, Douglas Anderson , linux-usb@vger.kernel.org, Peter Chen , linux-kernel@vger.kernel.org, Stephen Boyd , Ravi Chandra Sadineni , Krzysztof Kozlowski , Bastien Nocera , Al Cooper , "Alexander A. Klimov" , Masahiro Yamada Subject: Re: [PATCH v10 2/5] USB: misc: Add onboard_usb_hub driver Message-ID: References: <20210511225223.550762-1-mka@chromium.org> <20210511155152.v10.2.I7c9a1f1d6ced41dd8310e8a03da666a32364e790@changeid> <20210518194511.GA1137841@rowland.harvard.edu> <20210519144356.GB1165692@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210519144356.GB1165692@rowland.harvard.edu> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 19, 2021 at 10:43:56AM -0400, Alan Stern wrote: > On Tue, May 18, 2021 at 02:40:47PM -0700, Matthias Kaehlcke wrote: > > > > Could you also have a look at "[4/5] usb: host: xhci-plat: > > Create platform device for onboard hubs in probe()" > > (https://lore.kernel.org/patchwork/patch/1425453/)? It's a > > relatively short patch that creates the platform device for > > the driver from xhci-plat as you suggested in the v4 > > discussion. > > I'm not the maintainer for xhci-related drivers. > > However, there is at least one thing about this patch which looks > suspicious: Adding the onboard_hub_dev pointer to struct usb_hcd instead > of to struct xhci_plat_priv, where it would make a lot more sense. I can move it to struct usb_hcd if that's preferred > It's also worth mentioning that this approach won't work at all when the > onboard hub is not at the top level (its parent isn't the root hub), Yes, this limitation is mentioned in the commit message of '[2/5] USB: misc: Add onboard_usb_hub driver'. It shouldn't be hard to add support for nested hubs, however I currently have no such configuration for testing, so I prefer to defer it until the need actually arises and it can be tested. > or when more than one onboard hubs are connected to the same root hub. Right, currently that isn't supported. xhci-plat could iterate over the ports and have a list of the platform devices it owns. It would also require some logic to make sure only one platform device is created per hub. Much of this code could probably live in the onboard_hub driver and would also be used if support for non-root hubs is added.