Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1645253pxb; Wed, 10 Feb 2021 13:10:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJyjG7LCKAqyrHtSLmR4YBPjt8xJ2hh4R6KPxTIGpkPdRbIgUBhMPelTGdLw+OBSLi/Sa+nh X-Received: by 2002:a17:906:a1c2:: with SMTP id bx2mr5090830ejb.138.1612991448254; Wed, 10 Feb 2021 13:10:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612991448; cv=none; d=google.com; s=arc-20160816; b=t2ELYcr8kbxfDLuxkw7cNd7Qki8+hGEXCUdcI126Ytt54sjqgKxCqK5IP3Sa+8MS5u N4s3943+f16BrBRr87hpKUSFS/A6a1bGyxBidXzIorDFR6Busx1h2U5bceUQKQS0nDEN uKt2sTLzdi5y0FxFvIyG/LnxLpK2pYKu/ADwinsMU/xSTpRvg9Dhfofn/EVFL2ic2PfO NeE9ITdKUm3mSDJhoM2lLRIDN1KFSpr+1UbduCjreJeX21tj1CtqgNiKxczVF0K8skV2 DqdPhtuVzB4A1vZYEQTTW28S+woI6L7h4NVIR0UBx2FIq34ZEDmHYvKglCQB9BASilCH a1aA== 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; bh=QxVKcMPVlZSU1s6PYt/R8Rb76zHOdHRNUhzAj/OgexQ=; b=n2JQyL4M8HoHgw5MlTsYtx6i2lI3Cp35omcjygB5KYeORN1TuuSQDOrA8Ssa08RJVx 0ItZJ8e8PQXGItbCdDoT/6IV/rwysIvP5FMkj3QMp1iIYKPU0Gnll84lkqs2pflLf7gM QFNCLDsFjO/Gnb0o5cJlHdtwTC43tFEcA4Olk9goQJT/ZWyaF2a2a+fG5IIUDcRwUrM9 F4XXzuUVUdMfTxQtZLP8FkO/jtGi8oU8UuKKyHNt8X4etMCnUIqRWMGFU4puCbE316rQ mSY3s2BrbY4eXejw+rTV2QatJld0mGesaAx+3NhdMPJ9UM6hE4eNIQtccEX/1XV+KJVY m02w== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o8si2083354ejr.84.2021.02.10.13.10.24; Wed, 10 Feb 2021 13:10:48 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232738AbhBJVHc (ORCPT + 99 others); Wed, 10 Feb 2021 16:07:32 -0500 Received: from mail-wm1-f46.google.com ([209.85.128.46]:37002 "EHLO mail-wm1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231897AbhBJVHa (ORCPT ); Wed, 10 Feb 2021 16:07:30 -0500 Received: by mail-wm1-f46.google.com with SMTP id m1so3169765wml.2; Wed, 10 Feb 2021 13:07:13 -0800 (PST) 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=QxVKcMPVlZSU1s6PYt/R8Rb76zHOdHRNUhzAj/OgexQ=; b=XjdJ0yIMtJ+ym7Zg5enTlyvGJyTMmAI5WygJ3wkc/aZe+yJbgU5XeB+TCQmRHvo7jd FW2OOFN9IvFKAAjDzp9fA8pU9PUspp4vhuhcU09LVH2fiqAJuUQq2WyMgw4hlohp/ir+ mqpscOKHsko2J35sNdiB1vG+GDEN87Lx2Ib36Ih4LI9LRsyyE67OxqZKrMutDVxBlduK u8rt8ggW1t7ZKVYoZIhsDVtPkOjSmMg6DeCVtcRWuFNJ3SGj3y9zNBYPkx/rqjnbZ2wJ mzmCi+JTpM1QqS9/th9xi4oi2Av+tahkiajraBrncuhZO2ZqjrJ3peclPBGbPhX9eDif v/0w== X-Gm-Message-State: AOAM531Ctyi533uW6qnQBoV3/8YPF/SkUwof1f7piegirz1J2aV0ztVG 747QmnsRNK3yb+NdPR6+dXc= X-Received: by 2002:a05:600c:2d44:: with SMTP id a4mr890464wmg.95.1612991207591; Wed, 10 Feb 2021 13:06:47 -0800 (PST) Received: from kozik-lap (adsl-84-226-167-205.adslplus.ch. [84.226.167.205]) by smtp.googlemail.com with ESMTPSA id w2sm4826858wmg.27.2021.02.10.13.06.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Feb 2021 13:06:46 -0800 (PST) Date: Wed, 10 Feb 2021 22:06:45 +0100 From: Krzysztof Kozlowski To: Matthias Kaehlcke Cc: Greg Kroah-Hartman , 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, Mathias Nyman Subject: Re: [PATCH v5 3/4] usb: host: xhci-plat: Create platform device for onboard hubs in probe() Message-ID: <20210210210645.xapaua7djdsvr3ca@kozik-lap> 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: <20210210091015.v5.3.I7a3a7d9d2126c34079b1cab87aa0b2ec3030f9b7@changeid> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)) { This looks hackish... what if later we have something else than hub? Another if()? What if hub could be connected to something else than XHCI controller? Best regards, Krzysztof