[rfc/rft/patch v2 13/19] usb: musb: received data length updated on dma abort

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Arnaud Mandy <ext-arnaud.2.mandy@xxxxxxxxx>

- separate DMAENAB and DMAMODE bit setting as mentioned in
user manual.
- update actual data length received during dma abort.

Signed-off-by: Arnaud Mandy <ext-arnaud.2.mandy@xxxxxxxxx>
Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxx>
---
 drivers/usb/musb/musbhsdma.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c
index d87a8f6..a3f164b 100644
--- a/drivers/usb/musb/musbhsdma.c
+++ b/drivers/usb/musb/musbhsdma.c
@@ -191,6 +191,7 @@ static int dma_channel_abort(struct dma_channel *channel)
 	struct musb_dma_channel *musb_channel = channel->private_data;
 	void __iomem *mbase = musb_channel->controller->base;
 
+	u32 addr = 0;
 	u8 bchannel = musb_channel->idx;
 	int offset;
 	u16 csr;
@@ -215,9 +216,12 @@ static int dma_channel_abort(struct dma_channel *channel)
 
 			csr = musb_readw(mbase, offset);
 			csr &= ~(MUSB_RXCSR_AUTOCLEAR |
-				 MUSB_RXCSR_DMAENAB |
-				 MUSB_RXCSR_DMAMODE);
+				 MUSB_RXCSR_DMAENAB);
 			musb_writew(mbase, offset, csr);
+			csr &= ~(MUSB_RXCSR_DMAENAB);
+			musb_writew(mbase, offset, csr);
+			addr = musb_read_hsdma_addr(mbase, bchannel);
+			channel->actual_len = addr - musb_channel->start_addr;
 		}
 
 		musb_writew(mbase,
-- 
1.6.4.2.253.g0b1fac

--
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

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux