Re: [PATCH V4] usb: musb: Unmapping the dma buffer when switching to PIO mode

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

 



Hello.

Hema HK wrote:

From: Hema HK  <hemahk@xxxxxx>

Buffer is mapped to dma when dma channel is allocated. buffer needs
to be unmapped when fallback to PIO mode if dma channel_program fails.

Signed-off-by: Hema HK <hemahk@xxxxxx>
---
Based off v2.6.34-rc5

Addressed review comments.

Index: linux-2.6/drivers/usb/musb/musb_gadget.c
===================================================================
--- linux-2.6.orig/drivers/usb/musb/musb_gadget.c
+++ linux-2.6/drivers/usb/musb/musb_gadget.c
@@ -92,6 +92,58 @@
/* ----------------------------------------------------------------------- */ +/* Maps the buffer to dma */
+
+static inline void map_dma_buffer(struct musb_request *request,
+				struct musb *musb)
+{
+	if (request->request.dma == DMA_ADDR_INVALID) {
+		printk(" map buffer");

   Why this (stray?) printk()?

+		request->request.dma = dma_map_single(
+				musb->controller,
+				request->request.buf,
+				request->request.length,
+				request->tx
+					? DMA_TO_DEVICE
+					: DMA_FROM_DEVICE);
+		request->mapped = 1;

WBR, Sergei
--
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