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.
v3:
Coming back to this series based on discussion at below thread
https://patchwork.kernel.org/project/linux-arm-msm/patch/[email protected]/
Dropped the dt bindings PATCH 1/3 in v2
https://patchwork.kernel.org/project/linux-arm-msm/cover/[email protected]/
v2:
Updated the commit descriptions.
Changed subject prefix from dwc to dwc3.
Increased props array size.
Sandeep Maheswaram (2):
usb: host: xhci-plat: Add device property to set XHCI_SKIP_PHY_INIT
quirk
usb: dwc3: host: Set the property usb-skip-phy-init
drivers/usb/dwc3/host.c | 4 +++-
drivers/usb/host/xhci-plat.c | 3 +++
2 files changed, 6 insertions(+), 1 deletion(-)
--
2.7.4
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 <[email protected]>
---
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 649ffd8..7624ed9 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -305,6 +305,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
Hi Mathias, Felipe,
> -----Original Message-----
> From: Sandeep Maheswaram (Temp) (QUIC) <[email protected]>
> Sent: Thursday, April 7, 2022 3:01 PM
> To: Greg Kroah-Hartman <[email protected]>; Felipe Balbi
> <[email protected]>; Stephen Boyd <[email protected]>; Doug
> Anderson <[email protected]>; Matthias Kaehlcke
> <[email protected]>; Mathias Nyman <[email protected]>
> Cc: [email protected]; [email protected]; linux-
> [email protected]; Pavan Kumar Kondeti (QUIC)
> <[email protected]>; Pratham Pratap (QUIC)
> <[email protected]>; Krishna Kurapati PSSNV (QUIC)
> <[email protected]>; Vidya Sagar Pulyala (Temp) (QUIC)
> <[email protected]>; Sandeep Maheswaram (Temp) (QUIC)
> <[email protected]>
> Subject: [PATCH v3 0/2] Skip phy initialization for DWC3 USB Controllers
>
> 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.
>
> v3:
> Coming back to this series based on discussion at below thread
> https://patchwork.kernel.org/project/linux-arm-msm/patch/1648103831-
> [email protected]/
> Dropped the dt bindings PATCH 1/3 in v2
> https://patchwork.kernel.org/project/linux-arm-msm/cover/1636353710-
> [email protected]/
>
> v2:
> Updated the commit descriptions.
> Changed subject prefix from dwc to dwc3.
> Increased props array size.
>
> Sandeep Maheswaram (2):
> usb: host: xhci-plat: Add device property to set XHCI_SKIP_PHY_INIT
> quirk
> usb: dwc3: host: Set the property usb-skip-phy-init
>
> drivers/usb/dwc3/host.c | 4 +++-
> drivers/usb/host/xhci-plat.c | 3 +++
> 2 files changed, 6 insertions(+), 1 deletion(-)
>
> --
> 2.7.4
Please let me know your opinion about this series.
Regards
Sandeep
On Thu, Apr 07, 2022 at 03:01:27PM +0530, Sandeep Maheswaram wrote:
> 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 <[email protected]>
> ---
> 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 649ffd8..7624ed9 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -305,6 +305,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;
You forgot to document this new property. Without that, we can not
accept this :(
On Thu, Apr 21, 2022 at 10:46:37AM +0300, Heikki Krogerus wrote:
> On Wed, Apr 20, 2022 at 04:20:52PM +0300, Mathias Nyman wrote:
> > On 19.4.2022 13.17, Sandeep Maheswaram (Temp) (QUIC) wrote:
> > > Hi Mathias, Felipe,
> > >
> > >> -----Original Message-----
> > >> From: Sandeep Maheswaram (Temp) (QUIC) <[email protected]>
> > >> Sent: Thursday, April 7, 2022 3:01 PM
> > >> To: Greg Kroah-Hartman <[email protected]>; Felipe Balbi
> > >> <[email protected]>; Stephen Boyd <[email protected]>; Doug
> > >> Anderson <[email protected]>; Matthias Kaehlcke
> > >> <[email protected]>; Mathias Nyman <[email protected]>
> > >> Cc: [email protected]; [email protected]; linux-
> > >> [email protected]; Pavan Kumar Kondeti (QUIC)
> > >> <[email protected]>; Pratham Pratap (QUIC)
> > >> <[email protected]>; Krishna Kurapati PSSNV (QUIC)
> > >> <[email protected]>; Vidya Sagar Pulyala (Temp) (QUIC)
> > >> <[email protected]>; Sandeep Maheswaram (Temp) (QUIC)
> > >> <[email protected]>
> > >> Subject: [PATCH v3 0/2] Skip phy initialization for DWC3 USB Controllers
> > >>
> > >> 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.
> > >>
> > >> v3:
> > >> Coming back to this series based on discussion at below thread
> > >> https://patchwork.kernel.org/project/linux-arm-msm/patch/1648103831-
> > >> [email protected]/
> > >> Dropped the dt bindings PATCH 1/3 in v2
> > >> https://patchwork.kernel.org/project/linux-arm-msm/cover/1636353710-
> > >> [email protected]/
> > >>
> > >> v2:
> > >> Updated the commit descriptions.
> > >> Changed subject prefix from dwc to dwc3.
> > >> Increased props array size.
> > >>
> > >> Sandeep Maheswaram (2):
> > >> usb: host: xhci-plat: Add device property to set XHCI_SKIP_PHY_INIT
> > >> quirk
> > >> usb: dwc3: host: Set the property usb-skip-phy-init
> > >>
> > >> drivers/usb/dwc3/host.c | 4 +++-
> > >> drivers/usb/host/xhci-plat.c | 3 +++
> > >> 2 files changed, 6 insertions(+), 1 deletion(-)
> > >>
> > >> --
> > >> 2.7.4
> > >
> > > Please let me know your opinion about this series.
> >
> > Otherwise looks good but wondering if we should document that new device
> > property somewhere.
> >
> > Couldn't find a standard way how those device properties excluded from
> > Documentation/devicetree/binding are documented
>
> Couldn't it be just documented in drivers/usb/host/xhci-plat.c for now?
That's not where DT properties are documented.
On Thu, Apr 21, 2022 at 11:41:33AM +0300, Heikki Krogerus wrote:
> On Thu, Apr 21, 2022 at 10:36:57AM +0200, Greg Kroah-Hartman wrote:
> > On Thu, Apr 21, 2022 at 10:46:37AM +0300, Heikki Krogerus wrote:
> > > On Wed, Apr 20, 2022 at 04:20:52PM +0300, Mathias Nyman wrote:
> > > > On 19.4.2022 13.17, Sandeep Maheswaram (Temp) (QUIC) wrote:
> > > > > Hi Mathias, Felipe,
> > > > >
> > > > >> -----Original Message-----
> > > > >> From: Sandeep Maheswaram (Temp) (QUIC) <[email protected]>
> > > > >> Sent: Thursday, April 7, 2022 3:01 PM
> > > > >> To: Greg Kroah-Hartman <[email protected]>; Felipe Balbi
> > > > >> <[email protected]>; Stephen Boyd <[email protected]>; Doug
> > > > >> Anderson <[email protected]>; Matthias Kaehlcke
> > > > >> <[email protected]>; Mathias Nyman <[email protected]>
> > > > >> Cc: [email protected]; [email protected]; linux-
> > > > >> [email protected]; Pavan Kumar Kondeti (QUIC)
> > > > >> <[email protected]>; Pratham Pratap (QUIC)
> > > > >> <[email protected]>; Krishna Kurapati PSSNV (QUIC)
> > > > >> <[email protected]>; Vidya Sagar Pulyala (Temp) (QUIC)
> > > > >> <[email protected]>; Sandeep Maheswaram (Temp) (QUIC)
> > > > >> <[email protected]>
> > > > >> Subject: [PATCH v3 0/2] Skip phy initialization for DWC3 USB Controllers
> > > > >>
> > > > >> 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.
> > > > >>
> > > > >> v3:
> > > > >> Coming back to this series based on discussion at below thread
> > > > >> https://patchwork.kernel.org/project/linux-arm-msm/patch/1648103831-
> > > > >> [email protected]/
> > > > >> Dropped the dt bindings PATCH 1/3 in v2
> > > > >> https://patchwork.kernel.org/project/linux-arm-msm/cover/1636353710-
> > > > >> [email protected]/
> > > > >>
> > > > >> v2:
> > > > >> Updated the commit descriptions.
> > > > >> Changed subject prefix from dwc to dwc3.
> > > > >> Increased props array size.
> > > > >>
> > > > >> Sandeep Maheswaram (2):
> > > > >> usb: host: xhci-plat: Add device property to set XHCI_SKIP_PHY_INIT
> > > > >> quirk
> > > > >> usb: dwc3: host: Set the property usb-skip-phy-init
> > > > >>
> > > > >> drivers/usb/dwc3/host.c | 4 +++-
> > > > >> drivers/usb/host/xhci-plat.c | 3 +++
> > > > >> 2 files changed, 6 insertions(+), 1 deletion(-)
> > > > >>
> > > > >> --
> > > > >> 2.7.4
> > > > >
> > > > > Please let me know your opinion about this series.
> > > >
> > > > Otherwise looks good but wondering if we should document that new device
> > > > property somewhere.
> > > >
> > > > Couldn't find a standard way how those device properties excluded from
> > > > Documentation/devicetree/binding are documented
> > >
> > > Couldn't it be just documented in drivers/usb/host/xhci-plat.c for now?
> >
> > That's not where DT properties are documented.
>
> It's not a DT property.
Then what is it and why are the other properties documented?
Anyway, a new series has been submitted that does document this so I
don't think it's an argument anymore :)
On 19.4.2022 13.17, Sandeep Maheswaram (Temp) (QUIC) wrote:
> Hi Mathias, Felipe,
>
>> -----Original Message-----
>> From: Sandeep Maheswaram (Temp) (QUIC) <[email protected]>
>> Sent: Thursday, April 7, 2022 3:01 PM
>> To: Greg Kroah-Hartman <[email protected]>; Felipe Balbi
>> <[email protected]>; Stephen Boyd <[email protected]>; Doug
>> Anderson <[email protected]>; Matthias Kaehlcke
>> <[email protected]>; Mathias Nyman <[email protected]>
>> Cc: [email protected]; [email protected]; linux-
>> [email protected]; Pavan Kumar Kondeti (QUIC)
>> <[email protected]>; Pratham Pratap (QUIC)
>> <[email protected]>; Krishna Kurapati PSSNV (QUIC)
>> <[email protected]>; Vidya Sagar Pulyala (Temp) (QUIC)
>> <[email protected]>; Sandeep Maheswaram (Temp) (QUIC)
>> <[email protected]>
>> Subject: [PATCH v3 0/2] Skip phy initialization for DWC3 USB Controllers
>>
>> 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.
>>
>> v3:
>> Coming back to this series based on discussion at below thread
>> https://patchwork.kernel.org/project/linux-arm-msm/patch/1648103831-
>> [email protected]/
>> Dropped the dt bindings PATCH 1/3 in v2
>> https://patchwork.kernel.org/project/linux-arm-msm/cover/1636353710-
>> [email protected]/
>>
>> v2:
>> Updated the commit descriptions.
>> Changed subject prefix from dwc to dwc3.
>> Increased props array size.
>>
>> Sandeep Maheswaram (2):
>> usb: host: xhci-plat: Add device property to set XHCI_SKIP_PHY_INIT
>> quirk
>> usb: dwc3: host: Set the property usb-skip-phy-init
>>
>> drivers/usb/dwc3/host.c | 4 +++-
>> drivers/usb/host/xhci-plat.c | 3 +++
>> 2 files changed, 6 insertions(+), 1 deletion(-)
>>
>> --
>> 2.7.4
>
> Please let me know your opinion about this series.
Otherwise looks good but wondering if we should document that new device
property somewhere.
Couldn't find a standard way how those device properties excluded from
Documentation/devicetree/binding are documented
Thanks
-Mathias
On Thu, Apr 21, 2022 at 10:36:57AM +0200, Greg Kroah-Hartman wrote:
> On Thu, Apr 21, 2022 at 10:46:37AM +0300, Heikki Krogerus wrote:
> > On Wed, Apr 20, 2022 at 04:20:52PM +0300, Mathias Nyman wrote:
> > > On 19.4.2022 13.17, Sandeep Maheswaram (Temp) (QUIC) wrote:
> > > > Hi Mathias, Felipe,
> > > >
> > > >> -----Original Message-----
> > > >> From: Sandeep Maheswaram (Temp) (QUIC) <[email protected]>
> > > >> Sent: Thursday, April 7, 2022 3:01 PM
> > > >> To: Greg Kroah-Hartman <[email protected]>; Felipe Balbi
> > > >> <[email protected]>; Stephen Boyd <[email protected]>; Doug
> > > >> Anderson <[email protected]>; Matthias Kaehlcke
> > > >> <[email protected]>; Mathias Nyman <[email protected]>
> > > >> Cc: [email protected]; [email protected]; linux-
> > > >> [email protected]; Pavan Kumar Kondeti (QUIC)
> > > >> <[email protected]>; Pratham Pratap (QUIC)
> > > >> <[email protected]>; Krishna Kurapati PSSNV (QUIC)
> > > >> <[email protected]>; Vidya Sagar Pulyala (Temp) (QUIC)
> > > >> <[email protected]>; Sandeep Maheswaram (Temp) (QUIC)
> > > >> <[email protected]>
> > > >> Subject: [PATCH v3 0/2] Skip phy initialization for DWC3 USB Controllers
> > > >>
> > > >> 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.
> > > >>
> > > >> v3:
> > > >> Coming back to this series based on discussion at below thread
> > > >> https://patchwork.kernel.org/project/linux-arm-msm/patch/1648103831-
> > > >> [email protected]/
> > > >> Dropped the dt bindings PATCH 1/3 in v2
> > > >> https://patchwork.kernel.org/project/linux-arm-msm/cover/1636353710-
> > > >> [email protected]/
> > > >>
> > > >> v2:
> > > >> Updated the commit descriptions.
> > > >> Changed subject prefix from dwc to dwc3.
> > > >> Increased props array size.
> > > >>
> > > >> Sandeep Maheswaram (2):
> > > >> usb: host: xhci-plat: Add device property to set XHCI_SKIP_PHY_INIT
> > > >> quirk
> > > >> usb: dwc3: host: Set the property usb-skip-phy-init
> > > >>
> > > >> drivers/usb/dwc3/host.c | 4 +++-
> > > >> drivers/usb/host/xhci-plat.c | 3 +++
> > > >> 2 files changed, 6 insertions(+), 1 deletion(-)
> > > >>
> > > >> --
> > > >> 2.7.4
> > > >
> > > > Please let me know your opinion about this series.
> > >
> > > Otherwise looks good but wondering if we should document that new device
> > > property somewhere.
> > >
> > > Couldn't find a standard way how those device properties excluded from
> > > Documentation/devicetree/binding are documented
> >
> > Couldn't it be just documented in drivers/usb/host/xhci-plat.c for now?
>
> That's not where DT properties are documented.
It's not a DT property.
--
heikki
On Wed, Apr 20, 2022 at 04:20:52PM +0300, Mathias Nyman wrote:
> On 19.4.2022 13.17, Sandeep Maheswaram (Temp) (QUIC) wrote:
> > Hi Mathias, Felipe,
> >
> >> -----Original Message-----
> >> From: Sandeep Maheswaram (Temp) (QUIC) <[email protected]>
> >> Sent: Thursday, April 7, 2022 3:01 PM
> >> To: Greg Kroah-Hartman <[email protected]>; Felipe Balbi
> >> <[email protected]>; Stephen Boyd <[email protected]>; Doug
> >> Anderson <[email protected]>; Matthias Kaehlcke
> >> <[email protected]>; Mathias Nyman <[email protected]>
> >> Cc: [email protected]; [email protected]; linux-
> >> [email protected]; Pavan Kumar Kondeti (QUIC)
> >> <[email protected]>; Pratham Pratap (QUIC)
> >> <[email protected]>; Krishna Kurapati PSSNV (QUIC)
> >> <[email protected]>; Vidya Sagar Pulyala (Temp) (QUIC)
> >> <[email protected]>; Sandeep Maheswaram (Temp) (QUIC)
> >> <[email protected]>
> >> Subject: [PATCH v3 0/2] Skip phy initialization for DWC3 USB Controllers
> >>
> >> 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.
> >>
> >> v3:
> >> Coming back to this series based on discussion at below thread
> >> https://patchwork.kernel.org/project/linux-arm-msm/patch/1648103831-
> >> [email protected]/
> >> Dropped the dt bindings PATCH 1/3 in v2
> >> https://patchwork.kernel.org/project/linux-arm-msm/cover/1636353710-
> >> [email protected]/
> >>
> >> v2:
> >> Updated the commit descriptions.
> >> Changed subject prefix from dwc to dwc3.
> >> Increased props array size.
> >>
> >> Sandeep Maheswaram (2):
> >> usb: host: xhci-plat: Add device property to set XHCI_SKIP_PHY_INIT
> >> quirk
> >> usb: dwc3: host: Set the property usb-skip-phy-init
> >>
> >> drivers/usb/dwc3/host.c | 4 +++-
> >> drivers/usb/host/xhci-plat.c | 3 +++
> >> 2 files changed, 6 insertions(+), 1 deletion(-)
> >>
> >> --
> >> 2.7.4
> >
> > Please let me know your opinion about this series.
>
> Otherwise looks good but wondering if we should document that new device
> property somewhere.
>
> Couldn't find a standard way how those device properties excluded from
> Documentation/devicetree/binding are documented
Couldn't it be just documented in drivers/usb/host/xhci-plat.c for now?
thanks,
--
heikki
+Rob Herring
On Wed, Apr 20, 2022 at 05:36:57PM +0200, Greg Kroah-Hartman wrote:
> On Thu, Apr 07, 2022 at 03:01:27PM +0530, Sandeep Maheswaram wrote:
> > 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 <[email protected]>
> > ---
> > 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 649ffd8..7624ed9 100644
> > --- a/drivers/usb/host/xhci-plat.c
> > +++ b/drivers/usb/host/xhci-plat.c
> > @@ -305,6 +305,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;
>
> You forgot to document this new property. Without that, we can not
> accept this :(
>
Thanks Greg for taking a look. This series has a device tree binding doc
update but got dropped after Rob's comment here.
https://lore.kernel.org/linux-usb/YY7vAzxj9aR%[email protected]/
Sandeep,
Since, we could not come up with a way to limit this to only dwc3/cdns3
controllers, please include the device tree binding doc and re-send the
series.
https://lore.kernel.org/linux-usb/[email protected]/#t
has all the different options we dicussed and why we went with a dT param
for this.
Thanks,
Pavan