diff mbox series

[V2,13/13] usb: atm: Replace in_interrupt() usage in comment

Message ID 20201019101110.944939915@linutronix.de
State New
Headers show
Series [V2,01/13] USB: sisusbvga: Make console support depend on BROKEN | expand

Commit Message

Thomas Gleixner Oct. 19, 2020, 10:06 a.m. UTC
in_interrupt() is a pretty vague context description as it means: hard
interrupt, soft interrupt or bottom half disabled regions.

Replace the vague comment with a proper reasoning why spin_lock_irqsave()
needs to be used.

Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Duncan Sands <duncan.sands@free.fr>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org

---
 drivers/usb/atm/usbatm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Duncan Sands Oct. 19, 2020, 10:28 a.m. UTC | #1
On 10/19/20 12:06 PM, Thomas Gleixner wrote:
> in_interrupt() is a pretty vague context description as it means: hard
> interrupt, soft interrupt or bottom half disabled regions.
> 
> Replace the vague comment with a proper reasoning why spin_lock_irqsave()
> needs to be used.
> 
> Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: Duncan Sands <duncan.sands@free.fr>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-usb@vger.kernel.org
> 
> ---
>   drivers/usb/atm/usbatm.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/drivers/usb/atm/usbatm.c
> +++ b/drivers/usb/atm/usbatm.c
> @@ -249,7 +249,7 @@ static void usbatm_complete(struct urb *
>   	/* vdbg("%s: urb 0x%p, status %d, actual_length %d",
>   	     __func__, urb, status, urb->actual_length); */
>   
> -	/* usually in_interrupt(), but not always */
> +	/* Can be invoked from task context, protect against interrupts */
>   	spin_lock_irqsave(&channel->lock, flags);
>   
>   	/* must add to the back when receiving; doesn't matter when sending */
> 


Signed-off-by: Duncan Sands <duncan.sands@free.fr>
diff mbox series

Patch

--- a/drivers/usb/atm/usbatm.c
+++ b/drivers/usb/atm/usbatm.c
@@ -249,7 +249,7 @@  static void usbatm_complete(struct urb *
 	/* vdbg("%s: urb 0x%p, status %d, actual_length %d",
 	     __func__, urb, status, urb->actual_length); */
 
-	/* usually in_interrupt(), but not always */
+	/* Can be invoked from task context, protect against interrupts */
 	spin_lock_irqsave(&channel->lock, flags);
 
 	/* must add to the back when receiving; doesn't matter when sending */