linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Skip phy initialization for DWC3 USB Controllers
@ 2021-11-08  6:41 Sandeep Maheswaram
  2021-11-08  6:41 ` [PATCH v2 1/3] dt-bindings: usb: usb-xhci: Add bindings for usb-skip-phy-init property Sandeep Maheswaram
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Sandeep Maheswaram @ 2021-11-08  6:41 UTC (permalink / raw)
  To: Rob Herring, Andy Gross, Bjorn Andersson, Greg Kroah-Hartman,
	Felipe Balbi, Stephen Boyd, Doug Anderson, Matthias Kaehlcke,
	Mathias Nyman
  Cc: devicetree, linux-arm-msm, linux-usb, linux-kernel,
	quic_pkondeti, quic_ppratap, Sandeep Maheswaram

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.

v2:
Updated the commit descriptions.
Changed subject prefix from dwc to dwc3.
Increased props array size.

Sandeep Maheswaram (3):
  dt-bindings: usb: usb-xhci: Add bindings for usb-skip-phy-init
    property
  usb: host: xhci-plat: Add device property to set XHCI_SKIP_PHY_INIT
    quirk
  usb: dwc3: host: Set the property usb-skip-phy-init

 Documentation/devicetree/bindings/usb/usb-xhci.yaml | 4 ++++
 drivers/usb/dwc3/host.c                             | 4 +++-
 drivers/usb/host/xhci-plat.c                        | 3 +++
 3 files changed, 10 insertions(+), 1 deletion(-)

-- 
2.7.4


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

* [PATCH v2 1/3] dt-bindings: usb: usb-xhci: Add bindings for usb-skip-phy-init property
  2021-11-08  6:41 [PATCH v2 0/3] Skip phy initialization for DWC3 USB Controllers Sandeep Maheswaram
@ 2021-11-08  6:41 ` Sandeep Maheswaram
  2021-11-12 22:47   ` Rob Herring
  2021-11-08  6:41 ` [PATCH v2 2/3] usb: host: xhci-plat: Add device property to set XHCI_SKIP_PHY_INIT quirk Sandeep Maheswaram
  2021-11-08  6:41 ` [PATCH v2 3/3] usb: dwc3: host: Set the property usb-skip-phy-init Sandeep Maheswaram
  2 siblings, 1 reply; 8+ messages in thread
From: Sandeep Maheswaram @ 2021-11-08  6:41 UTC (permalink / raw)
  To: Rob Herring, Andy Gross, Bjorn Andersson, Greg Kroah-Hartman,
	Felipe Balbi, Stephen Boyd, Doug Anderson, Matthias Kaehlcke,
	Mathias Nyman
  Cc: devicetree, linux-arm-msm, linux-usb, linux-kernel,
	quic_pkondeti, quic_ppratap, Sandeep Maheswaram

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(+)

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


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

* [PATCH v2 2/3] usb: host: xhci-plat: Add device property to set XHCI_SKIP_PHY_INIT quirk
  2021-11-08  6:41 [PATCH v2 0/3] Skip phy initialization for DWC3 USB Controllers Sandeep Maheswaram
  2021-11-08  6:41 ` [PATCH v2 1/3] dt-bindings: usb: usb-xhci: Add bindings for usb-skip-phy-init property Sandeep Maheswaram
@ 2021-11-08  6:41 ` Sandeep Maheswaram
  2021-11-08  6:41 ` [PATCH v2 3/3] usb: dwc3: host: Set the property usb-skip-phy-init Sandeep Maheswaram
  2 siblings, 0 replies; 8+ messages in thread
From: Sandeep Maheswaram @ 2021-11-08  6:41 UTC (permalink / raw)
  To: Rob Herring, Andy Gross, Bjorn Andersson, Greg Kroah-Hartman,
	Felipe Balbi, Stephen Boyd, Doug Anderson, Matthias Kaehlcke,
	Mathias Nyman
  Cc: devicetree, linux-arm-msm, linux-usb, linux-kernel,
	quic_pkondeti, quic_ppratap, Sandeep Maheswaram

Add device property usb-skip-phy-init to check and set XHCI_SKIP_PHY_INIT
quirk.
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>
---
 drivers/usb/host/xhci-plat.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index c1edcc9..2a45f89 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -323,6 +323,9 @@ static int xhci_plat_probe(struct platform_device *pdev)
 		if (device_property_read_bool(tmpdev, "quirk-broken-port-ped"))
 			xhci->quirks |= XHCI_BROKEN_PORT_PED;
 
+		if (device_property_read_bool(tmpdev, "usb-skip-phy-init"))
+			xhci->quirks |= XHCI_SKIP_PHY_INIT;
+
 		device_property_read_u32(tmpdev, "imod-interval-ns",
 					 &xhci->imod_interval);
 	}
-- 
2.7.4


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

* [PATCH v2 3/3] usb: dwc3: host: Set the property usb-skip-phy-init
  2021-11-08  6:41 [PATCH v2 0/3] Skip phy initialization for DWC3 USB Controllers Sandeep Maheswaram
  2021-11-08  6:41 ` [PATCH v2 1/3] dt-bindings: usb: usb-xhci: Add bindings for usb-skip-phy-init property Sandeep Maheswaram
  2021-11-08  6:41 ` [PATCH v2 2/3] usb: host: xhci-plat: Add device property to set XHCI_SKIP_PHY_INIT quirk Sandeep Maheswaram
@ 2021-11-08  6:41 ` Sandeep Maheswaram
  2 siblings, 0 replies; 8+ messages in thread
From: Sandeep Maheswaram @ 2021-11-08  6:41 UTC (permalink / raw)
  To: Rob Herring, Andy Gross, Bjorn Andersson, Greg Kroah-Hartman,
	Felipe Balbi, Stephen Boyd, Doug Anderson, Matthias Kaehlcke,
	Mathias Nyman
  Cc: devicetree, linux-arm-msm, linux-usb, linux-kernel,
	quic_pkondeti, quic_ppratap, Sandeep Maheswaram

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>
---
v2:
Changed subject prefix from dwc to dwc3.
Increased props array size.

 drivers/usb/dwc3/host.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index f29a264..ece7912 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -44,7 +44,7 @@ static int dwc3_host_get_irq(struct dwc3 *dwc)
 
 int dwc3_host_init(struct dwc3 *dwc)
 {
-	struct property_entry	props[4];
+	struct property_entry	props[5];
 	struct platform_device	*xhci;
 	int			ret, irq;
 	struct resource		*res;
@@ -107,6 +107,8 @@ int dwc3_host_init(struct dwc3 *dwc)
 	if (DWC3_VER_IS_WITHIN(DWC3, ANY, 300A))
 		props[prop_idx++] = PROPERTY_ENTRY_BOOL("quirk-broken-port-ped");
 
+	props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb-skip-phy-init");
+
 	if (prop_idx) {
 		ret = device_create_managed_software_node(&xhci->dev, props, NULL);
 		if (ret) {
-- 
2.7.4


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

* Re: [PATCH v2 1/3] dt-bindings: usb: usb-xhci: Add bindings for usb-skip-phy-init property
  2021-11-08  6:41 ` [PATCH v2 1/3] dt-bindings: usb: usb-xhci: Add bindings for usb-skip-phy-init property Sandeep Maheswaram
@ 2021-11-12 22:47   ` Rob Herring
  2021-11-16 10:41     ` Sandeep Maheswaram
  0 siblings, 1 reply; 8+ messages in thread
From: Rob Herring @ 2021-11-12 22:47 UTC (permalink / raw)
  To: Sandeep Maheswaram
  Cc: Andy Gross, Bjorn Andersson, Greg Kroah-Hartman, Felipe Balbi,
	Stephen Boyd, Doug Anderson, Matthias Kaehlcke, Mathias Nyman,
	devicetree, linux-arm-msm, linux-usb, linux-kernel,
	quic_pkondeti, quic_ppratap

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
> 
> 

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

* Re: [PATCH v2 1/3] dt-bindings: usb: usb-xhci: Add bindings for usb-skip-phy-init property
  2021-11-12 22:47   ` Rob Herring
@ 2021-11-16 10:41     ` Sandeep Maheswaram
  2021-11-17  5:27       ` Pavan Kondeti
  0 siblings, 1 reply; 8+ messages in thread
From: Sandeep Maheswaram @ 2021-11-16 10:41 UTC (permalink / raw)
  To: Rob Herring
  Cc: Andy Gross, Bjorn Andersson, Greg Kroah-Hartman, Felipe Balbi,
	Stephen Boyd, Doug Anderson, Matthias Kaehlcke, Mathias Nyman,
	devicetree, linux-arm-msm, linux-usb, linux-kernel,
	quic_pkondeti, quic_ppratap


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
>>
>>

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

* Re: [PATCH v2 1/3] dt-bindings: usb: usb-xhci: Add bindings for usb-skip-phy-init property
  2021-11-16 10:41     ` Sandeep Maheswaram
@ 2021-11-17  5:27       ` Pavan Kondeti
  2021-11-23 11:17         ` Sandeep Maheswaram
  0 siblings, 1 reply; 8+ messages in thread
From: Pavan Kondeti @ 2021-11-17  5:27 UTC (permalink / raw)
  To: Sandeep Maheswaram
  Cc: Rob Herring, Andy Gross, Bjorn Andersson, Greg Kroah-Hartman,
	Felipe Balbi, Stephen Boyd, Doug Anderson, Matthias Kaehlcke,
	Mathias Nyman, devicetree, linux-arm-msm, linux-usb,
	linux-kernel, quic_pkondeti, quic_ppratap

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


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

* Re: [PATCH v2 1/3] dt-bindings: usb: usb-xhci: Add bindings for usb-skip-phy-init property
  2021-11-17  5:27       ` Pavan Kondeti
@ 2021-11-23 11:17         ` Sandeep Maheswaram
  0 siblings, 0 replies; 8+ messages in thread
From: Sandeep Maheswaram @ 2021-11-23 11:17 UTC (permalink / raw)
  To: Pavan Kondeti
  Cc: Rob Herring, Andy Gross, Bjorn Andersson, Greg Kroah-Hartman,
	Felipe Balbi, Stephen Boyd, Doug Anderson, Matthias Kaehlcke,
	Mathias Nyman, devicetree, linux-arm-msm, linux-usb,
	linux-kernel, quic_ppratap

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.

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

end of thread, other threads:[~2021-11-23 11:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08  6:41 [PATCH v2 0/3] Skip phy initialization for DWC3 USB Controllers Sandeep Maheswaram
2021-11-08  6:41 ` [PATCH v2 1/3] dt-bindings: usb: usb-xhci: Add bindings for usb-skip-phy-init property Sandeep Maheswaram
2021-11-12 22:47   ` Rob Herring
2021-11-16 10:41     ` Sandeep Maheswaram
2021-11-17  5:27       ` Pavan Kondeti
2021-11-23 11:17         ` Sandeep Maheswaram
2021-11-08  6:41 ` [PATCH v2 2/3] usb: host: xhci-plat: Add device property to set XHCI_SKIP_PHY_INIT quirk Sandeep Maheswaram
2021-11-08  6:41 ` [PATCH v2 3/3] usb: dwc3: host: Set the property usb-skip-phy-init Sandeep Maheswaram

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).