From patchwork Fri Oct 13 07:37:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10003591 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 22C5C60325 for ; Fri, 13 Oct 2017 07:38:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11A0F28FCD for ; Fri, 13 Oct 2017 07:38:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0614528FEE; Fri, 13 Oct 2017 07:38:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5F09128FCD for ; Fri, 13 Oct 2017 07:38:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: References:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3OcEzeHWfMdIU0VB1LdD7nHO6yrIgsR2ZIWknZ5Hyzw=; b=frg4BVA1EtiBiH ZpIsHLEsW0ogAbrhmx/LOT9QpMPO+B2wEVfxvy+wnZHh/s+/srugGXvEN2WjI4WiGY3wjATJVnjZq 6VMGXIowAQMyRK0W7yT/6aIwZll53yNS3UYcNPrTuQg0r+cJwjTRyjFEW3+ZNSG0m/bYXiKsS25Zi L81p6kK53BkFJDBalBh/3fnDRY0gDq85i/UAD7Zzb1tRnYrMb9YGepogZD5DvL7Jn5SDO6mx0ySx9 sOxwf4D4YkVHGjvoa4xq7HZlfXRm0xpksrsg3drMSmpcOuRk9iEmxZIISQksnrUr1RrYNu88fTldC aOkD0HoTjLqd3uQSZ4ew==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e2uXb-0006RM-FC; Fri, 13 Oct 2017 07:37:55 +0000 Received: from mail-oi0-x241.google.com ([2607:f8b0:4003:c06::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e2uXY-0006PM-96 for linux-amlogic@lists.infradead.org; Fri, 13 Oct 2017 07:37:54 +0000 Received: by mail-oi0-x241.google.com with SMTP id f66so12952824oib.2 for ; Fri, 13 Oct 2017 00:37:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Ly0YPgA8GCrV4iG5meLqd1Js5sDb+d2bs82v71f02yQ=; b=A6GVT4vuMEFdr8T1t0WPHyq1C6QW5ont101E5igcjv/u7IABSCRQJ8Z7HKby0plUdx uluWjItioxUfjcmbZr8P6FHzg8mC4uxKbOVYFDokc9CjiDk/ov+MMctMCeG9oAH2HP+I gkZLqTCqfOy8kM3ep+epgaXIKA0iceCkix47ujqI87aFPATaIg/+KE4znEgRsfBWRdzc lv2FSNo7K1fEY5sbqgIkWgHwHAnwEm/BlNpL/PR2zq5G2NqpoxA5/rMQLtSKAnTvG39v pY7KJnv+t7/u0pmWqItegLRMuP/idmDQxC5ygTPo1hgaJ5Nb5efDQJmYbWcmcQhqZV04 Cf8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Ly0YPgA8GCrV4iG5meLqd1Js5sDb+d2bs82v71f02yQ=; b=hjdCRGhSKgM6A9Ejjwl0W81CUysQLh5QJrQHEkCBDW5Qp7RdCl4MXR4ae+xzH2ZNdS POLsx7mTK7ZMlmRH6+b1Ha3MDQsEnRvhJyBtf7sPRmO3TVty9q0eX/TC8MamCmxHW2hQ zP0wyuCbp6IDeuPOtNFd9L6pOxwG4H8YSv8pPeeFrCp8XfgnWlnGchdQ01/LOopk5Ihe 1qQb0J0+v8XTbN2wlS5R9eagVVofDtJWwJnklj482AiVE4P4dmVmHxzi0mS9tPvuoU2l qqwV41c6QavAzdcw58lSo/QN5C6zIGBdwrLojBy3QRVKWNqZ+9/mL5Uk4APJDSNjthYB KbXQ== X-Gm-Message-State: AMCzsaVkkhEs/4xYwcl51ghVztlTskpEKiKVpK5MtrJS8z3AMwTavA08 779T9kRQTLPySr5U1LeL2PkASfNn/F3fy8BrZCI= X-Google-Smtp-Source: ABhQp+R97NC5bgjlw+hTykdx835dUvq82Q9TSRCKyBUPAT5+oFN5cG6YgyelXRP7CuhvpcgcGMXb2xfehxvDlUWAPMA= X-Received: by 10.202.182.5 with SMTP id g5mr317495oif.184.1507880247757; Fri, 13 Oct 2017 00:37:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.28.152 with HTTP; Fri, 13 Oct 2017 00:37:27 -0700 (PDT) In-Reply-To: References: <20171008211713.18696-1-martin.blumenstingl@googlemail.com> <20171008211713.18696-2-martin.blumenstingl@googlemail.com> From: Arnd Bergmann Date: Fri, 13 Oct 2017 09:37:27 +0200 X-Google-Sender-Auth: D1zAUmWxbaj1zuLBORA97KdwH8s Message-ID: Subject: Re: [RFC usb-next v5 1/3] dt-bindings: usb: add the documentation for USB root-hub To: Martin Blumenstingl X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171013_003752_495227_9A272502 X-CRM114-Status: GOOD ( 19.97 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , DTML , felipe.balbi@linux.intel.com, mathias.nyman@intel.com, gregkh , linux-usb@vger.kernel.org, Rob Herring , Chunfeng Yun , "open list:ARM/Amlogic Meson SoC support" Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Oct 12, 2017 at 10:56 PM, Martin Blumenstingl wrote: > Hi Arnd, > > thank you for reviewing this patch! > > On Mon, Oct 9, 2017 at 12:24 PM, Arnd Bergmann wrote: >> On Sun, Oct 8, 2017 at 11:17 PM, Martin Blumenstingl >> wrote: >>> A USB root-hub may have several PHYs which need to be configured before >>> the root-hub starts working. >>> This adds the documentation for such a USB root-hub as well as a hint >>> regarding the child-nodes on XHCI controllers which can include the >>> roothub. >>> >>> Signed-off-by: Martin Blumenstingl >>> Acked-by: Rob Herring >> >> Have you checked that this still works with DT properties on a USB device >> that is listed in the DT? A common use-case is to provide the MAC address >> of a soldered-down USB-ethernet that lacks its own eeprom, and it seems >> you are changing the way the parent devices of that get represented, >> so the dev->of_node pointer in the USB device might no longer refer >> to the correct device. > I haven't tested the described use-case. however, this patch is not > supposed to change the binding for actual devices. > USB device numbering starts at 1, while 0 is reserved for the root-hub > (at least from what I know). before this patch there was no way to > describe the root-hub via .dts. this however is required for some > platforms that need to set up a PHY for each port on the root-hub > (Amlogic Meson GXL platform is one example: there are two ports > enabled on dwc3's root-hub with 2x USB2 and 1x USB3 PHYs) - so this > patch uses a similar binding as we already have (to describe the > devices) to describe the root-hub My point is that the DT binding does depend on the hierarchy, there is no way to find a particular device unless each parent up the chain is described correctly in DT as well and has a valid of_node pointer. It's possible that this has never worked on XHCI because of the lack of the root-hub in DT. Either way, we should ensure that it does work now and you didn't break it, so please at least test it with your patches. The patch below should be sufficient to see if any device has an of_node pointer when you add it to your DT: } Arnd diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 17681d5638ac..498d0aa0a5c0 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -647,6 +647,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent, } dev->dev.of_node = usb_of_get_child_node(parent->dev.of_node, raw_port); + dev_info(&dev->dev, "of_node %p parent %p\n", dev->dev.of_node, parent->dev.of_node); /* hub driver sets up TT records */