linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] Xilinx ZynqMP USB fixes
@ 2022-01-10 20:19 Robert Hancock
  2022-01-10 20:19 ` [PATCH v3 1/5] usb: dwc3: xilinx: Fix PIPE clock selection for USB2.0 mode Robert Hancock
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Robert Hancock @ 2022-01-10 20:19 UTC (permalink / raw)
  To: linux-usb
  Cc: Thinh.Nguyen, robh+dt, devicetree, michal.simek, balbi, gregkh,
	mounika.grace.akula, manish.narani, Robert Hancock

Some fixes related to the DWC3 USB driver and Xilinx ZynqMP DWC3
wrapper driver to allow ZynqMP USB to work properly when the hardware
is configured in USB 2.0-only mode.

Changes since v2:
-additional kerneldoc fixes

Changes since v1:
-added DT binding documentation for new attribute
-kerneldoc formatting and reworded comments

Robert Hancock (5):
  usb: dwc3: xilinx: Fix PIPE clock selection for USB2.0 mode
  usb: dwc3: xilinx: Fix error handling when getting USB3 PHY
  dt-bindings: usb: dwc3: add reference clock period fractional
    adjustment
  usb: dwc3: add reference clock FLADJ configuration
  arm64: dts: zynqmp: Add DWC3 USB reference clock period configuration

 .../devicetree/bindings/usb/snps,dwc3.yaml    | 12 +++++++
 arch/arm64/boot/dts/xilinx/zynqmp.dtsi        |  4 +++
 drivers/usb/dwc3/core.c                       | 35 +++++++++++++++++++
 drivers/usb/dwc3/core.h                       |  5 +++
 drivers/usb/dwc3/dwc3-xilinx.c                | 17 +++++----
 5 files changed, 66 insertions(+), 7 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v3 1/5] usb: dwc3: xilinx: Fix PIPE clock selection for USB2.0 mode
  2022-01-10 20:19 [PATCH v3 0/5] Xilinx ZynqMP USB fixes Robert Hancock
@ 2022-01-10 20:19 ` Robert Hancock
  2022-01-10 20:19 ` [PATCH v3 2/5] usb: dwc3: xilinx: Fix error handling when getting USB3 PHY Robert Hancock
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Robert Hancock @ 2022-01-10 20:19 UTC (permalink / raw)
  To: linux-usb
  Cc: Thinh.Nguyen, robh+dt, devicetree, michal.simek, balbi, gregkh,
	mounika.grace.akula, manish.narani, Robert Hancock

It appears that the PIPE clock should not be selected when only USB 2.0
is being used in the design and no USB 3.0 reference clock is used. Fix
to set the correct value depending on whether a USB3 PHY is present.

Fixes: 84770f028fab ("usb: dwc3: Add driver for Xilinx platforms")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
---
 drivers/usb/dwc3/dwc3-xilinx.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c
index 9cc3ad701a29..3bc035376394 100644
--- a/drivers/usb/dwc3/dwc3-xilinx.c
+++ b/drivers/usb/dwc3/dwc3-xilinx.c
@@ -167,8 +167,11 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
 	/* Set PIPE Power Present signal in FPD Power Present Register*/
 	writel(FPD_POWER_PRSNT_OPTION, priv_data->regs + XLNX_USB_FPD_POWER_PRSNT);
 
-	/* Set the PIPE Clock Select bit in FPD PIPE Clock register */
-	writel(PIPE_CLK_SELECT, priv_data->regs + XLNX_USB_FPD_PIPE_CLK);
+	/* Set the PIPE Clock Select bit in FPD PIPE Clock register if a USB3
+	 * PHY is in use, deselect otherwise
+	 */
+	writel(usb3_phy ? PIPE_CLK_SELECT : PIPE_CLK_DESELECT,
+	       priv_data->regs + XLNX_USB_FPD_PIPE_CLK);
 
 	ret = reset_control_deassert(crst);
 	if (ret < 0) {
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 2/5] usb: dwc3: xilinx: Fix error handling when getting USB3 PHY
  2022-01-10 20:19 [PATCH v3 0/5] Xilinx ZynqMP USB fixes Robert Hancock
  2022-01-10 20:19 ` [PATCH v3 1/5] usb: dwc3: xilinx: Fix PIPE clock selection for USB2.0 mode Robert Hancock
@ 2022-01-10 20:19 ` Robert Hancock
  2022-01-10 20:19 ` [PATCH v3 3/5] dt-bindings: usb: dwc3: add reference clock period fractional adjustment Robert Hancock
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Robert Hancock @ 2022-01-10 20:19 UTC (permalink / raw)
  To: linux-usb
  Cc: Thinh.Nguyen, robh+dt, devicetree, michal.simek, balbi, gregkh,
	mounika.grace.akula, manish.narani, Robert Hancock

The code that looked up the USB3 PHY was ignoring all errors other than
EPROBE_DEFER in an attempt to handle the PHY not being present. Fix and
simplify the code by using devm_phy_optional_get and dev_err_probe so
that a missing PHY is not treated as an error and unexpected errors
are handled properly.

Fixes: 84770f028fab ("usb: dwc3: Add driver for Xilinx platforms")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
---
 drivers/usb/dwc3/dwc3-xilinx.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c
index 3bc035376394..3b16e7610009 100644
--- a/drivers/usb/dwc3/dwc3-xilinx.c
+++ b/drivers/usb/dwc3/dwc3-xilinx.c
@@ -102,12 +102,12 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
 	int			ret;
 	u32			reg;
 
-	usb3_phy = devm_phy_get(dev, "usb3-phy");
-	if (PTR_ERR(usb3_phy) == -EPROBE_DEFER) {
-		ret = -EPROBE_DEFER;
+	usb3_phy = devm_phy_optional_get(dev, "usb3-phy");
+	if (IS_ERR(usb3_phy)) {
+		ret = PTR_ERR(usb3_phy);
+		dev_err_probe(dev, ret,
+			      "failed to get USB3 PHY\n");
 		goto err;
-	} else if (IS_ERR(usb3_phy)) {
-		usb3_phy = NULL;
 	}
 
 	crst = devm_reset_control_get_exclusive(dev, "usb_crst");
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 3/5] dt-bindings: usb: dwc3: add reference clock period fractional adjustment
  2022-01-10 20:19 [PATCH v3 0/5] Xilinx ZynqMP USB fixes Robert Hancock
  2022-01-10 20:19 ` [PATCH v3 1/5] usb: dwc3: xilinx: Fix PIPE clock selection for USB2.0 mode Robert Hancock
  2022-01-10 20:19 ` [PATCH v3 2/5] usb: dwc3: xilinx: Fix error handling when getting USB3 PHY Robert Hancock
@ 2022-01-10 20:19 ` Robert Hancock
  2022-01-11 15:14   ` Rob Herring
  2022-01-10 20:19 ` [PATCH v3 4/5] usb: dwc3: add reference clock FLADJ configuration Robert Hancock
  2022-01-10 20:19 ` [PATCH v3 5/5] arm64: dts: zynqmp: Add DWC3 USB reference clock period configuration Robert Hancock
  4 siblings, 1 reply; 12+ messages in thread
From: Robert Hancock @ 2022-01-10 20:19 UTC (permalink / raw)
  To: linux-usb
  Cc: Thinh.Nguyen, robh+dt, devicetree, michal.simek, balbi, gregkh,
	mounika.grace.akula, manish.narani, Robert Hancock

Document the new snps,ref-clock-fladj property which can be used to set
the fractional portion of the reference clock period.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
---
 Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
index 25ac2c93dc6c..88d8d831e04a 100644
--- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
+++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
@@ -260,6 +260,18 @@ properties:
     minimum: 1
     maximum: 0x3ff
 
+  snps,ref-clock-fladj:
+    description:
+      Value for GFLADJ_REFCLK_FLADJ field of GFLADJ register for the
+      fractional portion of the reference clock period in nanoseconds,
+      when the hardware set default does not match the actual
+      clock. Calculated via
+      ((125000/ref_clk_period_integer)-(125000/ref_clk_period)) * ref_clk_period
+      where ref_clk_period_integer is the period specified in GUCTL_REFCLKPER and
+      ref_clk_period is the period including fractional value.
+    minimum: 0
+    maximum: 124999
+
   snps,rx-thr-num-pkt-prd:
     description:
       Periodic ESS RX packet threshold count (host mode only). Set this and
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 4/5] usb: dwc3: add reference clock FLADJ configuration
  2022-01-10 20:19 [PATCH v3 0/5] Xilinx ZynqMP USB fixes Robert Hancock
                   ` (2 preceding siblings ...)
  2022-01-10 20:19 ` [PATCH v3 3/5] dt-bindings: usb: dwc3: add reference clock period fractional adjustment Robert Hancock
@ 2022-01-10 20:19 ` Robert Hancock
  2022-01-10 20:19 ` [PATCH v3 5/5] arm64: dts: zynqmp: Add DWC3 USB reference clock period configuration Robert Hancock
  4 siblings, 0 replies; 12+ messages in thread
From: Robert Hancock @ 2022-01-10 20:19 UTC (permalink / raw)
  To: linux-usb
  Cc: Thinh.Nguyen, robh+dt, devicetree, michal.simek, balbi, gregkh,
	mounika.grace.akula, manish.narani, Robert Hancock

Previously a device tree property was added to allow overriding the
reference clock period parameter if the default value used was incorrect.
However, there is another register field, GFLADJ_REFCLK_FLADJ, which
reflects the fractional nanosecond portion of the reference clock
period. Add a snps,ref-clock-fladj property to allow configuring this
as well.

On the Xilinx ZynqMP platform, the reference clock appears to always
be 20 MHz, giving a clock period of 50 ns. However, the default value
of GFLADJ_REFCLK_FLADJ was 1008 rather than 0 as it should have been,
which prevented many USB devices from functioning properly. The
psu_init code run by the Xilinx first-stage boot loader sets this
value to 0, however when the controller is reset by the dwc3-xilinx
layer, the incorrect default value is restored. This configuration
property allows ensuring that the correct value is always used.

Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
---
 drivers/usb/dwc3/core.c | 35 +++++++++++++++++++++++++++++++++++
 drivers/usb/dwc3/core.h |  5 +++++
 2 files changed, 40 insertions(+)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index f4c09951b517..ad224fb8088e 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -359,6 +359,37 @@ static void dwc3_ref_clk_period(struct dwc3 *dwc)
 }
 
 
+/**
+ * dwc3_ref_clk_fladj - Reference clock period adjustment configuration
+ * @dwc: Pointer to our controller context structure
+ *
+ * GFLADJ_REFCLK_FLADJ should be set based on the fractional portion of the
+ * reference clock period, where the integer portion is set in GUCTL_REFCLKPER.
+ * Calculated as: ((125000/ref_clk_period_integer)-(125000/ref_clk_period)) * ref_clk_period
+ * where ref_clk_period_integer is the period specified in GUCTL_REFCLKPER and
+ * ref_clk_period is the period including fractional value.
+ * This value can be specified in the device tree if the default value is incorrect.
+ * Note that 0 is a valid value.
+ */
+static void dwc3_ref_clk_fladj(struct dwc3 *dwc)
+{
+	u32 reg;
+	u32 reg_new;
+
+	if (DWC3_VER_IS_PRIOR(DWC3, 250A))
+		return;
+
+	if (!dwc->ref_clk_fladj_set)
+		return;
+
+	reg = dwc3_readl(dwc->regs, DWC3_GFLADJ);
+	reg_new = reg & ~DWC3_GFLADJ_REFCLK_FLADJ_MASK;
+	reg_new |= FIELD_PREP(DWC3_GFLADJ_REFCLK_FLADJ_MASK, dwc->ref_clk_fladj);
+	if (reg_new != reg)
+		dwc3_writel(dwc->regs, DWC3_GFLADJ, reg_new);
+}
+
+
 /**
  * dwc3_free_one_event_buffer - Frees one event buffer
  * @dwc: Pointer to our controller context structure
@@ -1033,6 +1064,7 @@ static int dwc3_core_init(struct dwc3 *dwc)
 
 	/* Adjust Reference Clock Period */
 	dwc3_ref_clk_period(dwc);
+	dwc3_ref_clk_fladj(dwc);
 
 	dwc3_set_incr_burst_type(dwc);
 
@@ -1418,6 +1450,9 @@ static void dwc3_get_properties(struct dwc3 *dwc)
 				 &dwc->fladj);
 	device_property_read_u32(dev, "snps,ref-clock-period-ns",
 				 &dwc->ref_clk_per);
+	if (!device_property_read_u32(dev, "snps,ref-clock-fladj",
+				      &dwc->ref_clk_fladj))
+		dwc->ref_clk_fladj_set = true;
 
 	dwc->dis_metastability_quirk = device_property_read_bool(dev,
 				"snps,dis_metastability_quirk");
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index e1cc3f7398fb..5011296786de 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -388,6 +388,7 @@
 /* Global Frame Length Adjustment Register */
 #define DWC3_GFLADJ_30MHZ_SDBND_SEL		BIT(7)
 #define DWC3_GFLADJ_30MHZ_MASK			0x3f
+#define DWC3_GFLADJ_REFCLK_FLADJ_MASK		0x3fff00
 
 /* Global User Control Register*/
 #define DWC3_GUCTL_REFCLKPER_MASK		0xffc00000
@@ -985,6 +986,8 @@ struct dwc3_scratchpad_array {
  * @regs_size: address space size
  * @fladj: frame length adjustment
  * @ref_clk_per: reference clock period configuration
+ * @ref_clk_fladj_set: whether ref_clk_fladj value is set/valid
+ * @ref_clk_fladj: reference clock period fractional adjustment
  * @irq_gadget: peripheral controller's IRQ number
  * @otg_irq: IRQ number for OTG IRQs
  * @current_otg_role: current role of operation while using the OTG block
@@ -1166,6 +1169,8 @@ struct dwc3 {
 
 	u32			fladj;
 	u32			ref_clk_per;
+	bool			ref_clk_fladj_set;
+	u32			ref_clk_fladj;
 	u32			irq_gadget;
 	u32			otg_irq;
 	u32			current_otg_role;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 5/5] arm64: dts: zynqmp: Add DWC3 USB reference clock period configuration
  2022-01-10 20:19 [PATCH v3 0/5] Xilinx ZynqMP USB fixes Robert Hancock
                   ` (3 preceding siblings ...)
  2022-01-10 20:19 ` [PATCH v3 4/5] usb: dwc3: add reference clock FLADJ configuration Robert Hancock
@ 2022-01-10 20:19 ` Robert Hancock
  4 siblings, 0 replies; 12+ messages in thread
From: Robert Hancock @ 2022-01-10 20:19 UTC (permalink / raw)
  To: linux-usb
  Cc: Thinh.Nguyen, robh+dt, devicetree, michal.simek, balbi, gregkh,
	mounika.grace.akula, manish.narani, Robert Hancock

Set the reference clock period and FLADJ fields in the DWC3 USB driver
to 50ns with no fractional portion to match the ZynqMP configuration.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
---
 arch/arm64/boot/dts/xilinx/zynqmp.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi
index 74e66443e4ce..2f531707d5d4 100644
--- a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi
+++ b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi
@@ -828,6 +828,8 @@ dwc3_0: usb@fe200000 {
 				#stream-id-cells = <1>;
 				iommus = <&smmu 0x860>;
 				snps,quirk-frame-length-adjustment = <0x20>;
+				snps,ref-clock-period-ns = <50>;
+				snps,ref-clock-fladj = <0>;
 				/* dma-coherent; */
 			};
 		};
@@ -855,6 +857,8 @@ dwc3_1: usb@fe300000 {
 				#stream-id-cells = <1>;
 				iommus = <&smmu 0x861>;
 				snps,quirk-frame-length-adjustment = <0x20>;
+				snps,ref-clock-period-ns = <50>;
+				snps,ref-clock-fladj = <0>;
 				/* dma-coherent; */
 			};
 		};
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 3/5] dt-bindings: usb: dwc3: add reference clock period fractional adjustment
  2022-01-10 20:19 ` [PATCH v3 3/5] dt-bindings: usb: dwc3: add reference clock period fractional adjustment Robert Hancock
@ 2022-01-11 15:14   ` Rob Herring
  2022-01-12 16:53     ` Robert Hancock
  0 siblings, 1 reply; 12+ messages in thread
From: Rob Herring @ 2022-01-11 15:14 UTC (permalink / raw)
  To: Robert Hancock
  Cc: robh+dt, devicetree, michal.simek, Thinh.Nguyen,
	mounika.grace.akula, manish.narani, balbi, linux-usb, gregkh

On Mon, 10 Jan 2022 14:19:34 -0600, Robert Hancock wrote:
> Document the new snps,ref-clock-fladj property which can be used to set
> the fractional portion of the reference clock period.
> 
> Signed-off-by: Robert Hancock <robert.hancock@calian.com>
> ---
>  Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
schemas/usb/snps,dwc3.yaml: ignoring, error in schema: properties: snps,ref-clock-fladj
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/snps,dwc3.yaml: properties:snps,ref-clock-fladj: 'oneOf' conditional failed, one must be fixed:
	'type' is a required property
		hint: A vendor boolean property can use "type: boolean"
	Additional properties are not allowed ('minimum', 'maximum' were unexpected)
		hint: A vendor boolean property can use "type: boolean"
	/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/snps,dwc3.yaml: properties:snps,ref-clock-fladj: 'oneOf' conditional failed, one must be fixed:
		'enum' is a required property
		'const' is a required property
		hint: A vendor string property with exact values has an implicit type
		from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
	/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/snps,dwc3.yaml: properties:snps,ref-clock-fladj: 'oneOf' conditional failed, one must be fixed:
		'$ref' is a required property
		'allOf' is a required property
		hint: A vendor property needs a $ref to types.yaml
		from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
	hint: Vendor specific properties must have a type and description unless they have a defined, common suffix.
	from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/snps,dwc3.yaml: ignoring, error in schema: properties: snps,ref-clock-fladj
make[1]: *** Deleting file 'Documentation/devicetree/bindings/usb/qcom,dwc3.example.dt.yaml'
schemas/usb/snps,dwc3.yaml: ignoring, error in schema: properties: snps,ref-clock-fladj
Traceback (most recent call last):
  File "/usr/local/bin/dt-validate", line 170, in <module>
    sg.check_trees(filename, testtree)
  File "/usr/local/bin/dt-validate", line 119, in check_trees
    self.check_subtree(dt, subtree, False, "/", "/", filename)
  File "/usr/local/bin/dt-validate", line 110, in check_subtree
    self.check_subtree(tree, value, disabled, name, fullname + name, filename)
  File "/usr/local/bin/dt-validate", line 110, in check_subtree
    self.check_subtree(tree, value, disabled, name, fullname + name, filename)
  File "/usr/local/bin/dt-validate", line 110, in check_subtree
    self.check_subtree(tree, value, disabled, name, fullname + name, filename)
  File "/usr/local/bin/dt-validate", line 105, in check_subtree
    self.check_node(tree, subtree, disabled, nodename, fullname, filename)
  File "/usr/local/bin/dt-validate", line 49, in check_node
    errors = sorted(dtschema.DTValidator(schema).iter_errors(node), key=lambda e: e.linecol)
  File "/usr/local/lib/python3.8/dist-packages/dtschema/lib.py", line 768, in iter_errors
    for error in super().iter_errors(instance, _schema):
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py", line 226, in iter_errors
    for error in errors:
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/_validators.py", line 25, in patternProperties
    yield from validator.descend(
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py", line 242, in descend
    for error in self.evolve(schema=schema).iter_errors(instance):
  File "/usr/local/lib/python3.8/dist-packages/dtschema/lib.py", line 768, in iter_errors
    for error in super().iter_errors(instance, _schema):
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py", line 226, in iter_errors
    for error in errors:
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/_validators.py", line 298, in ref
    yield from validator.descend(instance, resolved)
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py", line 242, in descend
    for error in self.evolve(schema=schema).iter_errors(instance):
  File "/usr/local/lib/python3.8/dist-packages/dtschema/lib.py", line 768, in iter_errors
    for error in super().iter_errors(instance, _schema):
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py", line 216, in iter_errors
    scope = id_of(_schema)
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py", line 93, in _id_of
    return schema.get("$id", "")
AttributeError: 'NoneType' object has no attribute 'get'
make[1]: *** [scripts/Makefile.lib:373: Documentation/devicetree/bindings/usb/qcom,dwc3.example.dt.yaml] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** Deleting file 'Documentation/devicetree/bindings/usb/fsl,imx8mp-dwc3.example.dt.yaml'
schemas/usb/snps,dwc3.yaml: ignoring, error in schema: properties: snps,ref-clock-fladj
Traceback (most recent call last):
  File "/usr/local/bin/dt-validate", line 170, in <module>
    sg.check_trees(filename, testtree)
  File "/usr/local/bin/dt-validate", line 119, in check_trees
    self.check_subtree(dt, subtree, False, "/", "/", filename)
  File "/usr/local/bin/dt-validate", line 110, in check_subtree
    self.check_subtree(tree, value, disabled, name, fullname + name, filename)
  File "/usr/local/bin/dt-validate", line 110, in check_subtree
    self.check_subtree(tree, value, disabled, name, fullname + name, filename)
  File "/usr/local/bin/dt-validate", line 105, in check_subtree
    self.check_node(tree, subtree, disabled, nodename, fullname, filename)
  File "/usr/local/bin/dt-validate", line 49, in check_node
    errors = sorted(dtschema.DTValidator(schema).iter_errors(node), key=lambda e: e.linecol)
  File "/usr/local/lib/python3.8/dist-packages/dtschema/lib.py", line 768, in iter_errors
    for error in super().iter_errors(instance, _schema):
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py", line 226, in iter_errors
    for error in errors:
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/_validators.py", line 25, in patternProperties
    yield from validator.descend(
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py", line 242, in descend
    for error in self.evolve(schema=schema).iter_errors(instance):
  File "/usr/local/lib/python3.8/dist-packages/dtschema/lib.py", line 768, in iter_errors
    for error in super().iter_errors(instance, _schema):
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py", line 226, in iter_errors
    for error in errors:
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/_validators.py", line 298, in ref
    yield from validator.descend(instance, resolved)
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py", line 242, in descend
    for error in self.evolve(schema=schema).iter_errors(instance):
  File "/usr/local/lib/python3.8/dist-packages/dtschema/lib.py", line 768, in iter_errors
    for error in super().iter_errors(instance, _schema):
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py", line 216, in iter_errors
    scope = id_of(_schema)
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py", line 93, in _id_of
    return schema.get("$id", "")
AttributeError: 'NoneType' object has no attribute 'get'
make[1]: *** [scripts/Makefile.lib:373: Documentation/devicetree/bindings/usb/fsl,imx8mp-dwc3.example.dt.yaml] Error 1
make[1]: *** Deleting file 'Documentation/devicetree/bindings/usb/intel,keembay-dwc3.example.dt.yaml'
schemas/usb/snps,dwc3.yaml: ignoring, error in schema: properties: snps,ref-clock-fladj
Traceback (most recent call last):
  File "/usr/local/bin/dt-validate", line 170, in <module>
    sg.check_trees(filename, testtree)
  File "/usr/local/bin/dt-validate", line 119, in check_trees
    self.check_subtree(dt, subtree, False, "/", "/", filename)
  File "/usr/local/bin/dt-validate", line 110, in check_subtree
    self.check_subtree(tree, value, disabled, name, fullname + name, filename)
  File "/usr/local/bin/dt-validate", line 110, in check_subtree
    self.check_subtree(tree, value, disabled, name, fullname + name, filename)
  File "/usr/local/bin/dt-validate", line 105, in check_subtree
    self.check_node(tree, subtree, disabled, nodename, fullname, filename)
  File "/usr/local/bin/dt-validate", line 49, in check_node
    errors = sorted(dtschema.DTValidator(schema).iter_errors(node), key=lambda e: e.linecol)
  File "/usr/local/lib/python3.8/dist-packages/dtschema/lib.py", line 768, in iter_errors
    for error in super().iter_errors(instance, _schema):
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py", line 226, in iter_errors
    for error in errors:
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/_validators.py", line 25, in patternProperties
    yield from validator.descend(
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py", line 242, in descend
    for error in self.evolve(schema=schema).iter_errors(instance):
  File "/usr/local/lib/python3.8/dist-packages/dtschema/lib.py", line 768, in iter_errors
    for error in super().iter_errors(instance, _schema):
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py", line 226, in iter_errors
    for error in errors:
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/_validators.py", line 298, in ref
    yield from validator.descend(instance, resolved)
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py", line 242, in descend
    for error in self.evolve(schema=schema).iter_errors(instance):
  File "/usr/local/lib/python3.8/dist-packages/dtschema/lib.py", line 768, in iter_errors
    for error in super().iter_errors(instance, _schema):
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py", line 216, in iter_errors
    scope = id_of(_schema)
  File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py", line 93, in _id_of
    return schema.get("$id", "")
AttributeError: 'NoneType' object has no attribute 'get'
make[1]: *** [scripts/Makefile.lib:373: Documentation/devicetree/bindings/usb/intel,keembay-dwc3.example.dt.yaml] Error 1
make: *** [Makefile:1413: dt_binding_check] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/1578106

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 3/5] dt-bindings: usb: dwc3: add reference clock period fractional adjustment
  2022-01-11 15:14   ` Rob Herring
@ 2022-01-12 16:53     ` Robert Hancock
  2022-01-12 19:46       ` Rob Herring
  0 siblings, 1 reply; 12+ messages in thread
From: Robert Hancock @ 2022-01-12 16:53 UTC (permalink / raw)
  To: robh
  Cc: robh+dt, linux-usb, mounika.grace.akula, devicetree,
	Thinh.Nguyen, michal.simek, manish.narani, balbi, gregkh

On Tue, 2022-01-11 at 09:14 -0600, Rob Herring wrote:
> On Mon, 10 Jan 2022 14:19:34 -0600, Robert Hancock wrote:
> > Document the new snps,ref-clock-fladj property which can be used to set
> > the fractional portion of the reference clock period.
> > 
> > Signed-off-by: Robert Hancock <robert.hancock@calian.com>
> > ---
> >  Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> > 
> 
> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> on your patch (DT_CHECKER_FLAGS is new in v5.13):
> 
> yamllint warnings/errors:
> 
> dtschema/dtc warnings/errors:
> schemas/usb/snps,dwc3.yaml: ignoring, error in schema: properties: snps,ref-
> clock-fladj

I'm assuming this schema file needs to be updated, but I'm not sure where it
lives? I don't see such a file in the devicetree-org/dt-schema repo?

> /builds/robherring/linux-dt-
> review/Documentation/devicetree/bindings/usb/snps,dwc3.yaml:
> properties:snps,ref-clock-fladj: 'oneOf' conditional failed, one must be
> fixed:
> 	'type' is a required property
> 		hint: A vendor boolean property can use "type: boolean"
> 	Additional properties are not allowed ('minimum', 'maximum' were
> unexpected)
> 		hint: A vendor boolean property can use "type: boolean"
> 	/builds/robherring/linux-dt-
> review/Documentation/devicetree/bindings/usb/snps,dwc3.yaml:
> properties:snps,ref-clock-fladj: 'oneOf' conditional failed, one must be
> fixed:
> 		'enum' is a required property
> 		'const' is a required property
> 		hint: A vendor string property with exact values has an
> implicit type
> 		from schema $id: 
> https://urldefense.com/v3/__http://devicetree.org/meta-schemas/vendor-props.yaml*__;Iw!!IOGos0k!22HR18vQNpccp4Fe5xDTXtAO4G0fx0WhklLyKtGpjxDp2x3vJVRk7_o5zjwAxz-pCbw$
>  
> 	/builds/robherring/linux-dt-
> review/Documentation/devicetree/bindings/usb/snps,dwc3.yaml:
> properties:snps,ref-clock-fladj: 'oneOf' conditional failed, one must be
> fixed:
> 		'$ref' is a required property
> 		'allOf' is a required property
> 		hint: A vendor property needs a $ref to types.yaml
> 		from schema $id: 
> https://urldefense.com/v3/__http://devicetree.org/meta-schemas/vendor-props.yaml*__;Iw!!IOGos0k!22HR18vQNpccp4Fe5xDTXtAO4G0fx0WhklLyKtGpjxDp2x3vJVRk7_o5zjwAxz-pCbw$
>  
> 	hint: Vendor specific properties must have a type and description
> unless they have a defined, common suffix.
> 	from schema $id: 
> https://urldefense.com/v3/__http://devicetree.org/meta-schemas/vendor-props.yaml*__;Iw!!IOGos0k!22HR18vQNpccp4Fe5xDTXtAO4G0fx0WhklLyKtGpjxDp2x3vJVRk7_o5zjwAxz-pCbw$
>  
> /builds/robherring/linux-dt-
> review/Documentation/devicetree/bindings/usb/snps,dwc3.yaml: ignoring, error
> in schema: properties: snps,ref-clock-fladj
> make[1]: *** Deleting file
> 'Documentation/devicetree/bindings/usb/qcom,dwc3.example.dt.yaml'
> schemas/usb/snps,dwc3.yaml: ignoring, error in schema: properties: snps,ref-
> clock-fladj
> Traceback (most recent call last):
>   File "/usr/local/bin/dt-validate", line 170, in <module>
>     sg.check_trees(filename, testtree)
>   File "/usr/local/bin/dt-validate", line 119, in check_trees
>     self.check_subtree(dt, subtree, False, "/", "/", filename)
>   File "/usr/local/bin/dt-validate", line 110, in check_subtree
>     self.check_subtree(tree, value, disabled, name, fullname + name,
> filename)
>   File "/usr/local/bin/dt-validate", line 110, in check_subtree
>     self.check_subtree(tree, value, disabled, name, fullname + name,
> filename)
>   File "/usr/local/bin/dt-validate", line 110, in check_subtree
>     self.check_subtree(tree, value, disabled, name, fullname + name,
> filename)
>   File "/usr/local/bin/dt-validate", line 105, in check_subtree
>     self.check_node(tree, subtree, disabled, nodename, fullname, filename)
>   File "/usr/local/bin/dt-validate", line 49, in check_node
>     errors = sorted(dtschema.DTValidator(schema).iter_errors(node),
> key=lambda e: e.linecol)
>   File "/usr/local/lib/python3.8/dist-packages/dtschema/lib.py", line 768, in
> iter_errors
>     for error in super().iter_errors(instance, _schema):
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py",
> line 226, in iter_errors
>     for error in errors:
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/_validators.py",
> line 25, in patternProperties
>     yield from validator.descend(
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py",
> line 242, in descend
>     for error in self.evolve(schema=schema).iter_errors(instance):
>   File "/usr/local/lib/python3.8/dist-packages/dtschema/lib.py", line 768, in
> iter_errors
>     for error in super().iter_errors(instance, _schema):
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py",
> line 226, in iter_errors
>     for error in errors:
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/_validators.py",
> line 298, in ref
>     yield from validator.descend(instance, resolved)
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py",
> line 242, in descend
>     for error in self.evolve(schema=schema).iter_errors(instance):
>   File "/usr/local/lib/python3.8/dist-packages/dtschema/lib.py", line 768, in
> iter_errors
>     for error in super().iter_errors(instance, _schema):
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py",
> line 216, in iter_errors
>     scope = id_of(_schema)
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py",
> line 93, in _id_of
>     return schema.get("$id", "")
> AttributeError: 'NoneType' object has no attribute 'get'
> make[1]: *** [scripts/Makefile.lib:373:
> Documentation/devicetree/bindings/usb/qcom,dwc3.example.dt.yaml] Error 1
> make[1]: *** Waiting for unfinished jobs....
> make[1]: *** Deleting file 'Documentation/devicetree/bindings/usb/fsl,imx8mp-
> dwc3.example.dt.yaml'
> schemas/usb/snps,dwc3.yaml: ignoring, error in schema: properties: snps,ref-
> clock-fladj
> Traceback (most recent call last):
>   File "/usr/local/bin/dt-validate", line 170, in <module>
>     sg.check_trees(filename, testtree)
>   File "/usr/local/bin/dt-validate", line 119, in check_trees
>     self.check_subtree(dt, subtree, False, "/", "/", filename)
>   File "/usr/local/bin/dt-validate", line 110, in check_subtree
>     self.check_subtree(tree, value, disabled, name, fullname + name,
> filename)
>   File "/usr/local/bin/dt-validate", line 110, in check_subtree
>     self.check_subtree(tree, value, disabled, name, fullname + name,
> filename)
>   File "/usr/local/bin/dt-validate", line 105, in check_subtree
>     self.check_node(tree, subtree, disabled, nodename, fullname, filename)
>   File "/usr/local/bin/dt-validate", line 49, in check_node
>     errors = sorted(dtschema.DTValidator(schema).iter_errors(node),
> key=lambda e: e.linecol)
>   File "/usr/local/lib/python3.8/dist-packages/dtschema/lib.py", line 768, in
> iter_errors
>     for error in super().iter_errors(instance, _schema):
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py",
> line 226, in iter_errors
>     for error in errors:
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/_validators.py",
> line 25, in patternProperties
>     yield from validator.descend(
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py",
> line 242, in descend
>     for error in self.evolve(schema=schema).iter_errors(instance):
>   File "/usr/local/lib/python3.8/dist-packages/dtschema/lib.py", line 768, in
> iter_errors
>     for error in super().iter_errors(instance, _schema):
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py",
> line 226, in iter_errors
>     for error in errors:
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/_validators.py",
> line 298, in ref
>     yield from validator.descend(instance, resolved)
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py",
> line 242, in descend
>     for error in self.evolve(schema=schema).iter_errors(instance):
>   File "/usr/local/lib/python3.8/dist-packages/dtschema/lib.py", line 768, in
> iter_errors
>     for error in super().iter_errors(instance, _schema):
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py",
> line 216, in iter_errors
>     scope = id_of(_schema)
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py",
> line 93, in _id_of
>     return schema.get("$id", "")
> AttributeError: 'NoneType' object has no attribute 'get'
> make[1]: *** [scripts/Makefile.lib:373:
> Documentation/devicetree/bindings/usb/fsl,imx8mp-dwc3.example.dt.yaml] Error
> 1
> make[1]: *** Deleting file
> 'Documentation/devicetree/bindings/usb/intel,keembay-dwc3.example.dt.yaml'
> schemas/usb/snps,dwc3.yaml: ignoring, error in schema: properties: snps,ref-
> clock-fladj
> Traceback (most recent call last):
>   File "/usr/local/bin/dt-validate", line 170, in <module>
>     sg.check_trees(filename, testtree)
>   File "/usr/local/bin/dt-validate", line 119, in check_trees
>     self.check_subtree(dt, subtree, False, "/", "/", filename)
>   File "/usr/local/bin/dt-validate", line 110, in check_subtree
>     self.check_subtree(tree, value, disabled, name, fullname + name,
> filename)
>   File "/usr/local/bin/dt-validate", line 110, in check_subtree
>     self.check_subtree(tree, value, disabled, name, fullname + name,
> filename)
>   File "/usr/local/bin/dt-validate", line 105, in check_subtree
>     self.check_node(tree, subtree, disabled, nodename, fullname, filename)
>   File "/usr/local/bin/dt-validate", line 49, in check_node
>     errors = sorted(dtschema.DTValidator(schema).iter_errors(node),
> key=lambda e: e.linecol)
>   File "/usr/local/lib/python3.8/dist-packages/dtschema/lib.py", line 768, in
> iter_errors
>     for error in super().iter_errors(instance, _schema):
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py",
> line 226, in iter_errors
>     for error in errors:
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/_validators.py",
> line 25, in patternProperties
>     yield from validator.descend(
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py",
> line 242, in descend
>     for error in self.evolve(schema=schema).iter_errors(instance):
>   File "/usr/local/lib/python3.8/dist-packages/dtschema/lib.py", line 768, in
> iter_errors
>     for error in super().iter_errors(instance, _schema):
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py",
> line 226, in iter_errors
>     for error in errors:
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/_validators.py",
> line 298, in ref
>     yield from validator.descend(instance, resolved)
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py",
> line 242, in descend
>     for error in self.evolve(schema=schema).iter_errors(instance):
>   File "/usr/local/lib/python3.8/dist-packages/dtschema/lib.py", line 768, in
> iter_errors
>     for error in super().iter_errors(instance, _schema):
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py",
> line 216, in iter_errors
>     scope = id_of(_schema)
>   File "/usr/local/lib/python3.8/dist-packages/jsonschema/validators.py",
> line 93, in _id_of
>     return schema.get("$id", "")
> AttributeError: 'NoneType' object has no attribute 'get'
> make[1]: *** [scripts/Makefile.lib:373:
> Documentation/devicetree/bindings/usb/intel,keembay-dwc3.example.dt.yaml]
> Error 1
> make: *** [Makefile:1413: dt_binding_check] Error 2
> 
> doc reference errors (make refcheckdocs):
> 
> See 
> https://urldefense.com/v3/__https://patchwork.ozlabs.org/patch/1578106__;!!IOGos0k!22HR18vQNpccp4Fe5xDTXtAO4G0fx0WhklLyKtGpjxDp2x3vJVRk7_o5zjwAw07olIs$
>  
> 
> This check can fail if there are any dependencies. The base for a patch
> series is generally the most recent rc1.
> 
> If you already ran 'make dt_binding_check' and didn't see the above
> error(s), then make sure 'yamllint' is installed and dt-schema is up to
> date:
> 
> pip3 install dtschema --upgrade
> 
> Please check and re-submit.
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 3/5] dt-bindings: usb: dwc3: add reference clock period fractional adjustment
  2022-01-12 16:53     ` Robert Hancock
@ 2022-01-12 19:46       ` Rob Herring
  2022-01-13 17:58         ` Robert Hancock
  0 siblings, 1 reply; 12+ messages in thread
From: Rob Herring @ 2022-01-12 19:46 UTC (permalink / raw)
  To: Robert Hancock
  Cc: linux-usb, mounika.grace.akula, devicetree, Thinh.Nguyen,
	michal.simek, manish.narani, balbi, gregkh

On Wed, Jan 12, 2022 at 10:54 AM Robert Hancock
<robert.hancock@calian.com> wrote:
>
> On Tue, 2022-01-11 at 09:14 -0600, Rob Herring wrote:
> > On Mon, 10 Jan 2022 14:19:34 -0600, Robert Hancock wrote:
> > > Document the new snps,ref-clock-fladj property which can be used to set
> > > the fractional portion of the reference clock period.
> > >
> > > Signed-off-by: Robert Hancock <robert.hancock@calian.com>
> > > ---
> > >  Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 12 ++++++++++++
> > >  1 file changed, 12 insertions(+)
> > >
> >
> > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> > on your patch (DT_CHECKER_FLAGS is new in v5.13):
> >
> > yamllint warnings/errors:
> >
> > dtschema/dtc warnings/errors:
> > schemas/usb/snps,dwc3.yaml: ignoring, error in schema: properties: snps,ref-
> > clock-fladj
>
> I'm assuming this schema file needs to be updated, but I'm not sure where it
> lives? I don't see such a file in the devicetree-org/dt-schema repo?

Try Documentation/devicetree/bindings/usb/snps,dwc3.yaml

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 3/5] dt-bindings: usb: dwc3: add reference clock period fractional adjustment
  2022-01-12 19:46       ` Rob Herring
@ 2022-01-13 17:58         ` Robert Hancock
  2022-01-14  2:18           ` Rob Herring
  0 siblings, 1 reply; 12+ messages in thread
From: Robert Hancock @ 2022-01-13 17:58 UTC (permalink / raw)
  To: robh
  Cc: linux-usb, mounika.grace.akula, devicetree, Thinh.Nguyen,
	michal.simek, manish.narani, balbi, gregkh

On Wed, 2022-01-12 at 13:46 -0600, Rob Herring wrote:
> On Wed, Jan 12, 2022 at 10:54 AM Robert Hancock
> <robert.hancock@calian.com> wrote:
> > On Tue, 2022-01-11 at 09:14 -0600, Rob Herring wrote:
> > > On Mon, 10 Jan 2022 14:19:34 -0600, Robert Hancock wrote:
> > > > Document the new snps,ref-clock-fladj property which can be used to set
> > > > the fractional portion of the reference clock period.
> > > > 
> > > > Signed-off-by: Robert Hancock <robert.hancock@calian.com>
> > > > ---
> > > >  Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 12 ++++++++++++
> > > >  1 file changed, 12 insertions(+)
> > > > 
> > > 
> > > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> > > on your patch (DT_CHECKER_FLAGS is new in v5.13):
> > > 
> > > yamllint warnings/errors:
> > > 
> > > dtschema/dtc warnings/errors:
> > > schemas/usb/snps,dwc3.yaml: ignoring, error in schema: properties:
> > > snps,ref-
> > > clock-fladj
> > 
> > I'm assuming this schema file needs to be updated, but I'm not sure where
> > it
> > lives? I don't see such a file in the devicetree-org/dt-schema repo?
> 
> Try Documentation/devicetree/bindings/usb/snps,dwc3.yaml

That's the one I'm patching, but it seems like it is comparing that to another
schema file that I can't find, and is unhappy because the new property I'm
adding isn't there? The way it's defined in the bindings file itself seems no
different from the others:

dtschema/dtc warnings/errors:
schemas/usb/snps,dwc3.yaml: ignoring, error in schema: properties: snps,ref-
clock-fladj
/builds/robherring/linux-dt-
review/Documentation/devicetree/bindings/usb/snps,dwc3.yaml:
properties:snps,ref-clock-fladj: 'oneOf' conditional failed, one must be fixed:

-- 
Robert Hancock
Senior Hardware Designer, Calian Advanced Technologies
www.calian.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 3/5] dt-bindings: usb: dwc3: add reference clock period fractional adjustment
  2022-01-13 17:58         ` Robert Hancock
@ 2022-01-14  2:18           ` Rob Herring
  2022-01-14  4:30             ` Robert Hancock
  0 siblings, 1 reply; 12+ messages in thread
From: Rob Herring @ 2022-01-14  2:18 UTC (permalink / raw)
  To: Robert Hancock
  Cc: linux-usb, mounika.grace.akula, devicetree, Thinh.Nguyen,
	michal.simek, manish.narani, balbi, gregkh

On Thu, Jan 13, 2022 at 11:58 AM Robert Hancock
<robert.hancock@calian.com> wrote:
>
> On Wed, 2022-01-12 at 13:46 -0600, Rob Herring wrote:
> > On Wed, Jan 12, 2022 at 10:54 AM Robert Hancock
> > <robert.hancock@calian.com> wrote:
> > > On Tue, 2022-01-11 at 09:14 -0600, Rob Herring wrote:
> > > > On Mon, 10 Jan 2022 14:19:34 -0600, Robert Hancock wrote:
> > > > > Document the new snps,ref-clock-fladj property which can be used to set
> > > > > the fractional portion of the reference clock period.
> > > > >
> > > > > Signed-off-by: Robert Hancock <robert.hancock@calian.com>
> > > > > ---
> > > > >  Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 12 ++++++++++++
> > > > >  1 file changed, 12 insertions(+)
> > > > >
> > > >
> > > > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> > > > on your patch (DT_CHECKER_FLAGS is new in v5.13):
> > > >
> > > > yamllint warnings/errors:
> > > >
> > > > dtschema/dtc warnings/errors:
> > > > schemas/usb/snps,dwc3.yaml: ignoring, error in schema: properties:
> > > > snps,ref-
> > > > clock-fladj
> > >
> > > I'm assuming this schema file needs to be updated, but I'm not sure where
> > > it
> > > lives? I don't see such a file in the devicetree-org/dt-schema repo?
> >
> > Try Documentation/devicetree/bindings/usb/snps,dwc3.yaml
>
> That's the one I'm patching, but it seems like it is comparing that to another
> schema file that I can't find, and is unhappy because the new property I'm
> adding isn't there? The way it's defined in the bindings file itself seems no
> different from the others:

The problem is in Documentation/devicetree/bindings/usb/snps,dwc3.yaml
with the property you added. It is as simple as that. It's failing on
the meta-schema vendor-props.yaml which is in the dtschema repo (and
also on your computer where dtschema is installed).

Just run:

dt-doc-validate -u Documentation/devicetree/bindings/
Documentation/devicetree/bindings/usb/snps,dwc3.yaml

>
> dtschema/dtc warnings/errors:
> schemas/usb/snps,dwc3.yaml: ignoring, error in schema: properties: snps,ref-
> clock-fladj
> /builds/robherring/linux-dt-
> review/Documentation/devicetree/bindings/usb/snps,dwc3.yaml:
> properties:snps,ref-clock-fladj: 'oneOf' conditional failed, one must be fixed:

The important parts are what came after the above. Read the 'hints'.

Rob

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 3/5] dt-bindings: usb: dwc3: add reference clock period fractional adjustment
  2022-01-14  2:18           ` Rob Herring
@ 2022-01-14  4:30             ` Robert Hancock
  0 siblings, 0 replies; 12+ messages in thread
From: Robert Hancock @ 2022-01-14  4:30 UTC (permalink / raw)
  To: robh
  Cc: linux-usb, mounika.grace.akula, devicetree, Thinh.Nguyen,
	michal.simek, manish.narani, balbi, gregkh

On Thu, 2022-01-13 at 20:18 -0600, Rob Herring wrote:
> On Thu, Jan 13, 2022 at 11:58 AM Robert Hancock
> <robert.hancock@calian.com> wrote:
> > On Wed, 2022-01-12 at 13:46 -0600, Rob Herring wrote:
> > > On Wed, Jan 12, 2022 at 10:54 AM Robert Hancock
> > > <robert.hancock@calian.com> wrote:
> > > > On Tue, 2022-01-11 at 09:14 -0600, Rob Herring wrote:
> > > > > On Mon, 10 Jan 2022 14:19:34 -0600, Robert Hancock wrote:
> > > > > > Document the new snps,ref-clock-fladj property which can be used to
> > > > > > set
> > > > > > the fractional portion of the reference clock period.
> > > > > > 
> > > > > > Signed-off-by: Robert Hancock <robert.hancock@calian.com>
> > > > > > ---
> > > > > >  Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 12
> > > > > > ++++++++++++
> > > > > >  1 file changed, 12 insertions(+)
> > > > > > 
> > > > > 
> > > > > My bot found errors running 'make DT_CHECKER_FLAGS=-m
> > > > > dt_binding_check'
> > > > > on your patch (DT_CHECKER_FLAGS is new in v5.13):
> > > > > 
> > > > > yamllint warnings/errors:
> > > > > 
> > > > > dtschema/dtc warnings/errors:
> > > > > schemas/usb/snps,dwc3.yaml: ignoring, error in schema: properties:
> > > > > snps,ref-
> > > > > clock-fladj
> > > > 
> > > > I'm assuming this schema file needs to be updated, but I'm not sure
> > > > where
> > > > it
> > > > lives? I don't see such a file in the devicetree-org/dt-schema repo?
> > > 
> > > Try Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> > 
> > That's the one I'm patching, but it seems like it is comparing that to
> > another
> > schema file that I can't find, and is unhappy because the new property I'm
> > adding isn't there? The way it's defined in the bindings file itself seems
> > no
> > different from the others:
> 
> The problem is in Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> with the property you added. It is as simple as that. It's failing on
> the meta-schema vendor-props.yaml which is in the dtschema repo (and
> also on your computer where dtschema is installed).
> 
> Just run:
> 
> dt-doc-validate -u Documentation/devicetree/bindings/
> Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> 
> > dtschema/dtc warnings/errors:
> > schemas/usb/snps,dwc3.yaml: ignoring, error in schema: properties:
> > snps,ref-
> > clock-fladj
> > /builds/robherring/linux-dt-
> > review/Documentation/devicetree/bindings/usb/snps,dwc3.yaml:
> > properties:snps,ref-clock-fladj: 'oneOf' conditional failed, one must be
> > fixed:
> 
> The important parts are what came after the above. Read the 'hints'.

Indeed, looks like it was missing the $ref to specify the type. I think my
confusion was because the immediately preceding parameter in the
file, snps,ref-clock-period-ns, was also missing $ref with no complaints, I
guess because it has the -ns suffix.. Will update in the next version.

> 
> Rob

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-01-14  4:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-10 20:19 [PATCH v3 0/5] Xilinx ZynqMP USB fixes Robert Hancock
2022-01-10 20:19 ` [PATCH v3 1/5] usb: dwc3: xilinx: Fix PIPE clock selection for USB2.0 mode Robert Hancock
2022-01-10 20:19 ` [PATCH v3 2/5] usb: dwc3: xilinx: Fix error handling when getting USB3 PHY Robert Hancock
2022-01-10 20:19 ` [PATCH v3 3/5] dt-bindings: usb: dwc3: add reference clock period fractional adjustment Robert Hancock
2022-01-11 15:14   ` Rob Herring
2022-01-12 16:53     ` Robert Hancock
2022-01-12 19:46       ` Rob Herring
2022-01-13 17:58         ` Robert Hancock
2022-01-14  2:18           ` Rob Herring
2022-01-14  4:30             ` Robert Hancock
2022-01-10 20:19 ` [PATCH v3 4/5] usb: dwc3: add reference clock FLADJ configuration Robert Hancock
2022-01-10 20:19 ` [PATCH v3 5/5] arm64: dts: zynqmp: Add DWC3 USB reference clock period configuration Robert Hancock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).