Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1870211pxb; Wed, 20 Oct 2021 13:30:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzViOGZSkuzZ2cYVj7HbVSFMpVTbU8+jUoGo1qW8+auUrzLlIVo1FISSL8X3stjxbV4Gklg X-Received: by 2002:a65:664f:: with SMTP id z15mr1153445pgv.252.1634761819048; Wed, 20 Oct 2021 13:30:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634761819; cv=none; d=google.com; s=arc-20160816; b=od0v+epQkwsAV72dHzu4UjDVORZupAocIT7VggSZfUy37N7VTKO+Wu9rMyjJMsypqb ymEjttwLqj7JPNz0cux1HQXG58NycMAnBfYhF/UX+PdtsYCRv4ure0uhMPj+S85rkgt7 J8KRemO56IE7Z419EVXBWdp3S+CLxM8brDRJc8UN/p4DUGAEmhujIPX+u2tDe1OBL2a1 KEmyTTA77AWfkwSghyEd6dDf2lbyUNVgZF1hOMMlZCZAlmcn9c8FLvZdM0EyCVvu6ibz FWzL4Ti9T881Qiu/ggM2eQrXegazNmiqCwDfH1WyPHpKPEStiz/l3K2VD1Gs8nO5PzYZ F3Kg== 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=7MkU8qwyEkJbn1j/FIRW/1axu09eSaDPhCxUWJs7Xag=; b=bcXI37yKX74Q63tmVEsn1CXCcPhhBXncgGCmT8G93IUYX9RC9dEemp45c43FIhp3mw Las1HC275Kyp+R3aepKL+mepeLqZ8jAQiQk4e6KZbGTF3bSft1JABtk/51PinA8tfZGR BAuzsqFGsJPIQ0u/IvAVhbcARXi1E42AfKLk+mDNX7ZPwmAjezWa1X1s/CKjmtaNzx2O cW+ao4Xcpzs+1KEmu7jHSpRUT1nTN3fFscLK8dH73T9UwqhLA1nqYD7nOVsXjapgv+v8 PmuLKhcGXFiOBIEq4GaEvVBBfn1KwHmmUekFdU075MyNNsRjwLwr5QXdUPh9sMrcaqkj BOdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ciE7a7Wa; 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 c1si5343905plh.407.2021.10.20.13.30.06; Wed, 20 Oct 2021 13:30:19 -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=ciE7a7Wa; 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 S230155AbhJTU36 (ORCPT + 99 others); Wed, 20 Oct 2021 16:29:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230052AbhJTU34 (ORCPT ); Wed, 20 Oct 2021 16:29:56 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4712AC06161C for ; Wed, 20 Oct 2021 13:27:42 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id t11so16941381plq.11 for ; Wed, 20 Oct 2021 13:27:42 -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=7MkU8qwyEkJbn1j/FIRW/1axu09eSaDPhCxUWJs7Xag=; b=ciE7a7WangZ6fjX+SQ+qQvaQsbxewBTE/wyy0BbU9QMyhMs7ST6ntYWq4kQG2y5kEn D473iaqcbfVQgwGikbqQZGdPcgylhhowl1o+oW+693DDQHGKPtCth01zB2BZ1tU/IdJY NSjJBGZWqRqKyj6tSCs4I6f+Vc3kYci0wabT0= 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=7MkU8qwyEkJbn1j/FIRW/1axu09eSaDPhCxUWJs7Xag=; b=6IXkbC59RmmsSYWUuS4TzmnD7fw2V4B7I+LMckavSuvbxUWn2s01Hf0khr2AI2qZjh zaMohnsAcZadaYk9o5hTVUZn3Qx62xxoGbe8dUjD5vqFNOUsL+lAdyvl+Ic3x2R7ERDz MePfg7uCUMT/FvF7B4yRc1IAu1efes0kSl+TS+J30sRSk3SE6O/6s3atDCbUZ6rFbGSG 3ooMDKfOArjuDHDx0r++i3QQCX0gPiTgvl4UPlLSbB5xWDhlme8itBLowKI5W0dXQJnT l59HRD2s8DfdNPAY5gap29KZGJqpgICTLwXnGLE2nRW1U18nSDGbohZ0E1uDoUKLpJDk cLIw== X-Gm-Message-State: AOAM532FiwoXpJpAOS0s0P8Yh3rivhU9MkLWmNiHVXJXmc7JcI78wTui mzH+KOmDLHFhzIIRCHZvQQaxKvwmzR56eQ== X-Received: by 2002:a17:90a:1950:: with SMTP id 16mr1233777pjh.126.1634761661806; Wed, 20 Oct 2021 13:27:41 -0700 (PDT) Received: from localhost ([2620:15c:202:201:d5fe:85e9:caf2:ec4e]) by smtp.gmail.com with UTF8SMTPSA id q8sm3806814pfu.167.2021.10.20.13.27.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Oct 2021 13:27:41 -0700 (PDT) Date: Wed, 20 Oct 2021 13:27:40 -0700 From: Matthias Kaehlcke To: Mathias Nyman Cc: Greg Kroah-Hartman , Alan Stern , Rob Herring , Frank Rowand , Mathias Nyman , Felipe Balbi , devicetree@vger.kernel.org, Peter Chen , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Bastien Nocera , Ravi Chandra Sadineni , Michal Simek , Douglas Anderson , Roger Quadros , Krzysztof Kozlowski , Stephen Boyd , Dmitry Osipenko , Fabio Estevam Subject: Re: [PATCH v16 6/7] usb: host: xhci-plat: Create platform device for onboard hubs in probe() Message-ID: References: <20210813195228.2003500-1-mka@chromium.org> <20210813125146.v16.6.I7a3a7d9d2126c34079b1cab87aa0b2ec3030f9b7@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mathias, On Wed, Oct 20, 2021 at 04:05:37PM +0300, Mathias Nyman wrote: > Hi > > On 13.8.2021 22.52, Matthias Kaehlcke wrote: > > Call onboard_hub_create/destroy_pdevs() from _probe()/_remove() > > to create/destroy platform devices for onboard USB hubs that may > > be connected to the root hub of the controller. These functions > > are a NOP unless CONFIG_USB_ONBOARD_HUB=y/m. > > > > Also add a field to struct xhci_hcd to keep track of the onboard hub > > platform devices that are owned by the xHCI. > > > > Signed-off-by: Matthias Kaehlcke > > --- > > Haven't really looked at this series until now. > > Is there any reason why the xhci platform driver was selected as > the best place to create/remove these onboard hub devices? IIRC Alan suggested to use the xhci platform driver for creating/removing the onboard hub devices when we were trying to get rid of a separate DT node on the 'platform bus', which was suitable the board for my use case. > This ties the onboard hubs to xhci, and won't work in case we have onboard > hubs connected to a ehci controllers. Right, the driver itself isn't limited to xhci. The initial idea was that support for other types of USB controllers could be added as needed (I only have a config with xhci for testing). > If separate devices for controlling onboard hub power is the right solution then > how about creating the onboard hub device in usb_add_hcd() (hcd.c), and > store it in struct usb_hcd. > > A bit like how the roothub device is created, or PHYs are tuned. Sure, that sounds feasible, even better if it's handled in a single place and different types of controllers don't have to add support separately.