Skip to content

Commit

Permalink
usb: musb: dsps: implement clear_ep_rxintr() callback
Browse files Browse the repository at this point in the history
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+.

cc: [email protected] # 4.1+
Signed-off-by: Bin Liu <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
liubiin authored and gregkh committed Jan 5, 2017
1 parent 6def85a commit c48400b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/usb/musb/musb_dsps.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,17 @@ static void otg_timer(unsigned long _musb)
pm_runtime_put_autosuspend(dev);
}

void dsps_musb_clear_ep_rxintr(struct musb *musb, int epnum)
{
u32 epintr;
struct dsps_glue *glue = dev_get_drvdata(musb->controller->parent);
const struct dsps_musb_wrapper *wrp = glue->wrp;

/* musb->lock might already been held */
epintr = (1 << epnum) << wrp->rxep_shift;
musb_writel(musb->ctrl_base, wrp->epintr_status, epintr);
}

static irqreturn_t dsps_interrupt(int irq, void *hci)
{
struct musb *musb = hci;
Expand Down Expand Up @@ -622,6 +633,7 @@ static struct musb_platform_ops dsps_ops = {

.set_mode = dsps_musb_set_mode,
.recover = dsps_musb_recover,
.clear_ep_rxintr = dsps_musb_clear_ep_rxintr,
};

static u64 musb_dmamask = DMA_BIT_MASK(32);
Expand Down

0 comments on commit c48400b

Please sign in to comment.