diff mbox series

[10/12] usb: gadget: udc: Remove in_interrupt()/in_irq() from comments

Message ID 20201014145728.208701440@linutronix.de
State Superseded
Headers show
Series UBS: Cleanup in_interupt/in_irq/in_atomic() usage | expand

Commit Message

Thomas Gleixner Oct. 14, 2020, 2:52 p.m. UTC
From: Ahmed S. Darwish <a.darwish@linutronix.de>

The usage of in_irq()/in_interrupt() in drivers is phased out for various
reasons.

The context description for usb_gadget_giveback_request() is misleading as
in_interupt() means: hard interrupt or soft interrupt or bottom half
disabled regions. But it's also invoked from task context when endpoints
are torn down. Remove it as it's more confusing than helpful.

Replace also the in_irq() comment with plain text.

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: Felipe Balbi <balbi@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org

---
 drivers/usb/gadget/udc/core.c      |    2 --
 drivers/usb/gadget/udc/dummy_hcd.c |    5 +++--
 2 files changed, 3 insertions(+), 4 deletions(-)

Comments

Alan Stern Oct. 14, 2020, 4:22 p.m. UTC | #1
On Wed, Oct 14, 2020 at 04:52:25PM +0200, Thomas Gleixner wrote:
> From: Ahmed S. Darwish <a.darwish@linutronix.de>
> 
> The usage of in_irq()/in_interrupt() in drivers is phased out for various
> reasons.
> 
> The context description for usb_gadget_giveback_request() is misleading as
> in_interupt() means: hard interrupt or soft interrupt or bottom half
> disabled regions. But it's also invoked from task context when endpoints
> are torn down. Remove it as it's more confusing than helpful.
> 
> Replace also the in_irq() comment with plain text.
> 
> 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: Felipe Balbi <balbi@kernel.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-usb@vger.kernel.org
> 
> ---

> --- a/drivers/usb/gadget/udc/dummy_hcd.c
> +++ b/drivers/usb/gadget/udc/dummy_hcd.c
> @@ -1754,8 +1754,9 @@ static int handle_control_request(struct
>  	return ret_val;
>  }
>  
> -/* drive both sides of the transfers; looks like irq handlers to
> - * both drivers except the callbacks aren't in_irq().
> +/* drive both sides of the transfers; looks like irq handlers to both
> + * drivers except that the callbacks are invoked from soft interrupt
> + * context.
>   */

You might as well fix the formatting of the multiline comment while 
you're changing its content.

Alan Stern
diff mbox series

Patch

--- a/drivers/usb/gadget/udc/core.c
+++ b/drivers/usb/gadget/udc/core.c
@@ -894,8 +894,6 @@  EXPORT_SYMBOL_GPL(usb_gadget_unmap_reque
  * @ep: the endpoint to be used with with the request
  * @req: the request being given back
  *
- * Context: in_interrupt()
- *
  * This is called by device controller drivers in order to return the
  * completed request back to the gadget layer.
  */
--- a/drivers/usb/gadget/udc/dummy_hcd.c
+++ b/drivers/usb/gadget/udc/dummy_hcd.c
@@ -1754,8 +1754,9 @@  static int handle_control_request(struct
 	return ret_val;
 }
 
-/* drive both sides of the transfers; looks like irq handlers to
- * both drivers except the callbacks aren't in_irq().
+/* drive both sides of the transfers; looks like irq handlers to both
+ * drivers except that the callbacks are invoked from soft interrupt
+ * context.
  */
 static void dummy_timer(struct timer_list *t)
 {