All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 1/2] usb: dwc2: Disable descriptor dma mode by default
@ 2014-05-06 23:00 dinguyen-EIB2kfCEclfQT0dZR+AlfA
       [not found] ` <1399417243-4614-1-git-send-email-dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: dinguyen-EIB2kfCEclfQT0dZR+AlfA @ 2014-05-06 23:00 UTC (permalink / raw)
  To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, paulz-HKixBCOQz3hWk0Htik3J/w
  Cc: dinh.linux-Re5JQEeQqe8AvxtiuMwx3w,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, Dinh Nguyen

From: Dinh Nguyen <dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>

Even though the IP supports Descriptor DMA mode, it does not support SPLIT
transactions in this mode. So the driver, in its currently form, will not
support LS/FS devices when connected to a HS Hub if Descriptor DMA mode is
enabled.

So we disable descriptor dma mode by default and a provide device tree property
for users to enable it if they really want to.

Signed-off-by: Dinh Nguyen <dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>
---
v2:
- Reworked patch to disable descriptor dma by default
- Removed unneeded helper variable
- Reword patch commit header
---
 drivers/usb/dwc2/platform.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index eaba547..cc50d00 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -134,6 +134,16 @@ static int dwc2_driver_probe(struct platform_device *dev)
 		/* Default all params to autodetect */
 		dwc2_set_all_params(&defparams, -1);
 		params = &defparams;
+
+		/*
+		 * Disable descriptor dma mode by default as the HW can support
+		 * it, but does not support it for SPLIT transactions. One can
+		 * use the device tree property "dma-desc-enable", if one really
+		 * wants to enable descriptor dma mode.
+		 */
+		defparams.dma_desc_enable = 0;
+		of_property_read_u32(dev->dev.of_node, "dma-desc-enable",
+					&defparams.dma_desc_enable);
 	}
 
 	hsotg = devm_kzalloc(&dev->dev, sizeof(*hsotg), GFP_KERNEL);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCHv2 2/2] Documentation: dt: add an optional dma-desc-enable property for dwc2 usb
       [not found] ` <1399417243-4614-1-git-send-email-dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>
@ 2014-05-06 23:00   ` dinguyen-EIB2kfCEclfQT0dZR+AlfA
       [not found]     ` <1399417243-4614-2-git-send-email-dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>
  2014-05-06 23:33   ` [PATCHv2 1/2] usb: dwc2: Disable descriptor dma mode by default Paul Zimmerman
  1 sibling, 1 reply; 4+ messages in thread
From: dinguyen-EIB2kfCEclfQT0dZR+AlfA @ 2014-05-06 23:00 UTC (permalink / raw)
  To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, paulz-HKixBCOQz3hWk0Htik3J/w
  Cc: dinh.linux-Re5JQEeQqe8AvxtiuMwx3w,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, Dinh Nguyen

From: Dinh Nguyen <dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>

The "dma-desc-enable" property can be used to enable descriptor DMA mode
for the DWC2 USB IP.

Signed-off-by: Dinh Nguyen <dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>
---
v2: Reword property description to enable instead of disable
---
 Documentation/devicetree/bindings/usb/dwc2.txt |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/dwc2.txt b/Documentation/devicetree/bindings/usb/dwc2.txt
index b8b6871..9b471b5 100644
--- a/Documentation/devicetree/bindings/usb/dwc2.txt
+++ b/Documentation/devicetree/bindings/usb/dwc2.txt
@@ -14,6 +14,13 @@ Refer to clk/clock-bindings.txt for generic clock consumer properties
 Optional properties:
 - phys: phy provider specifier
 - phy-names: shall be "device"
+- dma-desc-enable: Should be <1> to enable descriptor dma mode. This
+	property is used to enable descriptor DMA support. The reason why
+	this property is needed is because the HW supports descriptor DMA
+	mode, but descriptor dma mode will not support SPLIT transactions.
+	So this property can be used to optionally enable descriptor DMA
+	support.
+
 Refer to phy/phy-bindings.txt for generic phy consumer properties
 
 Example:
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCHv2 1/2] usb: dwc2: Disable descriptor dma mode by default
       [not found] ` <1399417243-4614-1-git-send-email-dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>
  2014-05-06 23:00   ` [PATCHv2 2/2] Documentation: dt: add an optional dma-desc-enable property for dwc2 usb dinguyen-EIB2kfCEclfQT0dZR+AlfA
@ 2014-05-06 23:33   ` Paul Zimmerman
  1 sibling, 0 replies; 4+ messages in thread
