summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Moń <desowin@gmail.com>2021-06-09 16:07:42 +0200
committerTomasz Moń <desowin@gmail.com>2021-06-09 19:13:49 +0200
commita11c88e0df66b4020ef4d9025b9fb07f04402852 (patch)
tree27423521b7ad852826a944d80c83370d82619b50
parentefa173a9237278c9b98c5e7660103e66be541597 (diff)
downloadrockbox-a11c88e0df66b4020ef4d9025b9fb07f04402852.tar.gz
rockbox-a11c88e0df66b4020ef4d9025b9fb07f04402852.tar.bz2
rockbox-a11c88e0df66b4020ef4d9025b9fb07f04402852.zip
Sansa Connect: Fix sending ZLP on non-zero endpoint
This fixes panic when mass storage driver sends failed result. Change-Id: I14ae975b1f23aee7bc2f7bad6ed68dde29cf5e36
-rw-r--r--firmware/target/arm/tms320dm320/sansa-connect/tnetv105_usb_drv.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/firmware/target/arm/tms320dm320/sansa-connect/tnetv105_usb_drv.c b/firmware/target/arm/tms320dm320/sansa-connect/tnetv105_usb_drv.c
index bf1305824d..56251a96db 100644
--- a/firmware/target/arm/tms320dm320/sansa-connect/tnetv105_usb_drv.c
+++ b/firmware/target/arm/tms320dm320/sansa-connect/tnetv105_usb_drv.c
@@ -590,10 +590,21 @@ static int tnetv_ep_start_xmit(int epn, void *buf, int size)
else
{
dma_addr_t buffer = (dma_addr_t)buf;
- commit_discard_dcache_range(buf, size);
+ int send_zlp = 0;
+ if (size == 0)
+ {
+ /* Any address in SDRAM will do, contents do not matter */
+ buffer = CONFIG_SDRAM_START;
+ size = 1;
+ send_zlp = 1;
+ }
+ else
+ {
+ commit_discard_dcache_range(buf, size);
+ }
if ((buffer >= CONFIG_SDRAM_START) && (buffer + size < CONFIG_SDRAM_START + SDRAM_SIZE))
{
- if (tnetv_cppi_send(&cppi, (epn - 1), buffer, size, 0))
+ if (tnetv_cppi_send(&cppi, (epn - 1), buffer, size, send_zlp))
{
panicf("tnetv_cppi_send() failed");
}