summaryrefslogtreecommitdiff
path: root/packages/linux/linux-omap-pm/dvb-fix-dma.diff
diff options
context:
space:
mode:
Diffstat (limited to 'packages/linux/linux-omap-pm/dvb-fix-dma.diff')
-rw-r--r--packages/linux/linux-omap-pm/dvb-fix-dma.diff60
1 files changed, 60 insertions, 0 deletions
diff --git a/packages/linux/linux-omap-pm/dvb-fix-dma.diff b/packages/linux/linux-omap-pm/dvb-fix-dma.diff
new file mode 100644
index 0000000000..e05473fc7f
--- /dev/null
+++ b/packages/linux/linux-omap-pm/dvb-fix-dma.diff
@@ -0,0 +1,60 @@
+Hi,
+I post this patch that fixes a kernel crash that happens when using a dvb
+usb stick on a mips platform and I think even on other platforms on which
+the dma access in not cache-coherent.
+
+The problem's origin is that, inside the method usb_bulk_urb_init of file
+drivers/media/dvb/dvb-usb/usb-urb.c, stream->urb_list[i]->transfer_buffer
+points to a memory area that has been allocated to be dma-coherent but
+stream->urb_list[i]->transfer_flags doesn't include the
+URB_NO_TRANSFER_DMA_MAP flag and stream->urb_list[i]->transfer_dma is not
+set.
+When later on the stream->urb_list[i]->transfer_buffer pointer is used
+inside function usb_hcd_submit_urb of file drivers/usb/core/hcd.c since the
+flag URB_NO_TRANSFER_DMA_MAP is not set the urb->transfer_buffer pointer is
+passed to the dma_map_single function that since the address is dma-coherent
+returns a wrong tranfer_dma address that later on leads to the kernel crash.
+
+The problem is solved by setting the URB_NO_TRANSFER_DMA_MAP flag and the
+stream->urb_list[i]->transfer_dma address.
+
+Perhaps to be more safe the URB_NO_TRANSFER_DMA_MAP flag can be set only
+if stream->urb_list[i]->transfer_dma != 0.
+
+I don't know if half of the fault can be of the dma_map_single function that
+should anyway returns a valid address both for a not dma-coherent and a
+dma-coherent address.
+
+Just to be clear:
+I've done this patch to solve my problem and I tested it only on a mips
+platform
+but I think it should not cause any problems on other platforms.
+I posted it here to help someone else that can have my same problem and to
+point it out
+to the mantainer of this part of code.
+You can use it at your own risk and I'm not resposible in any way for any
+problem or
+damage that it can cause.
+I'm available to discuss about it
+
+Bye
+
+Michele Scorcia
+
+--------------------
+
+
+
+
+--- /tmp/usb-urb.c 2008-10-08 09:53:23.000000000 +0200
++++ git/drivers/media/dvb/dvb-usb/usb-urb.c 2008-10-08 09:54:16.000000000 +0200
+@@ -152,7 +152,8 @@
+ stream->props.u.bulk.buffersize,
+ usb_urb_complete, stream);
+
+- stream->urb_list[i]->transfer_flags = 0;
++ stream->urb_list[i]->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
++ stream->urb_list[i]->transfer_dma = stream->dma_addr[i];
+ stream->urbs_initialized++;
+ }
+ return 0;