Re: [RFC PATCH 1/4] dt-bindings: usb: usb-xhci: Add xhci-snps-quirks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 09, 2022 at 06:11:51PM +0000, Thinh Nguyen wrote:
> Hi Rob,
> 
> Rob Herring wrote:
> > On Fri, Jun 03, 2022 at 07:48:08PM -0700, Thinh Nguyen wrote:
> >> Set this property to use xhci-snps extension to handle common Synopsys
> >> DWC_usb3x host quirks.
> > 
> > I don't see why this needs to be in DT.
> > 
> > The DWC3 stuff is a mess of quirks which doesn't work well. Quirk 
> > properties in DT require either knowing the quirk up front (You don't 
> > always) or updating the DT on a platform when you find one. Quirks 
> > should be implied by the compatible string(s) instead.
> > 
> 
> Since different vendors share the same Synopsys DWC_usb3x IPs, the
> controller's behavior is predictable based on the IP versions. 

Not really, have you looked at the existing bindings. How does the same 
IP have different numbers of clocks, resets, etc.? It's a huge mess for 
these licensed IPs and partly because they don't have publicly available 
specs where we can check what resources there really are.

> Just
> using the compatible strings will become unmanageable when we have the
> common behavior across different vendors.

This IP is not special. We use compatible everywhere else and nowhere is 
it unmanageable. And again, that's the only way you can handle quirks in 
the OS without changing the DT.

> Can we rename this property to "xhci-snps-DWC_usb3x-ip" or something
> similar?
> 
> The main goal for this device property is to indicate that it's
> Synopsys's DWC_usb3x IP. As long as we know this, the xhci-snps glue
> extension can handle the fine tuning for the controller's behavior.

Can't you just check the parent device compatible is 'snps,dwc3'? (I'm 
assuming the struct device hierarchy is glue device -> dwc3 -> xhci.)

> We could use compatible string for this goal also, but that would mean
> the host devices that go through the dwc3 driver path may not have the
> compatible string. (e.g. host on pci bus but get recreated as platform
> device). Then we would need a different way to determine that. We could
> match the parent device driver for "dwc3", but that implementation looks
> fragile.
> 
> So, will the device property "xhci-snps-DWC_usb3x-ip" work for you?

Looking at the driver, you are just creating a property within the 
kernel. It's never in DT, so why are you documenting it? You can do 
whatever DWC3 and XHCI maintainers will allow and as DT maintainer I 
don't care. I don't really think it is a great approach, but ...

Rob



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux