[PATCH v6 13/33] dt-bindings: usb: dwc3: Add snps,num-hc-interrupters definition

Wesley Cheng posted 33 patches 2 years, 4 months ago
Only 31 patches received!
There is a newer version of this series
[PATCH v6 13/33] dt-bindings: usb: dwc3: Add snps,num-hc-interrupters definition
Posted by Wesley Cheng 2 years, 4 months ago
Add a new definition for specifying how many XHCI secondary interrupters
can be allocated.  XHCI in general can potentially support up to 1024
interrupters, which some uses may want to limit depending on how many
users utilize the interrupters.

Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
---
 .../devicetree/bindings/usb/snps,dwc3.yaml          | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
index a696f23730d3..596762ef9b9f 100644
--- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
+++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
@@ -376,6 +376,19 @@ properties:
     items:
       enum: [1, 4, 8, 16, 32, 64, 128, 256]
 
+  snps,num-hc-interrupters:
+    description:
+      Defines the maximum number of XHCI host controller interrupters that can
+      be supported.  The XHCI host controller has support to allocate multiple
+      event rings, which can be assigned to different clients/users.  The DWC3
+      controller has a maximum of 8 interrupters.  If this is not defined then
+      the value will be defaulted to 1.  This parameter is used only when
+      operating in host mode.
+    $ref: /schemas/types.yaml#/definitions/uint8
+    minimum: 1
+    maximum: 8
+    default: 1
+
   port:
     $ref: /schemas/graph.yaml#/properties/port
     description:
Re: [PATCH v6 13/33] dt-bindings: usb: dwc3: Add snps,num-hc-interrupters definition
Posted by Konrad Dybcio 2 years, 4 months ago
On 16.09.2023 02:10, Wesley Cheng wrote:
> Add a new definition for specifying how many XHCI secondary interrupters
> can be allocated.  XHCI in general can potentially support up to 1024
> interrupters, which some uses may want to limit depending on how many
> users utilize the interrupters.
> 
> Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
> ---
Any reason for a DWC3-specific property? Why not just
use the XHCI-common one from patch 14 and error out if
a value of more than 8 is found?

Konrad
Re: [PATCH v6 13/33] dt-bindings: usb: dwc3: Add snps,num-hc-interrupters definition
Posted by Wesley Cheng 2 years, 4 months ago
Hi Konrad,

On 9/15/2023 5:35 PM, Konrad Dybcio wrote:
> On 16.09.2023 02:10, Wesley Cheng wrote:
>> Add a new definition for specifying how many XHCI secondary interrupters
>> can be allocated.  XHCI in general can potentially support up to 1024
>> interrupters, which some uses may want to limit depending on how many
>> users utilize the interrupters.
>>
>> Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
>> ---
> Any reason for a DWC3-specific property? Why not just
> use the XHCI-common one from patch 14 and error out if
> a value of more than 8 is found?
> 

Not every XHCI plat user is going to be DWC3.  In case DWC3 is used, the 
DWC3 host driver is the one that populates and adds the XHCI plat device 
(no separate device node for XHCI), so that requires the DWC3 host to 
also populate properties for the XHCI device. (dwc3_host_init())

Thanks
Wesley Cheng
Re: [PATCH v6 13/33] dt-bindings: usb: dwc3: Add snps,num-hc-interrupters definition
Posted by Rob Herring 2 years, 4 months ago
On Fri, Sep 15, 2023 at 05:43:45PM -0700, Wesley Cheng wrote:
> Hi Konrad,
> 
> On 9/15/2023 5:35 PM, Konrad Dybcio wrote:
> > On 16.09.2023 02:10, Wesley Cheng wrote:
> > > Add a new definition for specifying how many XHCI secondary interrupters
> > > can be allocated.  XHCI in general can potentially support up to 1024
> > > interrupters, which some uses may want to limit depending on how many
> > > users utilize the interrupters.
> > > 
> > > Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
> > > ---
> > Any reason for a DWC3-specific property? Why not just
> > use the XHCI-common one from patch 14 and error out if
> > a value of more than 8 is found?
> > 

I'm pretty sure I said use the common one already...

> 
> Not every XHCI plat user is going to be DWC3.  In case DWC3 is used, the
> DWC3 host driver is the one that populates and adds the XHCI plat device (no
> separate device node for XHCI), so that requires the DWC3 host to also
> populate properties for the XHCI device. (dwc3_host_init())

This binding references usb-xhci.yaml already, so any property from 
there is allowed. Linux needs to handle that regardless of what the 
driver structure/division looks like.

Rob
Re: [PATCH v6 13/33] dt-bindings: usb: dwc3: Add snps,num-hc-interrupters definition
Posted by Wesley Cheng 2 years, 4 months ago
Hi Rob,

On 9/18/2023 1:19 PM, Rob Herring wrote:
> On Fri, Sep 15, 2023 at 05:43:45PM -0700, Wesley Cheng wrote:
>> Hi Konrad,
>>
>> On 9/15/2023 5:35 PM, Konrad Dybcio wrote:
>>> On 16.09.2023 02:10, Wesley Cheng wrote:
>>>> Add a new definition for specifying how many XHCI secondary interrupters
>>>> can be allocated.  XHCI in general can potentially support up to 1024
>>>> interrupters, which some uses may want to limit depending on how many
>>>> users utilize the interrupters.
>>>>
>>>> Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
>>>> ---
>>> Any reason for a DWC3-specific property? Why not just
>>> use the XHCI-common one from patch 14 and error out if
>>> a value of more than 8 is found?
>>>
> 
> I'm pretty sure I said use the common one already...
> 

Yes, you mentioned that in the last rev.

>>
>> Not every XHCI plat user is going to be DWC3.  In case DWC3 is used, the
>> DWC3 host driver is the one that populates and adds the XHCI plat device (no
>> separate device node for XHCI), so that requires the DWC3 host to also
>> populate properties for the XHCI device. (dwc3_host_init())
> 
> This binding references usb-xhci.yaml already, so any property from
> there is allowed. Linux needs to handle that regardless of what the
> driver structure/division looks like.
> 

Ok, understood.  I will remove the need to have another DWC3 property 
and just use the XHCI one directly.  Checks are already in place in the 
DWC3 parser to limit the interrupters if it exceeds 8.

Thanks
Wesley Cheng