Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Robert Baldyga and committed by
Felipe Balbi
b963a81a 295538ff

+3
+3
drivers/usb/gadget/s3c-hsotg.c
··· 2150 2150 s3c_hsotg_complete_request(hsotg, ep, req, 2151 2151 result); 2152 2152 } 2153 + if(hsotg->dedicated_fifos) 2154 + if ((readl(hsotg->regs + DTXFSTS(ep->index)) & 0xffff) * 4 < 3072) 2155 + s3c_hsotg_txfifo_flush(hsotg, ep->index); 2153 2156 } 2154 2157 2155 2158 #define call_gadget(_hs, _entry) \