summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRobert Baldyga <r.baldyga@samsung.com>2013-12-06 13:03:45 +0100
committerFelipe Balbi <balbi@ti.com>2013-12-12 20:43:35 +0100
commitb963a81a4803fb387d6551ea0fb66876e0c8ff12 (patch)
treee01f177d140b9555d1b9bdf75f713414679404b3 /drivers
parentusb: gadget: s3c-hsotg: fix maxpacket size in s3c_hsotg_irq_enumdone (diff)
downloadlinux-b963a81a4803fb387d6551ea0fb66876e0c8ff12.tar.xz
linux-b963a81a4803fb387d6551ea0fb66876e0c8ff12.zip
usb: gadget: s3c-hsotg: add flush TX FIFO when kill all requests
This patch adds flushing TX FIFO in kill_all_requests() function in dedicated-fifo mode. It's because when requests are killed (when endpoint is disabled or in case of device reset/disconnection) in FIFO can stay some unsent data. In the worst case FIFO can stay full, and then if endpoint will be back enabled, sending new data will be impossible. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/s3c-hsotg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c
index 2fa7a9c593e3..6c80bfcefa87 100644
--- a/drivers/usb/gadget/s3c-hsotg.c
+++ b/drivers/usb/gadget/s3c-hsotg.c
@@ -2150,6 +2150,9 @@ static void kill_all_requests(struct s3c_hsotg *hsotg,
s3c_hsotg_complete_request(hsotg, ep, req,
result);
}
+ if(hsotg->dedicated_fifos)
+ if ((readl(hsotg->regs + DTXFSTS(ep->index)) & 0xffff) * 4 < 3072)
+ s3c_hsotg_txfifo_flush(hsotg, ep->index);
}
#define call_gadget(_hs, _entry) \