Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2968459ybb; Mon, 30 Mar 2020 17:16:03 -0700 (PDT) X-Google-Smtp-Source: ADFU+vteCip54/lNGAwu/B2CdWXCAl76KOSAhKbQHs/ODexpeh9lFGNXk/PIm3/uHNt0Zq5369k2 X-Received: by 2002:a9d:68c5:: with SMTP id i5mr11606643oto.266.1585613762829; Mon, 30 Mar 2020 17:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585613762; cv=none; d=google.com; s=arc-20160816; b=oiiw+ck52ir3vuatEVvHQcgt7pylVjTxmQc8T9Sl5JgExlUrzBfluh/ie/gTujQZqQ AF3YCMlr5u1J4uHrcAoQb7Ap9vyP9BzIIA/nyyZy3Tooi4U+XlNYcqYkkJT4jN10b2m5 IsHA5cgOajAOGhNlaoz1zQt+g0NiV3jQ+q5wM0zy56WlcJOHQRqyB3pMvCd1EeWhClCg Kb5T1XAGarm2shETQj9WBN8ixYvc6GOd1PGgCN8fmdBC+vKZEYSoJ1VTCvyFTytBVOPW 5p8xFegqR97oesRcN15tmLipKzd2LKy1mWxQEgTAcfD47mEDHqGCWpWBYxDYaR2KXwQj Y52g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=LWiCKzGa8y8Zmn08eRXb9UcegGnuprmyzoDhmRfe8Hk=; b=GW/HEvxalr4imDo0ZjQ/n3nuKgcM6tn3SKVuFj3BpEjgFOXlZ+mfDvGkxCvvvSuv0c VA8P0PA8E02PO2Byel79ed7MzIn3SEYFj+SB+phb1UrjVCvGoz38KULWrEXoLMk2P/lf nHqwr1tnseRYd5O73GrKnW+Ynv43mnsML83l8QKd5gz2jRy748ngBkYRdd2jsIPmi/XL raARtt/biLKj8XYfLcGguqoa+ilQzzEE/LlosPfMeTT0f221F0kd02VSO97RzNGcUlxG wgKeNJdDESWEDoKTUuJbC1SQH1J3CqSlmOATNoy3FTGPWy7Dpy9TZ4unU5MojZk1CYXR 1/Cw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c21si7620536oto.169.2020.03.30.17.15.49; Mon, 30 Mar 2020 17:16:02 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729390AbgCaAO0 (ORCPT + 99 others); Mon, 30 Mar 2020 20:14:26 -0400 Received: from kernel.crashing.org ([76.164.61.194]:33702 "EHLO kernel.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729019AbgCaAO0 (ORCPT ); Mon, 30 Mar 2020 20:14:26 -0400 Received: from localhost (gate.crashing.org [63.228.1.57]) (authenticated bits=0) by kernel.crashing.org (8.14.7/8.14.7) with ESMTP id 02V0DJbF013894 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 30 Mar 2020 19:13:23 -0500 Message-ID: <4dc3ac910c79dcca398eb5161dde44e1cc50baca.camel@kernel.crashing.org> Subject: Re: [PATCH v2 6/6] dt-bindings: usb: document aspeed vhub device ID/string properties From: Benjamin Herrenschmidt To: Rob Herring , rentao.bupt@gmail.com Cc: Felipe Balbi , Greg Kroah-Hartman , Joel Stanley , Andrew Jeffery , Chunfeng Yun , Colin Ian King , Stephen Boyd , Mark Rutland , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, taoren@fb.com Date: Tue, 31 Mar 2020 11:13:17 +1100 In-Reply-To: <20200330192347.GA6388@bogus> References: <20200315191632.12536-1-rentao.bupt@gmail.com> <20200315191632.12536-7-rentao.bupt@gmail.com> <20200330192347.GA6388@bogus> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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... > > + > > + 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. 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. 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... Cheers, Ben. > os the > Rob