]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: dwc2: when dma is disabled, clear hcd->self.uses_dma
authorMatthijs Kooijman <matthijs@stdin.nl>
Fri, 19 Jul 2013 09:34:23 +0000 (11:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jul 2013 21:59:38 +0000 (14:59 -0700)
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 <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dwc2/hcd.c

index f77e66333ac761d88001385cf40f14169a16d1ac..fbacf6a9f72ea3e45005b79740571d5efcbf3371 100644 (file)
@@ -2854,6 +2854,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);