All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: dwc: host: add xhci_plat_priv quirk XHCI_SKIP_PHY_INIT
@ 2021-10-11 10:01 Sandeep Maheswaram
  2021-10-12  7:32 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Sandeep Maheswaram @ 2021-10-11 10:01 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Greg Kroah-Hartman, Felipe Balbi,
	Stephen Boyd, Doug Anderson, Matthias Kaehlcke, Mathias Nyman
  Cc: linux-arm-msm, linux-usb, linux-kernel, ppratap, pkondeti,
	Sandeep Maheswaram

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 <sanm@codeaurora.org>
---
 drivers/usb/dwc3/host.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index f29a264..0921f05 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -11,6 +11,11 @@
 #include <linux/platform_device.h>
 
 #include "core.h"
+#include "../host/xhci-plat.h"
+
+static const struct xhci_plat_priv xhci_plat_dwc3_xhci = {
+	.quirks = XHCI_SKIP_PHY_INIT,
+};
 
 static int dwc3_host_get_irq(struct dwc3 *dwc)
 {
@@ -115,6 +120,13 @@ int dwc3_host_init(struct dwc3 *dwc)
 		}
 	}
 
+	ret = platform_device_add_data(xhci, &xhci_plat_dwc3_xhci,
+			sizeof(struct xhci_plat_priv));
+	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");
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


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

* Re: [PATCH] usb: dwc: host: add xhci_plat_priv quirk XHCI_SKIP_PHY_INIT
  2021-10-11 10:01 [PATCH] usb: dwc: host: add xhci_plat_priv quirk XHCI_SKIP_PHY_INIT Sandeep Maheswaram
@ 2021-10-12  7:32 ` Greg Kroah-Hartman
  2021-10-14  5:40   ` Sandeep Maheswaram
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2021-10-12  7:32 UTC (permalink / raw)
  To: Sandeep Maheswaram
  Cc: Andy Gross, Bjorn Andersson, Felipe Balbi, Stephen Boyd,
	Doug Anderson, Matthias Kaehlcke, Mathias Nyman, linux-arm-msm,
	linux-usb, linux-kernel, ppratap, pkondeti

On Mon, Oct 11, 2021 at 03:31:57PM +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.
> 
> Signed-off-by: Sandeep Maheswaram <sanm@codeaurora.org>
> ---
>  drivers/usb/dwc3/host.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
> index f29a264..0921f05 100644
> --- a/drivers/usb/dwc3/host.c
> +++ b/drivers/usb/dwc3/host.c
> @@ -11,6 +11,11 @@
>  #include <linux/platform_device.h>
>  
>  #include "core.h"
> +#include "../host/xhci-plat.h"

Why are you tying the dwc3 driver to the xhci driver?


> +
> +static const struct xhci_plat_priv xhci_plat_dwc3_xhci = {
> +	.quirks = XHCI_SKIP_PHY_INIT,

If these quirks are now "global", they should go into a
include/linux/usb/ .h file, right?

thanks,

greg k-h

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

* Re: [PATCH] usb: dwc: host: add xhci_plat_priv quirk XHCI_SKIP_PHY_INIT
  2021-10-12  7:32 ` Greg Kroah-Hartman
@ 2021-10-14  5:40   ` Sandeep Maheswaram
  0 siblings, 0 replies; 3+ messages in thread
From: Sandeep Maheswaram @ 2021-10-14  5:40 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Andy Gross, Bjorn Andersson, Felipe Balbi, Stephen Boyd,
	Doug Anderson, Matthias Kaehlcke, Mathias Nyman, linux-arm-msm,
	linux-usb, linux-kernel, ppratap, pkondeti

Hi,

On 10/12/2021 1:02 PM, Greg Kroah-Hartman wrote:
> On Mon, Oct 11, 2021 at 03:31:57PM +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.
>>
>> Signed-off-by: Sandeep Maheswaram <sanm@codeaurora.org>
>> ---
>>   drivers/usb/dwc3/host.c | 12 ++++++++++++
>>   1 file changed, 12 insertions(+)
>>
>> diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
>> index f29a264..0921f05 100644
>> --- a/drivers/usb/dwc3/host.c
>> +++ b/drivers/usb/dwc3/host.c
>> @@ -11,6 +11,11 @@
>>   #include <linux/platform_device.h>
>>   
>>   #include "core.h"
>> +#include "../host/xhci-plat.h"
> Why are you tying the dwc3 driver to the xhci driver?
>
Can we add a  property usb-skip-phy-init  in drivers/usb/dwc3/host.c

props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb-skip-phy-init");

and set the quirk like this in xhci-plat.c

if (device_property_read_bool(tmpdev, "usb-skip-phy-init"))
             xhci->quirks |= XHCI_SKIP_PHY_INIT;

as below

if (device_property_read_bool(tmpdev, "usb2-lpm-disable"))
             xhci->quirks |= XHCI_HW_LPM_DISABLE;

  if (device_property_read_bool(tmpdev, "usb3-lpm-capable"))
             xhci->quirks |= XHCI_LPM_SUPPORT;



>> +
>> +static const struct xhci_plat_priv xhci_plat_dwc3_xhci = {
>> +	.quirks = XHCI_SKIP_PHY_INIT,
> If these quirks are now "global", they should go into a
> include/linux/usb/ .h file, right?
>
> thanks,
>
> greg k-h

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

end of thread, other threads:[~2021-10-14  5:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11 10:01 [PATCH] usb: dwc: host: add xhci_plat_priv quirk XHCI_SKIP_PHY_INIT Sandeep Maheswaram
2021-10-12  7:32 ` Greg Kroah-Hartman
2021-10-14  5:40   ` Sandeep Maheswaram

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.