From: Paul Zimmerman @ 2014-05-06 23:33 UTC (permalink / raw)
  To: dinguyen-EIB2kfCEclfQT0dZR+AlfA, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	pawel.moll-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ
  Cc: dinh.linux-Re5JQEeQqe8AvxtiuMwx3w,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

> From: dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org [mailto:dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org]
> Sent: Tuesday, May 06, 2014 4:01 PM
> 
> Even though the IP supports Descriptor DMA mode, it does not support SPLIT
> transactions in this mode. So the driver, in its currently form, will not
> support LS/FS devices when connected to a HS Hub if Descriptor DMA mode is
> enabled.
> 
> So we disable descriptor dma mode by default and a provide device tree property
> for users to enable it if they really want to.

Hi Dinh,

I'd prefer not to add the DT property, at least for now. I doubt if
anyone will want to enable it. Besides, I'm not sure that a property
which only enables a driver feature is appropriate for DT.

So, if you redo patch 1 to remove the DT property read, and drop patch
2, you can add my acked-by. Thanks.

-- 
Paul

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCHv2 2/2] Documentation: dt: add an optional dma-desc-enable property for dwc2 usb
       [not found]     ` <1399417243-4614-2-git-send-email-dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>
@ 2014-05-07 16:22       ` Sergei Shtylyov
  0 siblings, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2014-05-07 16:22 UTC (permalink / raw)
  To: dinguyen-EIB2kfCEclfQT0dZR+AlfA, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	pawel.moll-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, paulz-HKixBCOQz3hWk0Htik3J/w
  Cc: dinh.linux-Re5JQEeQqe8AvxtiuMwx3w,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

Hello.

On 07-05-2014 3:00, dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org wrote:

> From: Dinh Nguyen <dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>

> The "dma-desc-enable" property can be used to enable descriptor DMA mode
> for the DWC2 USB IP.

> Signed-off-by: Dinh Nguyen <dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>
> ---
> v2: Reword property description to enable instead of disable
> ---
>   Documentation/devicetree/bindings/usb/dwc2.txt |    7 +++++++
>   1 file changed, 7 insertions(+)

> diff --git a/Documentation/devicetree/bindings/usb/dwc2.txt b/Documentation/devicetree/bindings/usb/dwc2.txt
> index b8b6871..9b471b5 100644
> --- a/Documentation/devicetree/bindings/usb/dwc2.txt
> +++ b/Documentation/devicetree/bindings/usb/dwc2.txt
> @@ -14,6 +14,13 @@ Refer to clk/clock-bindings.txt for generic clock consumer properties
>   Optional properties:
>   - phys: phy provider specifier
>   - phy-names: shall be "device"
> +- dma-desc-enable: Should be <1> to enable descriptor dma mode. This
> +	property is used to enable descriptor DMA support. The reason why
> +	this property is needed is because the HW supports descriptor DMA
> +	mode, but descriptor dma mode will not support SPLIT transactions.
> +	So this property can be used to optionally enable descriptor DMA
> +	support.

    Why not make this property boolean?

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2014-05-07 16:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-06 23:00 [PATCHv2 1/2] usb: dwc2: Disable descriptor dma mode by default dinguyen-EIB2kfCEclfQT0dZR+AlfA
     [not found] ` <1399417243-4614-1-git-send-email-dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>
2014-05-06 23:00   ` [PATCHv2 2/2] Documentation: dt: add an optional dma-desc-enable property for dwc2 usb dinguyen-EIB2kfCEclfQT0dZR+AlfA
     [not found]     ` <1399417243-4614-2-git-send-email-dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>
2014-05-07 16:22       ` Sergei Shtylyov
2014-05-06 23:33   ` [PATCHv2 1/2] usb: dwc2: Disable descriptor dma mode by default Paul Zimmerman

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.