Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2379275pxb; Thu, 11 Feb 2021 10:48:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtCqoBnm+OHpbMaT7QMoyPJ6HWhrZzKRiRkiW5sf6a79ipBW0V7oKHsytyulxf9sg2Hr99 X-Received: by 2002:a17:906:259a:: with SMTP id m26mr9943885ejb.399.1613069311195; Thu, 11 Feb 2021 10:48:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613069311; cv=none; d=google.com; s=arc-20160816; b=CQVJzKVqkwnBxMVQEANDYn+E9XrUQWjQA3oXm+zakTJcxCEkMycm3ZXGDNJ6gc+glE WFCWroo2Y2CnAgyq2rzTj0OlkFMghb+TTy2YeQ+OShBYAq2EpZ5nUBnL2v2wTeiu1BpD vlmC55lFMTz248YtYcplkZWLpNobkSgBR7y1PZICJVJ+48usi4ENH9nepsqgbH0Ce1B7 7tRBJC7JcAUv6CGujvYLm/6AW18Pmjd3mIAHpfC5Wadtp127gQi8Wp0gkZHrN/8GT8CE +lYGjEvLXHlv3a4CAln9rBS0ON1QkU2XbxH0XflvLhcwW2ITbt+zYCGFfL9pTbGe1R34 CzKA== 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=QgIYTyhfH72b4fULrOrfaw7q3uY66r3eG0ZY6y6h27g=; b=Z7H7sYN2BJAX/pKi7Rc34u1JCRuD4BrCkgl1MMw9in5/YVGZSW+FcflsMw9cfjlYgS 7FZyKu9FAcY+g3S9unqRZ1gNh5MDGJz5axRx4oe45mdcnLx/A4L5e0itW0DpIo7yXgof CKf5B1x0MBeLA5zSedQPTwBWEFoj2CzOTQTzvlOV5f2pPsmoG16oczAmFKJ1fWHZEBTt UaDHhYlxhQeOdPErXeBIWVK2Ta1MgWikm9MnY2PJNRSFA+exlsqE2H5cGr1LvWAHMD3c 0uRj8IaZeJ6/x7BRgyW4XD/nsrLY/54ZoP6OZeTvWQ7Ez2g+CQj0OWudeT83JrOzJBe5 yBWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hFEBW2MX; 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 w21si3903540edd.421.2021.02.11.10.48.06; Thu, 11 Feb 2021 10:48:31 -0800 (PST) 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=hFEBW2MX; 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 S229961AbhBKSrL (ORCPT + 99 others); Thu, 11 Feb 2021 13:47:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbhBKSqb (ORCPT ); Thu, 11 Feb 2021 13:46:31 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 403CBC0613D6 for ; Thu, 11 Feb 2021 10:45:51 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id q10so840526plk.2 for ; Thu, 11 Feb 2021 10:45:51 -0800 (PST) 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=QgIYTyhfH72b4fULrOrfaw7q3uY66r3eG0ZY6y6h27g=; b=hFEBW2MXaPJFYKkCfGxQdNc1eSytYrBeXV3p6ZT1FrjSEGdacvycOmi8Rrwh5bYz/E oxAhJutYjhrytLuCWHZqOdVBRUqq4PTcpkkHdX4o9eEdd3mqGLw+pourJhqeSlsRshJB 3JTlBxWOkUKkPcCMCY3h0D6zLNdTh9Ml8GXd4= 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=QgIYTyhfH72b4fULrOrfaw7q3uY66r3eG0ZY6y6h27g=; b=X+W9Tba1nlf4q+783tgKfdjc3GmsCKJwdkfmLqdeMYltSiw+wGwA0QJUmTlOTvLXdc X96kD46mOjFlrrb7rSXmIEffAosxwef3txDsiDPJzDk8fkMBbkGNWeCkwAFmNzNZXS2b 1wQ8q3rPCdwLiKnpaNa9bPZlUM1BLO7vz4dxaryiwiwW6mMdLc9qvuzwA/vYXU7KoyJi glr67JY3mRXllsplmGrG92e3St4Zxc1AMfE37ez3rGyjk3YV+Eay7Y2u32225B9TO2HK Ku4ztr8KFgZRsUMJ/Hz8TSl4eyMCveoMXbjQrnSYmN3CtrbPlEtkX5R5XH5Dh8fvOLU4 7ftQ== X-Gm-Message-State: AOAM533yJgDIqVhVYDivwqHVvhuPTpxhJyCvsx81c76G1mKohzin33fn +2M2hMsdPr6WzH1oFgFAEn8rqw== X-Received: by 2002:a17:90a:d34b:: with SMTP id i11mr5118092pjx.235.1613069150706; Thu, 11 Feb 2021 10:45:50 -0800 (PST) Received: from localhost ([2620:15c:202:1:fc92:99c:fc2f:8603]) by smtp.gmail.com with UTF8SMTPSA id d18sm5808929pjz.40.2021.02.11.10.45.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Feb 2021 10:45:50 -0800 (PST) Date: Thu, 11 Feb 2021 10:45:48 -0800 From: Matthias Kaehlcke To: Greg Kroah-Hartman Cc: Rob Herring , Frank Rowand , devicetree@vger.kernel.org, Peter Chen , Stephen Boyd , Alan Stern , Ravi Chandra Sadineni , Bastien Nocera , linux-kernel@vger.kernel.org, Douglas Anderson , linux-usb@vger.kernel.org, Krzysztof Kozlowski , Mathias Nyman Subject: Re: [PATCH v5 3/4] usb: host: xhci-plat: Create platform device for onboard hubs in probe() Message-ID: References: <20210210171040.684659-1-mka@chromium.org> <20210210091015.v5.3.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 Greg, On Thu, Feb 11, 2021 at 07:58:23AM +0100, Greg Kroah-Hartman wrote: > On Wed, Feb 10, 2021 at 09:10:38AM -0800, Matthias Kaehlcke wrote: > > Check during probe() if a hub supported by the onboard_usb_hub > > driver is connected to the controller. If such a hub is found > > create the corresponding platform device. This requires the > > device tree to have a node for the hub with its vendor and > > product id (which is not common for USB devices). Further the > > platform device is only created when CONFIG_USB_ONBOARD_HUB=y/m. > > > > Signed-off-by: Matthias Kaehlcke > > --- > > > > Changes in v5: > > - patch added to the series > > > > drivers/usb/host/xhci-plat.c | 16 ++++++++++++++++ > > include/linux/usb/hcd.h | 2 ++ > > 2 files changed, 18 insertions(+) > > > > diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c > > index 4d34f6005381..e785fa109eea 100644 > > --- a/drivers/usb/host/xhci-plat.c > > +++ b/drivers/usb/host/xhci-plat.c > > @@ -15,6 +15,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -184,6 +185,7 @@ static int xhci_plat_probe(struct platform_device *pdev) > > int ret; > > int irq; > > struct xhci_plat_priv *priv = NULL; > > + struct device_node *np; > > > > > > if (usb_disabled()) > > @@ -356,6 +358,17 @@ static int xhci_plat_probe(struct platform_device *pdev) > > */ > > pm_runtime_forbid(&pdev->dev); > > > > + np = usb_of_get_device_node(hcd->self.root_hub, hcd->self.busnum); > > + if (np && of_is_onboard_usb_hub(np)) { > > + struct platform_device *pdev; > > + > > + pdev = of_platform_device_create(np, NULL, NULL); > > A platform device is a child of another platform device? Ok, but > really, why? What uses this device? In earlier versions there was a standalone platform device: https://lore.kernel.org/patchwork/patch/1313001/ However this was rejected by Rob, since the DT would require a node for the platform device and (implicit or explicit) nodes for the USB devices, representing the same physical device: https://lore.kernel.org/patchwork/patch/1305395/ https://lore.kernel.org/patchwork/patch/1313000/ Both Doug Anderson and myself argued that it seems legitimate to distinguish between the devices connected to the USB bus, and the chip which might have GPIOs, regulators, clocks, ... but apparently our arguments were not convincing enough.