On 12/22/2010 09:50 AM, Felipe Balbi wrote:
+ int (*is_req_compatible)(struct dma_controller *,
>+ struct musb_ep *, struct usb_request *);
you really don't need this. It's enough to do all checks in
rxstate()/txstate() before mapping the request
Mappings (dma_map_single, dma_sync_single_for_device) are currently done
in musb_gadget_queue(). Are you suggesting to move them to
rxstate()/txstate()?
The draw back I see to move them is that mapping operations will be
serialized
with any existing requests, where as in musb_gadget_queue() mappings still
can be done in parallel. Same reason they should not be moved to
->channel_program()
call itself.
With this patch dma can indicate in musb_gadget_queue() that there is no
need to map the
request I will not handle it in rxstate()/txstate().
and if you have to
fallback to pio (due to e.g. short packet) just go ahead and unmap the
buffer. No weird checks needed:-)
OK, thats minimum what I need.
>diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
>index edff014..362b3f7 100644
>--- a/drivers/usb/musb/musb_gadget.c
>+++ b/drivers/usb/musb/musb_gadget.c
>@@ -92,6 +92,28 @@
>
> /* ----------------------------------------------------------------------- */
>
>+static void musb_gadget_unmap_dma(struct musb *musb, struct musb_request *req)
you're unmapping the request, so would musb_gadget_unmap_request() be a
better name ?
OK.
Thanks,
--
Mian Yousaf Kaukab
--
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