diff mbox series

[v2,1/3] dt-bindings: usb: usb-xhci: Add bindings for usb-skip-phy-init property

Message ID 1636353710-25582-2-git-send-email-quic_c_sanm@quicinc.com (mailing list archive)
State New, archived
Headers show
Series Skip phy initialization for DWC3 USB Controllers | expand

Commit Message

Sandeep Maheswaram Nov. 8, 2021, 6:41 a.m. UTC
Adding bindings for usb-skip-phy-init property.
Runtime suspend of phy drivers was failing from DWC3 driver as
runtime usage value is 2 because the phy is initialized from
DWC3 core and HCD core.
Some controllers like DWC3 and CDNS3 manage phy in their core drivers.
This property can be set to avoid phy initialization in HCD core.

Signed-off-by: Sandeep Maheswaram <quic_c_sanm@quicinc.com>
---
 Documentation/devicetree/bindings/usb/usb-xhci.yaml | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Rob Herring (Arm) Nov. 12, 2021, 10:47 p.m. UTC | #1
On Mon, Nov 08, 2021 at 12:11:48PM +0530, Sandeep Maheswaram wrote:
> Adding bindings for usb-skip-phy-init property.
> Runtime suspend of phy drivers was failing from DWC3 driver as
> runtime usage value is 2 because the phy is initialized from
> DWC3 core and HCD core.
> Some controllers like DWC3 and CDNS3 manage phy in their core drivers.
> This property can be set to avoid phy initialization in HCD core.

You already know if you have a DWC3 and CDNS3 controller, so you don't 
need more data in DT.

> 
> Signed-off-by: Sandeep Maheswaram <quic_c_sanm@quicinc.com>
> ---
>  Documentation/devicetree/bindings/usb/usb-xhci.yaml | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/usb/usb-xhci.yaml b/Documentation/devicetree/bindings/usb/usb-xhci.yaml
> index 965f87f..a64d29f 100644
> --- a/Documentation/devicetree/bindings/usb/usb-xhci.yaml
> +++ b/Documentation/devicetree/bindings/usb/usb-xhci.yaml
> @@ -25,6 +25,10 @@ properties:
>      description: Set if the controller has broken port disable mechanism
>      type: boolean
>  
> +  usb-skip-phy-init:
> +    description: Set if the phy initialization is managed by controller
> +    type: boolean
> +
>    imod-interval-ns:
>      description: Interrupt moderation interval
>      default: 5000
> -- 
> 2.7.4
> 
>
Sandeep Maheswaram Nov. 16, 2021, 10:41 a.m. UTC | #2
On 11/13/2021 4:17 AM, Rob Herring wrote:
> On Mon, Nov 08, 2021 at 12:11:48PM +0530, Sandeep Maheswaram wrote:
>> Adding bindings for usb-skip-phy-init property.
>> Runtime suspend of phy drivers was failing from DWC3 driver as
>> runtime usage value is 2 because the phy is initialized from
>> DWC3 core and HCD core.
>> Some controllers like DWC3 and CDNS3 manage phy in their core drivers.
>> This property can be set to avoid phy initialization in HCD core.
> You already know if you have a DWC3 and CDNS3 controller, so you don't
> need more data in DT.

We don't have a device tree node for xhci platform device and create 
xhci platform device from dwc3/host.c

So we want to pass this property to check in xhci-plat.c and skip phy 
initialization.

>> Signed-off-by: Sandeep Maheswaram <quic_c_sanm@quicinc.com>
>> ---
>>   Documentation/devicetree/bindings/usb/usb-xhci.yaml | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/usb/usb-xhci.yaml b/Documentation/devicetree/bindings/usb/usb-xhci.yaml
>> index 965f87f..a64d29f 100644
>> --- a/Documentation/devicetree/bindings/usb/usb-xhci.yaml
>> +++ b/Documentation/devicetree/bindings/usb/usb-xhci.yaml
>> @@ -25,6 +25,10 @@ properties:
>>       description: Set if the controller has broken port disable mechanism
>>       type: boolean
>>   
>> +  usb-skip-phy-init:
>> +    description: Set if the phy initialization is managed by controller
>> +    type: boolean
>> +
>>     imod-interval-ns:
>>       description: Interrupt moderation interval
>>       default: 5000
>> -- 
>> 2.7.4
>>
>>
Pavan Kondeti Nov. 17, 2021, 5:27 a.m. UTC | #3
Hi Sandeep,

On Tue, Nov 16, 2021 at 04:11:30PM +0530, Sandeep Maheswaram wrote:
> 
> On 11/13/2021 4:17 AM, Rob Herring wrote:
> >On Mon, Nov 08, 2021 at 12:11:48PM +0530, Sandeep Maheswaram wrote:
> >>Adding bindings for usb-skip-phy-init property.
> >>Runtime suspend of phy drivers was failing from DWC3 driver as
> >>runtime usage value is 2 because the phy is initialized from
> >>DWC3 core and HCD core.
> >>Some controllers like DWC3 and CDNS3 manage phy in their core drivers.
> >>This property can be set to avoid phy initialization in HCD core.
> >You already know if you have a DWC3 and CDNS3 controller, so you don't
> >need more data in DT.
> 
> We don't have a device tree node for xhci platform device and create xhci
> platform device from dwc3/host.c
> 
> So we want to pass this property to check in xhci-plat.c and skip phy
> initialization.
> 

Would not the below condition from your other patch [1] work here too?

if (of_device_is_compatible(dev->parent->of_node, "snps,dwc3"))

[1] https://lore.kernel.org/linux-usb/1635753224-23975-2-git-send-email-quic_c_sanm@quicinc.com/

Thanks,
Pavan
Sandeep Maheswaram Nov. 23, 2021, 11:17 a.m. UTC | #4
Hi Pavan,

On 11/17/2021 10:57 AM, Pavan Kondeti wrote:
> Hi Sandeep,
>
> On Tue, Nov 16, 2021 at 04:11:30PM +0530, Sandeep Maheswaram wrote:
>> On 11/13/2021 4:17 AM, Rob Herring wrote:
>>> On Mon, Nov 08, 2021 at 12:11:48PM +0530, Sandeep Maheswaram wrote:
>>>> Adding bindings for usb-skip-phy-init property.
>>>> Runtime suspend of phy drivers was failing from DWC3 driver as
>>>> runtime usage value is 2 because the phy is initialized from
>>>> DWC3 core and HCD core.
>>>> Some controllers like DWC3 and CDNS3 manage phy in their core drivers.
>>>> This property can be set to avoid phy initialization in HCD core.
>>> You already know if you have a DWC3 and CDNS3 controller, so you don't
>>> need more data in DT.
>> We don't have a device tree node for xhci platform device and create xhci
>> platform device from dwc3/host.c
>>
>> So we want to pass this property to check in xhci-plat.c and skip phy
>> initialization.
>>
> Would not the below condition from your other patch [1] work here too?
>
> if (of_device_is_compatible(dev->parent->of_node, "snps,dwc3"))
>
> [1] https://lore.kernel.org/linux-usb/1635753224-23975-2-git-send-email-quic_c_sanm@quicinc.com/
>
> Thanks,
> Pavan
Yes. This condition is working. Will send the new version with this change.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/usb/usb-xhci.yaml b/Documentation/devicetree/bindings/usb/usb-xhci.yaml
index 965f87f..a64d29f 100644
--- a/Documentation/devicetree/bindings/usb/usb-xhci.yaml
+++ b/Documentation/devicetree/bindings/usb/usb-xhci.yaml
@@ -25,6 +25,10 @@  properties:
     description: Set if the controller has broken port disable mechanism
     type: boolean
 
+  usb-skip-phy-init:
+    description: Set if the phy initialization is managed by controller
+    type: boolean
+
   imod-interval-ns:
     description: Interrupt moderation interval
     default: 5000