aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx231xx/cx231xx-audio.c
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2012-01-07 09:52:37 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-10 22:38:59 -0200
commit7a6f6c29d264cdd2fe0eb3d923217eed5f0ad134 (patch)
treefc2044a0b5f6300cafbae08285c84e8f9bc55fee /drivers/media/video/cx231xx/cx231xx-audio.c
parent[media] cx231xx: simplify argument passing to cx231xx_init_dev() (diff)
downloadlinux-dev-7a6f6c29d264cdd2fe0eb3d923217eed5f0ad134.tar.xz
linux-dev-7a6f6c29d264cdd2fe0eb3d923217eed5f0ad134.zip
[media] cx231xx: use URB_NO_TRANSFER_DMA_MAP on URBs allocated with usb_alloc_urb()
URBs allocated with usb_alloc_urb() are allocated from DMA-coherent areas, and therefore it is not necessary to call dma_map_single() on such buffers. Worst, on ARM, calling dma_map_single() on a DMA-coherent buffer will trigger a BUG_ON() in arch/arm/mm/dma-mapping.c. Therefore, we mark all URBs allocated with usb_alloc_urb() with the URB_NO_TRANSFER_DMA_MAP transfer_flags, so that the USB core does not do dma_map_single()/dma_unmap_single() on those buffers. This is similar to 882787ff8fdeb0be790547ee9b22b281095e95da for the gspca driver, and has already been discussed on the linux-media list in the past: http://www.mail-archive.com/linux-media@vger.kernel.org/msg37086.html. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx231xx/cx231xx-audio.c')
-rw-r--r--drivers/media/video/cx231xx/cx231xx-audio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/video/cx231xx/cx231xx-audio.c b/drivers/media/video/cx231xx/cx231xx-audio.c
index e5742a0e19a0..a2c2b7d343ec 100644
--- a/drivers/media/video/cx231xx/cx231xx-audio.c
+++ b/drivers/media/video/cx231xx/cx231xx-audio.c
@@ -307,7 +307,7 @@ static int cx231xx_init_audio_isoc(struct cx231xx *dev)
urb->context = dev;
urb->pipe = usb_rcvisocpipe(dev->udev,
dev->adev.end_point_addr);
- urb->transfer_flags = URB_ISO_ASAP;
+ urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP;
urb->transfer_buffer = dev->adev.transfer_buffer[i];
urb->interval = 1;
urb->complete = cx231xx_audio_isocirq;
@@ -368,7 +368,7 @@ static int cx231xx_init_audio_bulk(struct cx231xx *dev)
urb->context = dev;
urb->pipe = usb_rcvbulkpipe(dev->udev,
dev->adev.end_point_addr);
- urb->transfer_flags = 0;
+ urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
urb->transfer_buffer = dev->adev.transfer_buffer[i];
urb->complete = cx231xx_audio_bulkirq;
urb->transfer_buffer_length = sb_size;