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 X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 824DAC388F9 for ; Wed, 11 Nov 2020 09:34:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E176C206CA for ; Wed, 11 Nov 2020 09:34:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="sdXPT9uf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727238AbgKKJe1 (ORCPT ); Wed, 11 Nov 2020 04:34:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:60774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727187AbgKKJeY (ORCPT ); Wed, 11 Nov 2020 04:34:24 -0500 Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BE41920759; Wed, 11 Nov 2020 09:34:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605087263; bh=W9LKJJA9td+bZqyMuy9lW4F+N9UwVvkc4npiuY6/nL8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=sdXPT9ufwr9fVZcL/j8i0rSkPmF0K8kpJ0B3ps32DH54CpwRWCpudFmVohdzuLLqI mHImJstvBqkfY7Bv9QjqAwcj6zjhETFN9xiOuLzk89U/QDTQzxtFAaQVcY7piZs788 ANoy8zWl2BQ66ujk5xvfZlBDd0yTXXNHLJG4NJKQ= Received: by mail-oi1-f171.google.com with SMTP id k26so1527505oiw.0; Wed, 11 Nov 2020 01:34:23 -0800 (PST) X-Gm-Message-State: AOAM531/tfu1fmxpW1CHqwRJIi44O8gJNCAD+Cj1Condi6uFMQwFLMB/ QBhDfDkRC1g74x5gltk9ujcWlqjJ+jH95NnpMF8= X-Google-Smtp-Source: ABdhPJxSx93RRc8sf7gftr2sW8DQOQItwMQjHP/P+aqjoIbJAaovKFXVmGh+T6eO80PhsSh1WpQNCpdbCpErwfeE5Gs= X-Received: by 2002:aca:6004:: with SMTP id u4mr1701769oib.8.1605087262641; Wed, 11 Nov 2020 01:34:22 -0800 (PST) MIME-Version: 1.0 References: <20201111090853.14112-1-Sergey.Semin@baikalelectronics.ru> <20201111090853.14112-11-Sergey.Semin@baikalelectronics.ru> <20201111091628.GC4050@kozik-lap> <20201111093213.gio6mrowjvmvnzoi@mobilestation> In-Reply-To: <20201111093213.gio6mrowjvmvnzoi@mobilestation> From: Krzysztof Kozlowski Date: Wed, 11 Nov 2020 10:34:10 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema To: Serge Semin Cc: Serge Semin , Mathias Nyman , Felipe Balbi , Greg Kroah-Hartman , Rob Herring , Alexey Malahov , Pavel Parkhomenko , Andy Gross , Bjorn Andersson , Manu Gautam , Roger Quadros , Lad Prabhakar , Yoshihiro Shimoda , Neil Armstrong , Kevin Hilman , Martin Blumenstingl , Chunfeng Yun , linux-arm-kernel@lists.infradead.org, linux-snps-arc@lists.infradead.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 11 Nov 2020 at 10:32, Serge Semin wrote: > > On Wed, Nov 11, 2020 at 10:16:28AM +0100, Krzysztof Kozlowski wrote: > > On Wed, Nov 11, 2020 at 12:08:45PM +0300, Serge Semin wrote: > > > DWC USB3 DT node is supposed to be compliant with the Generic xHCI > > > Controller schema, but with additional vendor-specific properties, the > > > controller-specific reference clocks and PHYs. So let's convert the > > > currently available legacy text-based DWC USB3 bindings to the DT schema > > > and make sure the DWC USB3 nodes are also validated against the > > > usb-xhci.yaml schema. > > > > > > Note we have to discard the nodename restriction of being prefixed with > > > "dwc3@" string, since in accordance with the usb-hcd.yaml schema USB nodes > > > are supposed to be named as "^usb(@.*)". > > > > > > Signed-off-by: Serge Semin > > > > > > --- > > > > > > Changelog v2: > > > - Discard '|' from the descriptions, since we don't need to preserve > > > the text formatting in any of them. > > > - Drop quotes from around the string constants. > > > - Fix the "clock-names" prop description to be referring the enumerated > > > clock-names instead of the ones from the Databook. > > > > > > Changelog v3: > > > - Apply usb-xhci.yaml# schema only if the controller is supposed to work > > > as either host or otg. > > > > > > Changelog v4: > > > - Apply usb-drd.yaml schema first. If the controller is configured > > > to work in a gadget mode only, then apply the usb.yaml schema too, > > > otherwise apply the usb-xhci.yaml schema. > > > - Discard the Rob'es Reviewed-by tag. Please review the patch one more > > > time. > > > --- > > > .../devicetree/bindings/usb/dwc3.txt | 125 -------- > > > .../devicetree/bindings/usb/snps,dwc3.yaml | 303 ++++++++++++++++++ > > > 2 files changed, 303 insertions(+), 125 deletions(-) > > > delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt > > > create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt > > > deleted file mode 100644 > > > index d03edf9d3935..000000000000 > > > --- a/Documentation/devicetree/bindings/usb/dwc3.txt > > > +++ /dev/null > > > @@ -1,125 +0,0 @@ > > > -synopsys DWC3 CORE > > > - > > > -DWC3- USB3 CONTROLLER. Complies to the generic USB binding properties > > > - as described in 'usb/generic.txt' > > > - > > > -Required properties: > > > - - compatible: must be "snps,dwc3" > > > - - reg : Address and length of the register set for the device > > > - - interrupts: Interrupts used by the dwc3 controller. > > > > - - clock-names: list of clock names. Ideally should be "ref", > > > - "bus_early", "suspend" but may be less or more. > > > - - clocks: list of phandle and clock specifier pairs corresponding to > > > - entries in the clock-names property. > > > - > > > -Exception for clocks: > > > - clocks are optional if the parent node (i.e. glue-layer) is compatible to > > > - one of the following: > > > - "cavium,octeon-7130-usb-uctl" > > > - "qcom,dwc3" > > > - "samsung,exynos5250-dwusb3" > > > - "samsung,exynos5433-dwusb3" > > > - "samsung,exynos7-dwusb3" > > > - "sprd,sc9860-dwc3" > > > - "st,stih407-dwc3" > > > - "ti,am437x-dwc3" > > > - "ti,dwc3" > > > - "ti,keystone-dwc3" > > > - "rockchip,rk3399-dwc3" > > > - "xlnx,zynqmp-dwc3" > > > > What happened with this part of dtschema? It sees you removed it. > > You meant "bindings", right? > > I don't think it's a good idea to implement that weak binding in the > generic DWC USB3 DT schema. Of course I could have created it under > the allOf conditional schema and stuff. But in that case we would have > needed to support the clock-related vendor-specific peculiarities in > both the generic DWC USB3 DT schema and in the vendor-specific binding > files. That wouldn't be that maintainable. As I see it all the > vendor-specific clock requirements should be reflected in the > glue-node DT schema. The DWC USB3 node binding just declares the > clocks as optional. Moreover the DWC USB3 driver also considers them > as optional. Sure, rationale is good, but it needs to be explained in commit msg. Otherwise you state that you just "convert" but it's not a simple conversion. The meaning is changed. Best regards, Krzysztof 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 X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA0F4C388F9 for ; Wed, 11 Nov 2020 10:01:51 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D8C5420674 for ; Wed, 11 Nov 2020 10:01:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="sdXPT9uf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D8C5420674 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CWKyN4vlZzDqSC for ; Wed, 11 Nov 2020 21:01:48 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=krzk@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=default header.b=sdXPT9uf; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CWKLr44rHzDq9W for ; Wed, 11 Nov 2020 20:34:28 +1100 (AEDT) Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7B684208FE for ; Wed, 11 Nov 2020 09:34:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605087263; bh=W9LKJJA9td+bZqyMuy9lW4F+N9UwVvkc4npiuY6/nL8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=sdXPT9ufwr9fVZcL/j8i0rSkPmF0K8kpJ0B3ps32DH54CpwRWCpudFmVohdzuLLqI mHImJstvBqkfY7Bv9QjqAwcj6zjhETFN9xiOuLzk89U/QDTQzxtFAaQVcY7piZs788 ANoy8zWl2BQ66ujk5xvfZlBDd0yTXXNHLJG4NJKQ= Received: by mail-oi1-f175.google.com with SMTP id m17so1500438oie.4 for ; Wed, 11 Nov 2020 01:34:23 -0800 (PST) X-Gm-Message-State: AOAM530627t/mkTqhzj4jjXGY2PksghecgFM4ZYUjhCfkp+lCtSQaz+S d2LfAZxFumrlmGJ6NmxgSpsqPmJnO+cuSjK/j80= X-Google-Smtp-Source: ABdhPJxSx93RRc8sf7gftr2sW8DQOQItwMQjHP/P+aqjoIbJAaovKFXVmGh+T6eO80PhsSh1WpQNCpdbCpErwfeE5Gs= X-Received: by 2002:aca:6004:: with SMTP id u4mr1701769oib.8.1605087262641; Wed, 11 Nov 2020 01:34:22 -0800 (PST) MIME-Version: 1.0 References: <20201111090853.14112-1-Sergey.Semin@baikalelectronics.ru> <20201111090853.14112-11-Sergey.Semin@baikalelectronics.ru> <20201111091628.GC4050@kozik-lap> <20201111093213.gio6mrowjvmvnzoi@mobilestation> In-Reply-To: <20201111093213.gio6mrowjvmvnzoi@mobilestation> From: Krzysztof Kozlowski Date: Wed, 11 Nov 2020 10:34:10 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema To: Serge Semin Content-Type: text/plain; charset="UTF-8" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , Bjorn Andersson , Pavel Parkhomenko , Kevin Hilman , Andy Gross , Chunfeng Yun , linux-snps-arc@lists.infradead.org, devicetree@vger.kernel.org, Mathias Nyman , Martin Blumenstingl , Lad Prabhakar , Alexey Malahov , Rob Herring , linux-arm-kernel@lists.infradead.org, Roger Quadros , Felipe Balbi , Greg Kroah-Hartman , Yoshihiro Shimoda , linux-usb@vger.kernel.org, linux-mips@vger.kernel.org, Serge Semin , "linux-kernel@vger.kernel.org" , Manu Gautam , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, 11 Nov 2020 at 10:32, Serge Semin wrote: > > On Wed, Nov 11, 2020 at 10:16:28AM +0100, Krzysztof Kozlowski wrote: > > On Wed, Nov 11, 2020 at 12:08:45PM +0300, Serge Semin wrote: > > > DWC USB3 DT node is supposed to be compliant with the Generic xHCI > > > Controller schema, but with additional vendor-specific properties, the > > > controller-specific reference clocks and PHYs. So let's convert the > > > currently available legacy text-based DWC USB3 bindings to the DT schema > > > and make sure the DWC USB3 nodes are also validated against the > > > usb-xhci.yaml schema. > > > > > > Note we have to discard the nodename restriction of being prefixed with > > > "dwc3@" string, since in accordance with the usb-hcd.yaml schema USB nodes > > > are supposed to be named as "^usb(@.*)". > > > > > > Signed-off-by: Serge Semin > > > > > > --- > > > > > > Changelog v2: > > > - Discard '|' from the descriptions, since we don't need to preserve > > > the text formatting in any of them. > > > - Drop quotes from around the string constants. > > > - Fix the "clock-names" prop description to be referring the enumerated > > > clock-names instead of the ones from the Databook. > > > > > > Changelog v3: > > > - Apply usb-xhci.yaml# schema only if the controller is supposed to work > > > as either host or otg. > > > > > > Changelog v4: > > > - Apply usb-drd.yaml schema first. If the controller is configured > > > to work in a gadget mode only, then apply the usb.yaml schema too, > > > otherwise apply the usb-xhci.yaml schema. > > > - Discard the Rob'es Reviewed-by tag. Please review the patch one more > > > time. > > > --- > > > .../devicetree/bindings/usb/dwc3.txt | 125 -------- > > > .../devicetree/bindings/usb/snps,dwc3.yaml | 303 ++++++++++++++++++ > > > 2 files changed, 303 insertions(+), 125 deletions(-) > > > delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt > > > create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt > > > deleted file mode 100644 > > > index d03edf9d3935..000000000000 > > > --- a/Documentation/devicetree/bindings/usb/dwc3.txt > > > +++ /dev/null > > > @@ -1,125 +0,0 @@ > > > -synopsys DWC3 CORE > > > - > > > -DWC3- USB3 CONTROLLER. Complies to the generic USB binding properties > > > - as described in 'usb/generic.txt' > > > - > > > -Required properties: > > > - - compatible: must be "snps,dwc3" > > > - - reg : Address and length of the register set for the device > > > - - interrupts: Interrupts used by the dwc3 controller. > > > > - - clock-names: list of clock names. Ideally should be "ref", > > > - "bus_early", "suspend" but may be less or more. > > > - - clocks: list of phandle and clock specifier pairs corresponding to > > > - entries in the clock-names property. > > > - > > > -Exception for clocks: > > > - clocks are optional if the parent node (i.e. glue-layer) is compatible to > > > - one of the following: > > > - "cavium,octeon-7130-usb-uctl" > > > - "qcom,dwc3" > > > - "samsung,exynos5250-dwusb3" > > > - "samsung,exynos5433-dwusb3" > > > - "samsung,exynos7-dwusb3" > > > - "sprd,sc9860-dwc3" > > > - "st,stih407-dwc3" > > > - "ti,am437x-dwc3" > > > - "ti,dwc3" > > > - "ti,keystone-dwc3" > > > - "rockchip,rk3399-dwc3" > > > - "xlnx,zynqmp-dwc3" > > > > What happened with this part of dtschema? It sees you removed it. > > You meant "bindings", right? > > I don't think it's a good idea to implement that weak binding in the > generic DWC USB3 DT schema. Of course I could have created it under > the allOf conditional schema and stuff. But in that case we would have > needed to support the clock-related vendor-specific peculiarities in > both the generic DWC USB3 DT schema and in the vendor-specific binding > files. That wouldn't be that maintainable. As I see it all the > vendor-specific clock requirements should be reflected in the > glue-node DT schema. The DWC USB3 node binding just declares the > clocks as optional. Moreover the DWC USB3 driver also considers them > as optional. Sure, rationale is good, but it needs to be explained in commit msg. Otherwise you state that you just "convert" but it's not a simple conversion. The meaning is changed. Best regards, Krzysztof 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 X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D728C56202 for ; Wed, 11 Nov 2020 09:34:32 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8C0E820759 for ; Wed, 11 Nov 2020 09:34:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nkE2qNba"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="sdXPT9uf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8C0E820759 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.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:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KxOfeUfrEjC/qtwQ60d8wLobbBsubaDjxfvwxWcN59M=; b=nkE2qNba95cBMe3j7L307CJ66 MRZeEy9AM1TGTKyrsuqTizQQbglpyjPiCDapqRVqLTFGRn08938kGjB0rzTksWU6qucR0d6RXv6P0 +fxFiXEwbqn7Em9dKr+wZcMN1kfzGxJBJKc5UdsXnrQSD2RiPQtS7bcChMntGdAZ5VzPhb6iX3A4M 7vMjCFVTTBlIV6WZRbPvAIX2PBPmkny02crA7uX7z2ceRC5I1DIrB+831n5gtneE4CR8XmHwwi8xP xTvcDQiNeQ4K0uwgmDl/0A6bwaSYYQhVx98tBA92zkf04lSH4ahVEII3G7HcQ4Kfozq4Y4J9A3djH GChnB+LeA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcmWM-0005ZU-KI; Wed, 11 Nov 2020 09:34:30 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcmWH-0005Xr-Ap; Wed, 11 Nov 2020 09:34:26 +0000 Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6FF30207BB; Wed, 11 Nov 2020 09:34:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605087263; bh=W9LKJJA9td+bZqyMuy9lW4F+N9UwVvkc4npiuY6/nL8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=sdXPT9ufwr9fVZcL/j8i0rSkPmF0K8kpJ0B3ps32DH54CpwRWCpudFmVohdzuLLqI mHImJstvBqkfY7Bv9QjqAwcj6zjhETFN9xiOuLzk89U/QDTQzxtFAaQVcY7piZs788 ANoy8zWl2BQ66ujk5xvfZlBDd0yTXXNHLJG4NJKQ= Received: by mail-oi1-f178.google.com with SMTP id w188so1516010oib.1; Wed, 11 Nov 2020 01:34:23 -0800 (PST) X-Gm-Message-State: AOAM533oPF8z2J7TINZBH8i7jMHp/iQgRVov2ef9RUxEoGQTNWhDvh1h 88TZDiu3scvPvqcx9BKnsQgRMeKa/sbXFzH8LYs= X-Google-Smtp-Source: ABdhPJxSx93RRc8sf7gftr2sW8DQOQItwMQjHP/P+aqjoIbJAaovKFXVmGh+T6eO80PhsSh1WpQNCpdbCpErwfeE5Gs= X-Received: by 2002:aca:6004:: with SMTP id u4mr1701769oib.8.1605087262641; Wed, 11 Nov 2020 01:34:22 -0800 (PST) MIME-Version: 1.0 References: <20201111090853.14112-1-Sergey.Semin@baikalelectronics.ru> <20201111090853.14112-11-Sergey.Semin@baikalelectronics.ru> <20201111091628.GC4050@kozik-lap> <20201111093213.gio6mrowjvmvnzoi@mobilestation> In-Reply-To: <20201111093213.gio6mrowjvmvnzoi@mobilestation> From: Krzysztof Kozlowski Date: Wed, 11 Nov 2020 10:34:10 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema To: Serge Semin X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201111_043425_555661_AE260EF5 X-CRM114-Status: GOOD ( 36.50 ) X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , Bjorn Andersson , Pavel Parkhomenko , Kevin Hilman , Andy Gross , Chunfeng Yun , linux-snps-arc@lists.infradead.org, devicetree@vger.kernel.org, Mathias Nyman , Martin Blumenstingl , Lad Prabhakar , Alexey Malahov , Rob Herring , linux-arm-kernel@lists.infradead.org, Roger Quadros , Felipe Balbi , Greg Kroah-Hartman , Yoshihiro Shimoda , linux-usb@vger.kernel.org, linux-mips@vger.kernel.org, Serge Semin , "linux-kernel@vger.kernel.org" , Manu Gautam , linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org On Wed, 11 Nov 2020 at 10:32, Serge Semin wrote: > > On Wed, Nov 11, 2020 at 10:16:28AM +0100, Krzysztof Kozlowski wrote: > > On Wed, Nov 11, 2020 at 12:08:45PM +0300, Serge Semin wrote: > > > DWC USB3 DT node is supposed to be compliant with the Generic xHCI > > > Controller schema, but with additional vendor-specific properties, the > > > controller-specific reference clocks and PHYs. So let's convert the > > > currently available legacy text-based DWC USB3 bindings to the DT schema > > > and make sure the DWC USB3 nodes are also validated against the > > > usb-xhci.yaml schema. > > > > > > Note we have to discard the nodename restriction of being prefixed with > > > "dwc3@" string, since in accordance with the usb-hcd.yaml schema USB nodes > > > are supposed to be named as "^usb(@.*)". > > > > > > Signed-off-by: Serge Semin > > > > > > --- > > > > > > Changelog v2: > > > - Discard '|' from the descriptions, since we don't need to preserve > > > the text formatting in any of them. > > > - Drop quotes from around the string constants. > > > - Fix the "clock-names" prop description to be referring the enumerated > > > clock-names instead of the ones from the Databook. > > > > > > Changelog v3: > > > - Apply usb-xhci.yaml# schema only if the controller is supposed to work > > > as either host or otg. > > > > > > Changelog v4: > > > - Apply usb-drd.yaml schema first. If the controller is configured > > > to work in a gadget mode only, then apply the usb.yaml schema too, > > > otherwise apply the usb-xhci.yaml schema. > > > - Discard the Rob'es Reviewed-by tag. Please review the patch one more > > > time. > > > --- > > > .../devicetree/bindings/usb/dwc3.txt | 125 -------- > > > .../devicetree/bindings/usb/snps,dwc3.yaml | 303 ++++++++++++++++++ > > > 2 files changed, 303 insertions(+), 125 deletions(-) > > > delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt > > > create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt > > > deleted file mode 100644 > > > index d03edf9d3935..000000000000 > > > --- a/Documentation/devicetree/bindings/usb/dwc3.txt > > > +++ /dev/null > > > @@ -1,125 +0,0 @@ > > > -synopsys DWC3 CORE > > > - > > > -DWC3- USB3 CONTROLLER. Complies to the generic USB binding properties > > > - as described in 'usb/generic.txt' > > > - > > > -Required properties: > > > - - compatible: must be "snps,dwc3" > > > - - reg : Address and length of the register set for the device > > > - - interrupts: Interrupts used by the dwc3 controller. > > > > - - clock-names: list of clock names. Ideally should be "ref", > > > - "bus_early", "suspend" but may be less or more. > > > - - clocks: list of phandle and clock specifier pairs corresponding to > > > - entries in the clock-names property. > > > - > > > -Exception for clocks: > > > - clocks are optional if the parent node (i.e. glue-layer) is compatible to > > > - one of the following: > > > - "cavium,octeon-7130-usb-uctl" > > > - "qcom,dwc3" > > > - "samsung,exynos5250-dwusb3" > > > - "samsung,exynos5433-dwusb3" > > > - "samsung,exynos7-dwusb3" > > > - "sprd,sc9860-dwc3" > > > - "st,stih407-dwc3" > > > - "ti,am437x-dwc3" > > > - "ti,dwc3" > > > - "ti,keystone-dwc3" > > > - "rockchip,rk3399-dwc3" > > > - "xlnx,zynqmp-dwc3" > > > > What happened with this part of dtschema? It sees you removed it. > > You meant "bindings", right? > > I don't think it's a good idea to implement that weak binding in the > generic DWC USB3 DT schema. Of course I could have created it under > the allOf conditional schema and stuff. But in that case we would have > needed to support the clock-related vendor-specific peculiarities in > both the generic DWC USB3 DT schema and in the vendor-specific binding > files. That wouldn't be that maintainable. As I see it all the > vendor-specific clock requirements should be reflected in the > glue-node DT schema. The DWC USB3 node binding just declares the > clocks as optional. Moreover the DWC USB3 driver also considers them > as optional. Sure, rationale is good, but it needs to be explained in commit msg. Otherwise you state that you just "convert" but it's not a simple conversion. The meaning is changed. Best regards, Krzysztof _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc 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 X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 540A6C388F9 for ; Wed, 11 Nov 2020 09:34:52 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D1364206CA for ; Wed, 11 Nov 2020 09:34:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ya28JU81"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="sdXPT9uf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1364206CA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.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:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=id2lJ5p4wg/BvXQmu1pf0P3vgO1UbCw3Ed1SsW1XWUA=; b=Ya28JU81Yjj4/LE/uGL8WyUAc WiuvLBFZr/zUXCsd5FchFik5gu4VrKjoSJY9aqXEzegPVKdclyLUGoJHcxye5+FCTo8T7OKzfDtbF cmprupeddm+j9DTv9r1k1fb9x9hgNmUTrU7X6O9uN3MAICfAXOAGMVbXLNPyB9vaXQi6aiuUA+DGk dNV6lkf2+249paQklvdptlj6OXwqZfkmQCcA9z+oCFaVnyhWgM8vwocAiKZpTSlceiFhoWNIvK5mD v0lgzTiXk2dQC4pyQKvano3321Bub6godsFjVhYThtCxJKO8CnY14TffqDapdAl9ZU6tpi/X9XkT1 UEJGBR6Cg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcmWK-0005Yv-Kg; Wed, 11 Nov 2020 09:34:28 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcmWH-0005Xr-Ap; Wed, 11 Nov 2020 09:34:26 +0000 Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6FF30207BB; Wed, 11 Nov 2020 09:34:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605087263; bh=W9LKJJA9td+bZqyMuy9lW4F+N9UwVvkc4npiuY6/nL8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=sdXPT9ufwr9fVZcL/j8i0rSkPmF0K8kpJ0B3ps32DH54CpwRWCpudFmVohdzuLLqI mHImJstvBqkfY7Bv9QjqAwcj6zjhETFN9xiOuLzk89U/QDTQzxtFAaQVcY7piZs788 ANoy8zWl2BQ66ujk5xvfZlBDd0yTXXNHLJG4NJKQ= Received: by mail-oi1-f178.google.com with SMTP id w188so1516010oib.1; Wed, 11 Nov 2020 01:34:23 -0800 (PST) X-Gm-Message-State: AOAM533oPF8z2J7TINZBH8i7jMHp/iQgRVov2ef9RUxEoGQTNWhDvh1h 88TZDiu3scvPvqcx9BKnsQgRMeKa/sbXFzH8LYs= X-Google-Smtp-Source: ABdhPJxSx93RRc8sf7gftr2sW8DQOQItwMQjHP/P+aqjoIbJAaovKFXVmGh+T6eO80PhsSh1WpQNCpdbCpErwfeE5Gs= X-Received: by 2002:aca:6004:: with SMTP id u4mr1701769oib.8.1605087262641; Wed, 11 Nov 2020 01:34:22 -0800 (PST) MIME-Version: 1.0 References: <20201111090853.14112-1-Sergey.Semin@baikalelectronics.ru> <20201111090853.14112-11-Sergey.Semin@baikalelectronics.ru> <20201111091628.GC4050@kozik-lap> <20201111093213.gio6mrowjvmvnzoi@mobilestation> In-Reply-To: <20201111093213.gio6mrowjvmvnzoi@mobilestation> From: Krzysztof Kozlowski Date: Wed, 11 Nov 2020 10:34:10 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema To: Serge Semin X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201111_043425_555661_AE260EF5 X-CRM114-Status: GOOD ( 36.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , Bjorn Andersson , Pavel Parkhomenko , Kevin Hilman , Andy Gross , Chunfeng Yun , linux-snps-arc@lists.infradead.org, devicetree@vger.kernel.org, Mathias Nyman , Martin Blumenstingl , Lad Prabhakar , Alexey Malahov , Rob Herring , linux-arm-kernel@lists.infradead.org, Roger Quadros , Felipe Balbi , Greg Kroah-Hartman , Yoshihiro Shimoda , linux-usb@vger.kernel.org, linux-mips@vger.kernel.org, Serge Semin , "linux-kernel@vger.kernel.org" , Manu Gautam , linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 11 Nov 2020 at 10:32, Serge Semin wrote: > > On Wed, Nov 11, 2020 at 10:16:28AM +0100, Krzysztof Kozlowski wrote: > > On Wed, Nov 11, 2020 at 12:08:45PM +0300, Serge Semin wrote: > > > DWC USB3 DT node is supposed to be compliant with the Generic xHCI > > > Controller schema, but with additional vendor-specific properties, the > > > controller-specific reference clocks and PHYs. So let's convert the > > > currently available legacy text-based DWC USB3 bindings to the DT schema > > > and make sure the DWC USB3 nodes are also validated against the > > > usb-xhci.yaml schema. > > > > > > Note we have to discard the nodename restriction of being prefixed with > > > "dwc3@" string, since in accordance with the usb-hcd.yaml schema USB nodes > > > are supposed to be named as "^usb(@.*)". > > > > > > Signed-off-by: Serge Semin > > > > > > --- > > > > > > Changelog v2: > > > - Discard '|' from the descriptions, since we don't need to preserve > > > the text formatting in any of them. > > > - Drop quotes from around the string constants. > > > - Fix the "clock-names" prop description to be referring the enumerated > > > clock-names instead of the ones from the Databook. > > > > > > Changelog v3: > > > - Apply usb-xhci.yaml# schema only if the controller is supposed to work > > > as either host or otg. > > > > > > Changelog v4: > > > - Apply usb-drd.yaml schema first. If the controller is configured > > > to work in a gadget mode only, then apply the usb.yaml schema too, > > > otherwise apply the usb-xhci.yaml schema. > > > - Discard the Rob'es Reviewed-by tag. Please review the patch one more > > > time. > > > --- > > > .../devicetree/bindings/usb/dwc3.txt | 125 -------- > > > .../devicetree/bindings/usb/snps,dwc3.yaml | 303 ++++++++++++++++++ > > > 2 files changed, 303 insertions(+), 125 deletions(-) > > > delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt > > > create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt > > > deleted file mode 100644 > > > index d03edf9d3935..000000000000 > > > --- a/Documentation/devicetree/bindings/usb/dwc3.txt > > > +++ /dev/null > > > @@ -1,125 +0,0 @@ > > > -synopsys DWC3 CORE > > > - > > > -DWC3- USB3 CONTROLLER. Complies to the generic USB binding properties > > > - as described in 'usb/generic.txt' > > > - > > > -Required properties: > > > - - compatible: must be "snps,dwc3" > > > - - reg : Address and length of the register set for the device > > > - - interrupts: Interrupts used by the dwc3 controller. > > > > - - clock-names: list of clock names. Ideally should be "ref", > > > - "bus_early", "suspend" but may be less or more. > > > - - clocks: list of phandle and clock specifier pairs corresponding to > > > - entries in the clock-names property. > > > - > > > -Exception for clocks: > > > - clocks are optional if the parent node (i.e. glue-layer) is compatible to > > > - one of the following: > > > - "cavium,octeon-7130-usb-uctl" > > > - "qcom,dwc3" > > > - "samsung,exynos5250-dwusb3" > > > - "samsung,exynos5433-dwusb3" > > > - "samsung,exynos7-dwusb3" > > > - "sprd,sc9860-dwc3" > > > - "st,stih407-dwc3" > > > - "ti,am437x-dwc3" > > > - "ti,dwc3" > > > - "ti,keystone-dwc3" > > > - "rockchip,rk3399-dwc3" > > > - "xlnx,zynqmp-dwc3" > > > > What happened with this part of dtschema? It sees you removed it. > > You meant "bindings", right? > > I don't think it's a good idea to implement that weak binding in the > generic DWC USB3 DT schema. Of course I could have created it under > the allOf conditional schema and stuff. But in that case we would have > needed to support the clock-related vendor-specific peculiarities in > both the generic DWC USB3 DT schema and in the vendor-specific binding > files. That wouldn't be that maintainable. As I see it all the > vendor-specific clock requirements should be reflected in the > glue-node DT schema. The DWC USB3 node binding just declares the > clocks as optional. Moreover the DWC USB3 driver also considers them > as optional. Sure, rationale is good, but it needs to be explained in commit msg. Otherwise you state that you just "convert" but it's not a simple conversion. The meaning is changed. Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel