Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2390610pxb; Thu, 11 Feb 2021 11:05:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVqCN0JJwu2lQXROGUQOp1Dacp1xD6UuiMaDptOHU9AXdkSyEXjNOMcWIMV/fLJwThqXcx X-Received: by 2002:a17:906:3899:: with SMTP id q25mr9897333ejd.173.1613070330345; Thu, 11 Feb 2021 11:05:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613070330; cv=none; d=google.com; s=arc-20160816; b=qT/PIEWj5ZtQnCTv6p7rp6HcrEu5G9/bv2Soq7IHJ7INiuxhSXhiU9VhVDJHcMFdve YdjbrHQJbA00LdLW1b3/1du4JG9963XepWfvc8rZW/VOUZkrZIDzXwMwdE86ph1EILBc ziA2qaL24ISsz5AaLZ2JbjSKdPeS5U2vAXD1zslqCbqgdKqCy58VEpeQD+a98tcFWyuJ HgwvnF0nTOuxrp/YevQhWxr8r+618/UHoc6YSsOOS0HQA8OzMFCcnwQlfWg9SAG6iVO4 mFGB4QI6RbrVEEDDSMJkmJXGhk8+rjuiqeHllrrl6hiKN2onJ3tLZJ5evoWfRvcz4OkZ tBag== 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=38z+MQX41khqI4CrfgsdKCbVUZuEtmzm0vpGYv2oT/g=; b=YS2MmXChk3sFZ2zqOdzuO0BNiy1nbIpJQGSwSUdgve6+zW2ezR/mYDdder5jlHSEnt SlyrHsjcwjAROKS5gT5TZGTwRzC4yhRxQt6hpetL3DXOvFp+05wl1QJ/3mdbHuMPyUEB ft2bu5Cid8999XHmsrgb1hj7DNeif3Ry1/6lLplirfdrV4vtF6XFQeC0MGFzqRsOV0lC 5zsJTQVNRF82pIVCr2ZUchAyBCSZPHEcSuTVePPY5B2ilSZyeEVXeiaABIO8URcLv1VH AhwgUcEgpIo7vgYdFa6GeIko2mBUhgfABiR/vAs72TYxx+b5RLNGI5SotAitEnfaq4D3 DURQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=P1Z9ylho; 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 t24si4376317edv.171.2021.02.11.11.05.03; Thu, 11 Feb 2021 11:05:30 -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=P1Z9ylho; 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 S229742AbhBKTEA (ORCPT + 99 others); Thu, 11 Feb 2021 14:04:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231631AbhBKTBr (ORCPT ); Thu, 11 Feb 2021 14:01:47 -0500 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8649C06178A for ; Thu, 11 Feb 2021 11:01:06 -0800 (PST) Received: by mail-pg1-x52f.google.com with SMTP id t11so4547782pgu.8 for ; Thu, 11 Feb 2021 11:01:06 -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=38z+MQX41khqI4CrfgsdKCbVUZuEtmzm0vpGYv2oT/g=; b=P1Z9ylhoK6aFfRrdpwiLZS0OMGndod97oFC7yb3dqZvLg8Gx9QYB5OA2npK10G3+RR HkRwR4kDaLOHc+i+OOoqADEaeU/NtIUC8trKUbXNr4B0nVfwzzr5gjEuK5AQLfdmCLxD ln1JifQ5EgUk0XAuMpl7m4gSTEaWhoNvQWqp0= 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=38z+MQX41khqI4CrfgsdKCbVUZuEtmzm0vpGYv2oT/g=; b=kbv5NjPOkGku3YFxidmqxs70OyVDerB4lu9M35E7XmawYU3kb2ox22wv+TTb8Rw28q hmiZ4RVvlChPrsnfMbKpbhGYESFMHoNCKqLFT5Kxyi22aehVx5D4B7EmU7vPLyVhv3e2 99OI7GG1N4bAUw74SDHmt83bHJTUTMZvoHS9tr/8v/D0f8q8KLPOsUA2yQzNOZVC7FeG 6sx1uF5G4k/uPONgkAz5z/dQeZ1crbc/aBiAKUeXsMmdYM+IM3Q8dEiS2/aA6K8J/cj3 RkTNCFYufcS5CAN6HfB6TY3dHp9oCQQVieeDOMAl9QakU2bwub4iuyqYkyQwFZ20i4Kc fiUw== X-Gm-Message-State: AOAM532IYW4+js+UZp/9I4OGMG5Pu9m5ahCpZn0PIV1jIvKglhRD0sov jStgNnKiDTZVezL9FB6fJrbMmg== X-Received: by 2002:a62:5a45:0:b029:1e5:4c81:c59 with SMTP id o66-20020a625a450000b02901e54c810c59mr9388889pfb.51.1613070066195; Thu, 11 Feb 2021 11:01:06 -0800 (PST) Received: from localhost ([2620:15c:202:1:fc92:99c:fc2f:8603]) by smtp.gmail.com with UTF8SMTPSA id a37sm6555705pgm.79.2021.02.11.11.01.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Feb 2021 11:01:05 -0800 (PST) Date: Thu, 11 Feb 2021 11:01:03 -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 On Thu, Feb 11, 2021 at 10:45:48AM -0800, Matthias Kaehlcke wrote: > 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. To let the xhci-plat driver create the platform device was suggested by Alan: https://lore.kernel.org/patchwork/patch/1313000/#1510227 Personally I would favor a standalone platform device, since it provides more flexiblity (also works for hubs connected to a non-root hub) and doesn't require cooperation from other driver, however I doubt I could convince Rob of the corresponding DT bindings.