[PATCH 2/3] staging: dwc2: when dma is disabled, clear hcd-self.uses_dma

2013-07-19 Thread Matthijs Kooijman
When dma is disabled inside dwc2 (because the hardware does not support
it, or the code was changed to disable it for testing), let the usb core
know about this by clearing hcd-self.uses_dma.

By default, the usb core assumes that dma is used when a dma_mask is
set, but this might not always match the dma_enable value in dwc2. To
prevent problems resulting from a mismatch, better to explicitely
disable dma in this case (though everything seemed to work with the
wrong value of uses_dma as well, probably only resulted in some unneeded
work).

Signed-off-by: Matthijs Kooijman matth...@stdin.nl
Acked-by: Paul Zimmerman paul.zimmer...@synopsys.com
---
 drivers/staging/dwc2/hcd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/dwc2/hcd.c b/drivers/staging/dwc2/hcd.c
index b5b229a..50a379d 100644
--- a/drivers/staging/dwc2/hcd.c
+++ b/drivers/staging/dwc2/hcd.c
@@ -2826,6 +2826,9 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq,
if (!hcd)
goto error1;
 
+   if (hsotg-core_params-dma_enable = 0)
+   hcd-self.uses_dma = 0;
+
hcd-has_tt = 1;
 
spin_lock_init(hsotg-lock);
-- 
1.8.3.rc1

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


[PATCH 2/3] staging: dwc2: when dma is disabled, clear hcd-self.uses_dma

2013-07-17 Thread Matthijs Kooijman
When dma is disabled inside dwc2 (because the hardware does not support
it, or the code was changed to disable it for testing), let the usb core
know about this by clearing hcd-self.uses_dma.

By default, the usb core assumes that dma is used when a dma_mask is
set, but this might not always match the dma_enable value in dwc2. To
prevent problems resulting from a mismatch, better to explicitely
disable dma in this case (though everything seemed to work with the
wrong value of uses_dma as well, probably only resulted in some unneeded
work).

Signed-off-by: Matthijs Kooijman matth...@stdin.nl
---
 drivers/staging/dwc2/hcd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/dwc2/hcd.c b/drivers/staging/dwc2/hcd.c
index 4791d81..22ac24c 100644
--- a/drivers/staging/dwc2/hcd.c
+++ b/drivers/staging/dwc2/hcd.c
@@ -2765,6 +2765,9 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq,
if (!hcd)
goto error1;
 
+   if (hsotg-core_params-dma_enable = 0)
+   hcd-self.uses_dma = 0;
+
hcd-has_tt = 1;
 
spin_lock_init(hsotg-lock);
-- 
1.8.3.rc1

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