Skip to content
Commit 5f5761cb authored by Mian Yousaf Kaukab's avatar Mian Yousaf Kaukab Committed by Felipe Balbi
Browse files

usb: musb: introduce api for dma code to check compatibility with usb request



Gadget MUSB driver handles dma mappings in musb_gadget_queue(). Where as it is
possible for  dma code to reject the usb request later at ->channel_program()
called from txstate()/rxstate()

For example ->channel_program in tusb6010_omap.c:

static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz,
        u8 rndis_mode, dma_addr_t dma_addr, u32 len)
{
...
	if (unlikely(dma_addr & 0x1) || (len < 32) || (len > packet_sz))
		return false;
...
	if (dma_addr & 0x2)
		return false;
...
}

In this case, usb request will be handled in PIO mode which renders dma mapping
operations unnecessary.

This patch adds an api to allow dma code to indicate incompatibility with usb
request. Gadget musb driver call this api, if available, before dma mappings to
avoid any unnecessary mapping operations.

Signed-off-by: default avatarMian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent c65bfa62
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment