Hi, On Thu, Sep 22, 2011 at 03:03:51PM +0800, Neil Zhang wrote: > check if the controller was in device mode in irq. > If not, we just return IRQ_NONE. > > Signed-off-by: Neil Zhang <zhangwm@xxxxxxxxxxx> > --- > drivers/usb/gadget/mv_udc_core.c | 8 +++++++- > 1 files changed, 7 insertions(+), 1 deletions(-) > > diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c > index 44d6e68..8fb7e25 100644 > --- a/drivers/usb/gadget/mv_udc_core.c > +++ b/drivers/usb/gadget/mv_udc_core.c > @@ -1867,10 +1867,16 @@ static void irq_process_error(struct mv_udc *udc) > static irqreturn_t mv_udc_irq(int irq, void *dev) > { > struct mv_udc *udc = (struct mv_udc *)dev; > - u32 status, intr; > + u32 status, intr, usbmode; > > spin_lock(&udc->lock); > > + usbmode = readl(&udc->op_regs->usbmode); > + if ((usbmode & USBMODE_CTRL_MODE_MASK) != USBMODE_CTRL_MODE_DEVICE) { > + spin_unlock(&udc->lock); > + return IRQ_NONE; > + } not sure if returning IRQ_NONE is the best here. Isn't it so that IRQ subsystem will disable the IRQ line after a certain amount of IRQ_NONE ?? Take a look at kernel/irq/spurious.c -- balbi
Attachment:
signature.asc
Description: Digital signature