mbox series

[v3,0/5] Xilinx ZynqMP USB fixes

Message ID 20220110201936.1371891-1-robert.hancock@calian.com
Headers show
Series Xilinx ZynqMP USB fixes | expand

Message

Robert Hancock Jan. 10, 2022, 8:19 p.m. UTC
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(-)

Comments

Robert Hancock Jan. 13, 2022, 5:58 p.m. UTC | #1
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:
Rob Herring Jan. 14, 2022, 2:18 a.m. UTC | #2
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
Robert Hancock Jan. 14, 2022, 4:30 a.m. UTC | #3
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