Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 221930
b: refs/heads/master
c: 6e16edf
h: refs/heads/master
v: v3
  • Loading branch information
Anand Gadiyar authored and Felipe Balbi committed Nov 9, 2010
1 parent 07ab9dd commit e970368
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 07397021058b7db468b67f8c41ce29ef6331ab92
refs/heads/master: 6e16edfe62eb49274c8a74dc04d1c6f315f8f82b
14 changes: 14 additions & 0 deletions trunk/drivers/usb/musb/musbhsdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ static int dma_channel_program(struct dma_channel *channel,
dma_addr_t dma_addr, u32 len)
{
struct musb_dma_channel *musb_channel = channel->private_data;
struct musb_dma_controller *controller = musb_channel->controller;
struct musb *musb = controller->private_data;

DBG(2, "ep%d-%s pkt_sz %d, dma_addr 0x%x length %d, mode %d\n",
musb_channel->epnum,
Expand All @@ -167,6 +169,18 @@ static int dma_channel_program(struct dma_channel *channel,
BUG_ON(channel->status == MUSB_DMA_STATUS_UNKNOWN ||
channel->status == MUSB_DMA_STATUS_BUSY);

/*
* The DMA engine in RTL1.8 and above cannot handle
* DMA addresses that are not aligned to a 4 byte boundary.
* It ends up masking the last two bits of the address
* programmed in DMA_ADDR.
*
* Fail such DMA transfers, so that the backup PIO mode
* can carry out the transfer
*/
if ((musb->hwvers >= MUSB_HWVERS_1800) && (dma_addr % 4))
return false;

channel->actual_len = 0;
musb_channel->start_addr = dma_addr;
musb_channel->len = len;
Expand Down

0 comments on commit e970368

Please sign in to comment.