1
0
mirror of https://git.yoctoproject.org/meta-ti synced 2026-07-17 06:48:07 +00:00
Files
meta-ti/recipes-kernel/linux/linux-ti33x-psp-3.2/psp/0013-usb-musb-cppi41-fix-zero-byte-OUT-issue.patch
Koen Kooi 536748db58 linux-ti33x-psp 3.2: backport PM and USB fixes from PSP
The complete patchset will get rebased to the tip of the PSP tree soon, but the
conflicts take a lot of time to resolve.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
2012-06-11 16:59:07 -04:00

47 lines
1.6 KiB
Diff

From 4fbf77cebc6d141b9a74a92fd2b3f756908ef657 Mon Sep 17 00:00:00 2001
From: Ajay Kumar Gupta <ajay.gupta@ti.com>
Date: Wed, 18 Apr 2012 00:16:03 +0530
Subject: [PATCH 13/18] usb: musb: cppi41: fix zero byte OUT issue
Fixes ZERO byte transfer in tx direction which was not being done in DMA mode.
Used PIO mode for all zero byte tx transfer.
---
drivers/usb/musb/musb_host.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 7545a65..8981586 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -761,6 +761,8 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
void __iomem *epio = hw_ep->regs;
struct musb_qh *qh = musb_ep_get_qh(hw_ep, !is_out);
u16 packet_sz = qh->maxpacket;
+ u8 use_dma = 1;
+ u16 csr;
dev_dbg(musb->controller, "%s hw%d urb %p spd%d dev%d ep%d%s "
"h_addr%02x h_port%02x bytes %d\n",
@@ -772,9 +774,17 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
musb_ep_select(musb, mbase, epnum);
+ if (is_out && !len) {
+ use_dma = 0;
+ csr = musb_readw(epio, MUSB_TXCSR);
+ csr &= ~MUSB_TXCSR_DMAENAB;
+ musb_writew(epio, MUSB_TXCSR, csr);
+ hw_ep->tx_channel = NULL;
+ }
+
/* candidate for DMA? */
dma_controller = musb->dma_controller;
- if (is_dma_capable() && epnum && dma_controller) {
+ if (use_dma && is_dma_capable() && epnum && dma_controller) {
dma_channel = is_out ? hw_ep->tx_channel : hw_ep->rx_channel;
if (!dma_channel) {
dma_channel = dma_controller->channel_alloc(
--
1.7.7.6