Re: [PATCH] USB: cdc-wdm: don't enable interrupts in USB-giveback

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

 



On Tue, 12 Jun 2018, Sebastian Andrzej Siewior wrote:

> In the code path
>   __usb_hcd_giveback_urb()
>   -> wdm_in_callback()
>    -> service_outstanding_interrupt()
> 
> The function service_outstanding_interrupt() will unconditionally enable
> interrupts during unlock and invoke usb_submit_urb() with GFP_KERNEL.
> If the HCD completes in BH (like ehci does) then the context remains
> atomic due local_bh_disable() and enabling interrupts does not change
> this.
> 
> Add an argument to service_outstanding_interrupt() which decides
> whether or not it is save to enable interrupts during unlocking and use
> GFP_KERNEL or not.

Wouldn't it be easier just to use spin_lock_irqsave() and GFP_ATOMIC
all the time?  That's what people normally do with code that can be 
called in both process and interrupt contexts.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



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

  Powered by Linux