Re: [PATCH 04/17 v2] USB: mv_udc: check if device mode in irq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux