Skip to content

Commit

Permalink
usb: don't create dma pools for HCDs with a localmem_pool
Browse files Browse the repository at this point in the history
If the HCD provides a localmem pool we will never use the DMA pools, so
don't create them.

Fixes: b0310c2 ("USB: use genalloc for USB HCs with local memory")
Signed-off-by: Christoph Hellwig <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Christoph Hellwig authored and gregkh committed Aug 15, 2019
1 parent 141822a commit dd3ecf1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/usb/core/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ int hcd_buffer_create(struct usb_hcd *hcd)
char name[16];
int i, size;

if (!IS_ENABLED(CONFIG_HAS_DMA) ||
(!is_device_dma_capable(hcd->self.sysdev) &&
!hcd->localmem_pool))
if (hcd->localmem_pool ||
!IS_ENABLED(CONFIG_HAS_DMA) ||
!is_device_dma_capable(hcd->self.sysdev))
return 0;

for (i = 0; i < HCD_BUFFER_POOLS; i++) {
Expand Down

0 comments on commit dd3ecf1

Please sign in to comment.