aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBin Liu <b-liu@ti.com>2017-01-03 19:13:47 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-12 05:39:09 -0500
commit4a37dbe68289b5bddb43656385a230d13d56f6dc (patch)
treef24f8fad500cbdb422fe0d2cc188897bfc44dcaf
parent5de2dd7f1be18c1ee72c4aa4aeccb191982c1e7c (diff)
usb: musb: dsps: implement clear_ep_rxintr() callback
commit c48400baa02155a5ddad63e8554602e48782278c upstream. During dma teardown for dequque urb, if musb load is high, musb might generate bogus rx ep interrupt even when the rx fifo is flushed. In such case any of the follow log messages could happen. musb_host_rx 1853: BOGUS RX2 ready, csr 0000, count 0 musb_host_rx 1936: RX3 dma busy, csr 2020 As mentioned in the current inline comment, clearing ep interrupt in the teardown path avoids the bogus interrupt, so implement clear_ep_rxintr() callback. This bug seems to be existing since the initial driver for musb support, but I only validated the fix back to v4.1, so only cc stable for v4.1+. Signed-off-by: Bin Liu <b-liu@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/musb/musb_dsps.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index feae1561b9ab..9f125e179acd 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -267,6 +267,17 @@ static void otg_timer(unsigned long _musb)
267 pm_runtime_put_autosuspend(dev); 267 pm_runtime_put_autosuspend(dev);
268} 268}
269 269
270void dsps_musb_clear_ep_rxintr(struct musb *musb, int epnum)
271{
272 u32 epintr;
273 struct dsps_glue *glue = dev_get_drvdata(musb->controller->parent);
274 const struct dsps_musb_wrapper *wrp = glue->wrp;
275
276 /* musb->lock might already been held */
277 epintr = (1 << epnum) << wrp->rxep_shift;
278 musb_writel(musb->ctrl_base, wrp->epintr_status, epintr);
279}
280
270static irqreturn_t dsps_interrupt(int irq, void *hci) 281static irqreturn_t dsps_interrupt(int irq, void *hci)
271{ 282{
272 struct musb *musb = hci; 283 struct musb *musb = hci;
@@ -622,6 +633,7 @@ static struct musb_platform_ops dsps_ops = {
622 633
623 .set_mode = dsps_musb_set_mode, 634 .set_mode = dsps_musb_set_mode,
624 .recover = dsps_musb_recover, 635 .recover = dsps_musb_recover,
636 .clear_ep_rxintr = dsps_musb_clear_ep_rxintr,
625}; 637};
626 638
627static u64 musb_dmamask = DMA_BIT_MASK(32); 639static u64 musb_dmamask = DMA_BIT_MASK(32);