From: Jason Wang Date: Fri, 3 Sep 2010 09:57:19 +0000 (-0300) Subject: V4L/DVB: gspca - main: Fix a crash of some webcams on ARM arch X-Git-Tag: v2.6.35.8~81 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a035671ad3092e51c5c1d92b39a2ef196b5ab83a;p=karo-tx-linux.git V4L/DVB: gspca - main: Fix a crash of some webcams on ARM arch commit 882787ff8fdeb0be790547ee9b22b281095e95da upstream. When plugging some webcams on ARM, the system crashes. This is because we alloc buffer for an urb through usb_buffer_alloc, the alloced buffer is already in DMA coherent region, so we should set the flag of this urb to URB_NO_TRANSFER_DMA_MAP, otherwise when we submit this urb, the hcd core will handle this address as an non-DMA address and call dma_map_single/sg to map it. On arm architecture, dma_map_single a DMA coherent address will be catched by a BUG_ON(). Signed-off-by: Jason Wang Signed-off-by: Jean-François Moine Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 678675bb3652..59aba2434383 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c @@ -223,6 +223,7 @@ static int alloc_and_submit_int_urb(struct gspca_dev *gspca_dev, usb_rcvintpipe(dev, ep->bEndpointAddress), buffer, buffer_len, int_irq, (void *)gspca_dev, interval); + urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; gspca_dev->int_urb = urb; ret = usb_submit_urb(urb, GFP_KERNEL); if (ret < 0) {