This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[AM335X ICS][TI-Android-ICS-4.0.3_AM335x_3.0.1.bin]USB1 host babble error

Other Parts Discussed in Thread: AM3517

Dear all,

我最近完成了AM335X ICS 3G dongle应用的开发。但是我发现一个问题, USB 3G dongle在AM335X USB1 HOST端口插着,工作个1个小时以上,会出现如下错误信息:
[ 4046.571336] ti81xx_interrupt 915: CAUTION: musb1: Babble Interrupt Occured
[ 4046.578520] ti81xx_interrupt 916: Please issue long reset to make usb functional !!
 
以上错误来自 Ti81xx.c (ti_ics\kernel\drivers\usb\musb) 文件中的下面函数, 我不太明白上面报错的意思?你们能给我一些意见吗?
 
static irqreturn_t ti81xx_interrupt(int irq, void *hci)
{
struct musb  *musb = hci;
void __iomem *reg_base = musb->ctrl_base;
unsigned long flags;
irqreturn_t ret = IRQ_NONE;
u32 pend1 = 0, pend2 = 0;
u32 epintr, usbintr;
u8  is_babble = 0;
 
spin_lock_irqsave(&musb->lock, flags);
 
/* Acknowledge and handle non-CPPI interrupts */
/* Get endpoint interrupts */
epintr = musb_readl(reg_base, USB_EP_INTR_STATUS_REG);
musb->int_rx = (epintr & USB_RX_INTR_MASK) >> USB_INTR_RX_SHIFT;
musb->int_tx = (epintr & USB_TX_INTR_MASK) >> USB_INTR_TX_SHIFT;
if (epintr)
musb_writel(reg_base, USB_EP_INTR_STATUS_REG, epintr);
 
/* Get usb core interrupts */
usbintr = musb_readl(reg_base, USB_CORE_INTR_STATUS_REG);
if (!usbintr && !epintr) {
dev_dbg(musb->controller, "sprious interrupt\n");
goto eoi;
}
 
if (usbintr)
musb_writel(reg_base, USB_CORE_INTR_STATUS_REG, usbintr);
musb->int_usb = (usbintr & USB_INTR_USB_MASK) >> USB_INTR_USB_SHIFT;
 
dev_dbg(musb->controller, "usbintr (%x) epintr(%x)\n", usbintr, epintr);
/*
 * DRVVBUS IRQs are the only proxy we have (a very poor one!) for
 * AM3517's missing ID change IRQ.  We need an ID change IRQ to
 * switch appropriately between halves of the OTG state machine.
 * Managing DEVCTL.SESSION per Mentor docs requires that we know its
 * value but DEVCTL.BDEVICE is invalid without DEVCTL.SESSION set.
 * Also, DRVVBUS pulses for SRP (but not at 5V) ...
 */
if ((usbintr & MUSB_INTR_BABBLE) && is_otg_enabled(musb)
&& (musb->xceiv->state == OTG_STATE_A_HOST))
is_babble = 1;
else if ((usbintr & MUSB_INTR_BABBLE) && !is_otg_enabled(musb)
&& is_host_enabled(musb))
is_babble = 1;
 
if (is_babble) {
if (musb->enable_babble_work)
musb->int_usb |= MUSB_INTR_DISCONNECT;
 
ERR("CAUTION: musb%d: Babble Interrupt Occured\n", musb->id);
ERR("Please issue long reset to make usb functional !!\n");
}
 
if (usbintr & (USB_INTR_DRVVBUS << USB_INTR_USB_SHIFT)) {
int drvvbus = musb_readl(reg_base, USB_STAT_REG);
void __iomem *mregs = musb->mregs;
u8 devctl = musb_readb(mregs, MUSB_DEVCTL);
int err;
 
err = is_host_enabled(musb) && (musb->int_usb &
MUSB_INTR_VBUSERROR);
if (err) {
/*
 * The Mentor core doesn't debounce VBUS as needed
 * to cope with device connect current spikes. This
 * means it's not uncommon for bus-powered devices
 * to get VBUS errors during enumeration.
 *
 * This is a workaround, but newer RTL from Mentor
 * seems to allow a better one: "re"-starting sessions
 * without waiting for VBUS to stop registering in
 * devctl.
 */
musb->int_usb &= ~MUSB_INTR_VBUSERROR;
musb->xceiv->state = OTG_STATE_A_WAIT_VFALL;
mod_timer(&musb->otg_workaround,
jiffies + POLL_SECONDS * HZ);
WARNING("VBUS error workaround (delay coming)\n");
} else if (is_host_enabled(musb) && drvvbus) {
musb->is_active = 1;
MUSB_HST_MODE(musb);
musb->xceiv->default_a = 1;
musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
del_timer(&musb->otg_workaround);
} else {
musb->is_active = 0;
MUSB_DEV_MODE(musb);
musb->xceiv->default_a = 0;
musb->xceiv->state = OTG_STATE_B_IDLE;
}
 
/* NOTE: this must complete power-on within 100 ms. */
dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n",
drvvbus ? "on" : "off",
otg_state_string(musb->xceiv->state),
err ? " ERROR" : "",
devctl);
ret = IRQ_HANDLED;
}
 
if (musb->int_tx || musb->int_rx || musb->int_usb)
ret |= musb_interrupt(musb);
 
 eoi:
/* EOI needs to be written for the IRQ to be re-asserted. */
if (ret == IRQ_HANDLED || epintr || usbintr) {
/* write EOI */
musb_writel(reg_base, USB_IRQ_EOI, 1);
}
 
/* Poll for ID change */
if (is_otg_enabled(musb) && musb->xceiv->state == OTG_STATE_B_IDLE)
mod_timer(&musb->otg_workaround, jiffies + POLL_SECONDS * HZ);
 
spin_unlock_irqrestore(&musb->lock, flags);
 
if (ret != IRQ_HANDLED) {
if (epintr || usbintr)
/*
 * We sometimes get unhandled IRQs in the peripheral
 * mode from EP0 and SOF...
 */
dev_dbg(musb->controller, "Unhandled USB IRQ %08x-%08x\n",
 epintr, usbintr);
else if (printk_ratelimit())
/*
 * We've seen series of spurious interrupts in the
 * peripheral mode after USB reset and then after some
 * time a real interrupt storm starting...
 */
dev_dbg(musb->controller, "Spurious IRQ, CPPI 4.1 status %08x, %08x\n",
 pend1, pend2);
}
 
if (is_babble) {
if (!musb->enable_babble_work) {
musb_writeb(musb->mregs, MUSB_DEVCTL,
musb_readb(musb->mregs, MUSB_DEVCTL) |
MUSB_DEVCTL_SESSION);
} else {
ERR("Babble: devtcl(%x)Restarting musb....\n",
 musb_readb(musb->mregs, MUSB_DEVCTL));
schedule_work(&musb->work);
}
}
return ret;
}