Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp85197ybb; Tue, 31 Mar 2020 17:49:01 -0700 (PDT) X-Google-Smtp-Source: APiQypLtEJ2okdVJAK7PIgCLm41dMv2zNYmtBMUTdrA5kw9y5V7r03dLo15EVDseqRljkYtc8dN/ X-Received: by 2002:a05:6808:a08:: with SMTP id n8mr1147619oij.91.1585702141601; Tue, 31 Mar 2020 17:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585702141; cv=none; d=google.com; s=arc-20160816; b=q0nHzyWPIaYFIPoHA7PHr7lF06lUFoR6XnrfjGC4ZxgONFR2gOO+aCzUk1SaGjAMxp wpfJB3KgmxGA2EA0gDQkOyafBs4nPyf9BxGVHrdZFFz0Ywb9cZb5u+W6t3gYajOFdhpb ONdbliEx1RC0s8XC7h6G/lidf1jVvz7bKrMqNMGCoSHJwqTWch1zzt+/hlrRAe6Yt1nf 8uPZButkutFyUWv+kA0OiEjcKg4BcJw0V6hbzAbrN/d4TczQfZPvu+/BQ0rWMmHQW8NN ypBpBRzVxiQOC1js51l+PpJpaChtoLoYPXcUgXzw7YG1e8SuNwnGKBoiE7M9yrXnXWOx r31w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Grz3j5qN3bekOkWLBc9tIOx+lzkuYvmCGEjHfUkVS6w=; b=bnjRhbGT4wkIut7CjalrDj4R/S0ClEtVbI3ukkqp0t/RIo33kQ2IRXmX2Xp05oxlDm ks+WDtK2QvGiyBGCdr7fn29O39POv329aFgQqfw1+llc4wGqA16DLHnyz9fUYP7JPD9s /9B81YzBvQXhVmg9TuKIY5psaDPVwktck+6f9B0LN4p/DBEEsGRAuV8nXGHbdeDQbiXd M8hksi820K4B2s6saLBU8XhTkLongqo5V5IGS7a9tsXfP8RZGUmGqBfatn4r1lb62oX1 tQ+3pdWEAKLYrXhscCMh4RGbKijroC9eLe5tWjThyiUSSpUUlgQsJN5ZK1nsz1KvQUuu Y1eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pbw9SN2u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l22si110027otk.306.2020.03.31.17.48.47; Tue, 31 Mar 2020 17:49:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pbw9SN2u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731574AbgDAArx (ORCPT + 99 others); Tue, 31 Mar 2020 20:47:53 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:38288 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731331AbgDAArx (ORCPT ); Tue, 31 Mar 2020 20:47:53 -0400 Received: by mail-pl1-f193.google.com with SMTP id w3so8849931plz.5; Tue, 31 Mar 2020 17:47:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Grz3j5qN3bekOkWLBc9tIOx+lzkuYvmCGEjHfUkVS6w=; b=pbw9SN2uZr6z7NS/82qUlJyAHKLLx0o8fecHkIroHnXMV5ctnPROphGfQlBBot1HCJ 9OcK1ZODxSAfZkdboOKfCd5C/IeOTtoX6AWP9AGnjMnwMF/7ZnG6SxBatPQjXWM31rFD bj4DxdivZodaaqf4CWmsWFHmRKfVgv3Wig1D7R1wuEuoEhm07ugJ67hxbTZa73y0n32b 2GIVLDRCaIvrlBYTQprdx+bvgZ6PQXyND3bjQz/iajIWAl4AkY+9Na7JIKzDTW6ICix1 /Y3bZijNDGJd8T9XyAvaZzhhNbsG4Bdlrpm5TThQ7kHe/ac11lz2rXrGlfUtBVo4nHVo 8VnQ== 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:user-agent; bh=Grz3j5qN3bekOkWLBc9tIOx+lzkuYvmCGEjHfUkVS6w=; b=E3fj2Nt9cwHHktlsa3ug9iJHU8O8mxuhRwYjbsu1LtdZqIkAJ6UwHpoAj8bMerzlz9 QiydwwDLOuKYT3bzRljLAX8ILU83Ld18Adkdj2lxQuhPIoC236hmJmROpa0DeUjT1V6w lkLidiQ3EkrAQ+Gbt0mWiRhYUkUB6J0wFTEGVEua+nJCT5cPItAK6xqyVXrImQFeladK X0UTWosrzR0Hx5pRi6X4AWevgjOVd60MstFmGYIj/KKO+kU2Hd9G+ttaO+4Viu3CFlrC c4CQEy0qy1/5hGQQ8N6jVExjKCXRKoMVzV8fuWWlyS0mDVUfwU1BEXzCJ/UlCmiS5QSX f5yQ== X-Gm-Message-State: AGi0PuaOPj0rBFiAtw7pT891ShuDQzXZbZYQrhwtOVon8tT5wHMpshAD /QKfkYtOwGhYWjnBOw2muqE= X-Received: by 2002:a17:90a:da06:: with SMTP id e6mr1793956pjv.14.1585702070887; Tue, 31 Mar 2020 17:47:50 -0700 (PDT) Received: from taoren-ubuntu-R90MNF91 (c-24-4-25-55.hsd1.ca.comcast.net. [24.4.25.55]) by smtp.gmail.com with ESMTPSA id x188sm261705pfx.198.2020.03.31.17.47.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 31 Mar 2020 17:47:50 -0700 (PDT) Date: Tue, 31 Mar 2020 17:47:43 -0700 From: Tao Ren To: Rob Herring Cc: Benjamin Herrenschmidt , Felipe Balbi , Greg Kroah-Hartman , Joel Stanley , Andrew Jeffery , Chunfeng Yun , Colin Ian King , Stephen Boyd , Mark Rutland , Linux USB List , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linux-aspeed@lists.ozlabs.org, devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , OpenBMC Maillist , Tao Ren Subject: Re: [PATCH v2 6/6] dt-bindings: usb: document aspeed vhub device ID/string properties Message-ID: <20200401004741.GA6923@taoren-ubuntu-R90MNF91> References: <20200315191632.12536-1-rentao.bupt@gmail.com> <20200315191632.12536-7-rentao.bupt@gmail.com> <20200330192347.GA6388@bogus> <4dc3ac910c79dcca398eb5161dde44e1cc50baca.camel@kernel.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 31, 2020 at 10:21:10AM -0600, Rob Herring wrote: > On Mon, Mar 30, 2020 at 6:14 PM Benjamin Herrenschmidt > wrote: > > > > On Mon, 2020-03-30 at 13:23 -0600, Rob Herring wrote: > > > On Sun, Mar 15, 2020 at 12:16:32PM -0700, rentao.bupt@gmail.com wrote: > > > > From: Tao Ren > > > > > > > > Update device tree binding document for aspeed vhub's device IDs and > > > > string properties. > > > > > > > > Signed-off-by: Tao Ren > > > > --- > > > > No change in v2: > > > > - the patch is added into the series since v2. > > > > > > > > .../bindings/usb/aspeed,usb-vhub.yaml | 68 +++++++++++++++++++ > > > > 1 file changed, 68 insertions(+) > > > > > > > > diff --git a/Documentation/devicetree/bindings/usb/aspeed,usb-vhub.yaml b/Documentation/devicetree/bindings/usb/aspeed,usb-vhub.yaml > > > > index 06399ba0d9e4..5b2e8d867219 100644 > > > > --- a/Documentation/devicetree/bindings/usb/aspeed,usb-vhub.yaml > > > > +++ b/Documentation/devicetree/bindings/usb/aspeed,usb-vhub.yaml > > > > @@ -52,6 +52,59 @@ properties: > > > > minimum: 1 > > > > maximum: 21 > > > > > > > > + vhub-vendor-id: > > > > + description: vhub Vendor ID > > > > + allOf: > > > > + - $ref: /schemas/types.yaml#/definitions/uint32 > > > > + - maximum: 65535 > > > > + > > > > + vhub-product-id: > > > > + description: vhub Product ID > > > > + allOf: > > > > + - $ref: /schemas/types.yaml#/definitions/uint32 > > > > + - maximum: 65535 > > > > > > There's already standard 'vendor-id' and 'device-id' properties. Use > > > those. > > > > So yes and no... I don't fundamentally object but keep in mind that > > traditionally, the properties are about matching with a physical > > hardware. > > > > In this case however, we are describing a virtual piece of HW and so > > those IDs are going to be picked up to be exposed as the USB > > vendor/device of the vhub on the USB bus. > > > > Not necessarily an issue but it's more "configuration" than "matching" > > and as such, it might make sense to expose that with a prefix, though I > > would prefer something like usb-vendor-id or usb,vendor-id... > > For FDT uses, it's pretty much been configuration. It's mostly been > for PCI that I've seen these properties used. Thank you Rob and Ben for the comments. I thought about using "vendor-id" or "idVendor" prefixed with "usb", "hub" or "vhub", and I chose "vhub" just to distinguish from per-port usb devices' properties in the future. Anyways I'm very happy to update the names per your suggestions. > > > > > + > > > > + vhub-device-revision: > > > > > > Specific to USB, not vhub. > > > > Same as the above. > > > > > > + description: vhub Device Revision in binary-coded decimal > > > > + allOf: > > > > + - $ref: /schemas/types.yaml#/definitions/uint32 > > > > + - maximum: 65535 > > > > + > > > > + vhub-strings: > > > > + type: object > > > > + > > > > + properties: > > > > + '#address-cells': > > > > + const: 1 > > > > + > > > > + '#size-cells': > > > > + const: 0 > > > > + > > > > + patternProperties: > > > > + '^string@[0-9a-f]+$': > > > > + type: object > > > > + description: string descriptors of the specific language > > > > + > > > > + properties: > > > > + reg: > > > > + maxItems: 1 > > > > + description: 16-bit Language Identifier defined by USB-IF > > > > + > > > > + manufacturer: > > > > + description: vhub manufacturer > > > > + allOf: > > > > + - $ref: /schemas/types.yaml#/definitions/string > > > > + > > > > + product: > > > > + description: vhub product name > > > > + allOf: > > > > + - $ref: /schemas/types.yaml#/definitions/string > > > > + > > > > + serial-number: > > > > + description: vhub device serial number > > > > + allOf: > > > > + - $ref: /schemas/types.yaml#/definitions/string > > > > > > For all of this, it's USB specific, not vhub specific. I'm not sure this > > > is the right approach. It might be better to just define properties > > > which are just raw USB descriptors rather than inventing some DT format > > > that then has to be converted into USB descriptors. > > > > Raw blob in the DT is rather annoying and leads to hard to parse stuff > > for both humans and scripts. The main strenght of the DT is it's easy > > to read and manipulate. > > True, and I'd certainly agree when we're talking about some vendor > specific blob. but there's already code/tools to parse USB > descriptors. > > > Also not the entire descriptor is configurable this way. > > > > That said, it could be that using the DT for the above is overkill and > > instead, we should consider a configfs like the rest of USB gadget. > > Though it isn't obvious how to do that, the current gadget stuff > > doesn't really "fit" what we need here. > > Surely the descriptor building code can be shared at a minimum. > > Regardless of whether gadget configfs fits, usually it is pretty clear > whether something belongs in DT or userspace. That should be decided > first. > > > Maybe we could expose the port as UDCs but not actually expose them on > > the bus until the hub is "activated" via a special configfs entry... > > If control of the hub is done by userspace, I'd think configuration > should be there too. > > Rob Perhaps it's my lack of greater knowledge in gadget/dt areas, and I'm not quite clear what would be the recommended/accepted approach for this case. I'm looking forward for more suggestions. Cheers, Tao