USB: EHCI: don't allocate hardware periodic table atomically by default
authorVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Thu, 3 Jul 2014 14:53:30 +0000 (17:53 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jul 2014 23:16:07 +0000 (16:16 -0700)
ehci_mem_init() is executed one time during ehci_init() and by default
all memory allocations but ehci->periodic are done not atomically,
GFP_KERNEL is passed as flags parameter.

Do similar allocation for ehci->periodic and free some space in
coherent atomic DMA pool by default.

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-mem.c

index c0fb6a8ae6a3935e367e4a9c386e051acc739338..b6205fac356771bbc2a19ec87cce368e8bc23bce 100644 (file)
@@ -209,7 +209,7 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags)
        ehci->periodic = (__le32 *)
                dma_alloc_coherent (ehci_to_hcd(ehci)->self.controller,
                        ehci->periodic_size * sizeof(__le32),
-                       &ehci->periodic_dma, 0);
+                       &ehci->periodic_dma, flags);
        if (ehci->periodic == NULL) {
                goto fail;
        }