[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <1386331425-16594-3-git-send-email-r.baldyga@samsung.com>
Date: Fri, 06 Dec 2013 13:03:45 +0100
From: Robert Baldyga <r.baldyga@...sung.com>
To: balbi@...com
Cc: gregkh@...uxfoundation.org, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org, b.zolnierkie@...sung.com,
m.szyprowski@...sung.com, andrzej.p@...sung.com,
Robert Baldyga <r.baldyga@...sung.com>,
Kyungmin Park <kyungmin.park@...sung.com>
Subject: [PATCH 2/2] 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@...sung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@...sung.com>
---
drivers/usb/gadget/s3c-hsotg.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c
index ad9a4ed..4a085e6 100644
--- a/drivers/usb/gadget/s3c-hsotg.c
+++ b/drivers/usb/gadget/s3c-hsotg.c
@@ -2156,6 +2156,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) \
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists