2022-03-01 10:41:02

by Sandeep Maheswaram

[permalink] [raw]
Subject: [PATCH v2 3/3] usb: dwc: host: add xhci_plat_priv quirk XHCI_SKIP_PHY_INIT

dwc3 manages PHY by own DRD driver, so skip the management by
HCD core.
During runtime suspend phy was not getting suspend because
runtime_usage value is 2.

Signed-off-by: Sandeep Maheswaram <[email protected]>
---
drivers/usb/dwc3/host.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index eda8719..d4fcf06 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -13,6 +13,12 @@
#include <linux/platform_device.h>

#include "core.h"
+#include <linux/usb/xhci-plat.h>
+#include <linux/usb/xhci-quirks.h>
+
+static const struct xhci_plat_priv xhci_plat_dwc3_xhci = {
+ .quirks = XHCI_SKIP_PHY_INIT,
+};

static void dwc3_host_fill_xhci_irq_res(struct dwc3 *dwc,
int irq, char *name)
@@ -122,6 +128,13 @@ int dwc3_host_init(struct dwc3 *dwc)
}
}

+ ret = platform_device_add_data(xhci, &xhci_plat_dwc3_xhci,
+ sizeof(xhci_plat_dwc3_xhci));
+ if (ret) {
+ dev_err(dwc->dev, "failed to add data to xHCI\n");
+ goto err;
+ }
+
ret = platform_device_add(xhci);
if (ret) {
dev_err(dwc->dev, "failed to register xHCI device\n");
--
2.7.4


2022-03-18 20:27:50

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v2 3/3] usb: dwc: host: add xhci_plat_priv quirk XHCI_SKIP_PHY_INIT

On Tue, Mar 01, 2022 at 03:58:27PM +0530, Sandeep Maheswaram wrote:
> dwc3 manages PHY by own DRD driver, so skip the management by
> HCD core.
> During runtime suspend phy was not getting suspend because
> runtime_usage value is 2.

I do not understand this last sentence, sorry. Try rewriting this a bit
to explain what is going on here.

thanks,

greg k-h

2022-03-21 22:46:20

by Sandeep Maheswaram

[permalink] [raw]
Subject: Re: [PATCH v2 3/3] usb: dwc: host: add xhci_plat_priv quirk XHCI_SKIP_PHY_INIT

Hi Greg,

On 3/18/2022 5:31 PM, Greg Kroah-Hartman wrote:
> On Tue, Mar 01, 2022 at 03:58:27PM +0530, Sandeep Maheswaram wrote:
>> dwc3 manages PHY by own DRD driver, so skip the management by
>> HCD core.
>> During runtime suspend phy was not getting suspend because
>> runtime_usage value is 2.
> I do not understand this last sentence, sorry. Try rewriting this a bit
> to explain what is going on here.
>
> thanks,
>
> greg k-h

Sure. I will update in the next version.

Regards

Sandeep