On Fri, 14 Oct 2005, Nitin Mahajan wrote:
> The reason for this I have found out as follows.
> When we call
> usb_buffer_free (udev, sizeof (struct
> usb_ctrlrequest),
> urb [i]->setup_packet,
> urb [i]->setup_dma);
> in function test_ctrl_queue in usbtest.c, the value of
> urb[i]->setup_dma is different from the correspoding
> value when this dma buffer was allocated.
> This value has got changed due to call to
> dma_map_single, but a correspoding dma_unmap_single
> has not happened when we are attempting to free. Thus
> the error message from dma_pool_free.
> Could anyone please tell me what would be a correct
> way from the usb driver(usbtest.c) to trigger an
> approprite dma_unmap_single or this is a shortcoming
> in some part of USB host side stack.
It looks like a line of code got left out by mistake. This patch should
fix the problem by preventing the call to dma_map_single. Let me know if
it works.
Alan Stern
Index: usb-2.6/drivers/usb/misc/usbtest.c
===================================================================
--- usb-2.6.orig/drivers/usb/misc/usbtest.c
+++ usb-2.6/drivers/usb/misc/usbtest.c
@@ -983,6 +983,7 @@ test_ctrl_queue (struct usbtest_dev *dev
reqp->number = i % NUM_SUBCASES;
reqp->expected = expected;
u->setup_packet = (char *) &reqp->setup;
+ u->transfer_flags |= URB_NO_SETUP_DMA_MAP;
u->context = &context;
u->complete = ctrl_complete;
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel