[PATCH] usb: pass mem_flags to dma_alloc_coherent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When I want to use my webcam, I get:

                                 vvvvvvv
cheese: page allocation failure. order:5, mode:0x8004
Pid: 8100, comm: cheese Not tainted 2.6.30-rc2-wl-dirty #102
Call Trace:
 [<ffffffff802c5d8e>] __alloc_pages_internal+0x3fe/0x520
 [<ffffffff80210a20>] dma_generic_alloc_coherent+0x90/0x120
 [<ffffffffa001c91e>] hcd_buffer_alloc+0xee/0x130 [usbcore]
 [<ffffffffa000d52d>] usb_buffer_alloc+0x2d/0x40 [usbcore]
 [<ffffffffa0160e14>] uvc_alloc_urb_buffers+0x84/0x140 [uvcvideo]
 [<ffffffffa0160ff6>] uvc_init_video+0x126/0x400 [uvcvideo]
 [...]

Oddly, I remembered fixing this and putting in __GFP_NOWARN
because uvcvideo retries a smaller allocation. However, the
allocation function doesn't pass the gfp flags through to
dma_alloc_coherent so we still get the warning!

Signed-off-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>
---
Is there a particular reason it's passing 0? I haven't actually
tested this yet but it would seem like it should be this way?

 drivers/usb/core/buffer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- wireless-testing.orig/drivers/usb/core/buffer.c	2009-04-18 10:54:45.000000000 +0200
+++ wireless-testing/drivers/usb/core/buffer.c	2009-04-18 10:54:49.000000000 +0200
@@ -119,7 +119,7 @@ void *hcd_buffer_alloc(
 		if (size <= pool_max [i])
 			return dma_pool_alloc(hcd->pool [i], mem_flags, dma);
 	}
-	return dma_alloc_coherent(hcd->self.controller, size, dma, 0);
+	return dma_alloc_coherent(hcd->self.controller, size, dma, mem_flags);
 }
 
 void hcd_buffer_free(


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

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux