From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E03EC433EF for ; Mon, 27 Jun 2022 18:54:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239745AbiF0SyJ (ORCPT ); Mon, 27 Jun 2022 14:54:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237365AbiF0SyF (ORCPT ); Mon, 27 Jun 2022 14:54:05 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 45EF11094 for ; Mon, 27 Jun 2022 11:54:04 -0700 (PDT) Received: (qmail 128884 invoked by uid 1000); 27 Jun 2022 14:54:03 -0400 Date: Mon, 27 Jun 2022 14:54:03 -0400 From: Alan Stern To: Matthias Kaehlcke Cc: Doug Anderson , Greg Kroah-Hartman , Rob Herring , Frank Rowand , Mathias Nyman , Felipe Balbi , Michal Simek , LKML , Krzysztof Kozlowski , Stephen Boyd , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Bastien Nocera , Peter Chen , Ravi Chandra Sadineni , Roger Quadros , Linux USB List , Geert Uytterhoeven , Souradeep Chowdhury Subject: Re: [PATCH v22 2/3] usb: misc: Add onboard_usb_hub driver Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 27, 2022 at 11:14:47AM -0700, Matthias Kaehlcke wrote: > Maybe a bit more verbose documentation like this could help: > > Some background about the logic in this function, which can be a bit hard > to follow: > > Root hubs don't have dedicated device tree nodes, but use the node of their > HCD. The primary and secondary HCD are usually represented by a single DT > node. That means the root hubs of the primary and secondary HCD share the > same device tree node (the HCD node). As a result this function can be > called twice with the same DT node for root hubs. We only want to create a > single platform device for each physical onboard hub, hence for root hubs > the loop is only executed for the primary hub. Since the function scans By "primary hub", you mean "root hub for the primary HCD", right? This should be clarified. > through all child nodes it still creates pdevs for onboard hubs connected > to the secondary hub if needed. And likewise for "secondary hub". > > Further there must be only one platform device for onboard hubs with a > companion hub (the hub is a single physical device). To achieve this two What do you mean by "companion hub"? I think you are using the wrong word here. If you're talking about the relation between the two logical hubs (one attached to the SuperSpeed bus and one attached to the Low/Full/High-speed bus) within a physical USB-3 hub, the correct term for this is "peer". See the existing usages in hub.h, hub.c, and port.c. "Companion" refers to something completely different (i.e., the UHCI or OHCI controllers that handle Low/Full-speed connections on behalf of a High-speed EHCI controller). Alan Stern