USB: OHCI: don't allocate HCCA atomically
authorVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Thu, 3 Jul 2014 18:37:41 +0000 (21:37 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jul 2014 23:16:07 +0000 (16:16 -0700)
OHCI HCCA memory region is allocated from atomic DMA pool one time
during usb_add_hcd() and deallocated by usb_remove_hcd().

Do non-atomic allocation of OHCI HCCA and free some space in
coherent atomic DMA pool.

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/ohci-hcd.c

index f98d03f3144c3de66ef831d0068b069ede71b42d..6f8ec52c7e0c95646e7dd9da81f14d3013fce50f 100644 (file)
@@ -559,7 +559,7 @@ static int ohci_init (struct ohci_hcd *ohci)
                return 0;
 
        ohci->hcca = dma_alloc_coherent (hcd->self.controller,
-                       sizeof *ohci->hcca, &ohci->hcca_dma, 0);
+                       sizeof(*ohci->hcca), &ohci->hcca_dma, GFP_KERNEL);
        if (!ohci->hcca)
                return -ENOMEM;