All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-media@vger.kernel.org, <linux-usb@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	<tglx@linutronix.de>
Subject: Re: [PATCH 3/3] usb: core: remove local_irq_save() around ->complete() handler
Date: Mon, 10 Sep 2018 10:11:36 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.1809101011100.1584-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <20180910092000.14693-4-bigeasy@linutronix.de>

On Mon, 10 Sep 2018, Sebastian Andrzej Siewior wrote:

> The core disabled interrupts before invocation the ->complete handler
> because the handler might have expected that interrupts are disabled.
> 
> All handlers were audited and use proper locking now. With it, the core
> code no longer needs to disable interrupts before invoking the
> ->complete handler.
> Remove local_irq_save() statement before invoking the ->complete
> handler.
> 
> Cc: Alan Stern <stern@rowland.harvard.edu>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  drivers/usb/core/hcd.c | 13 -------------
>  1 file changed, 13 deletions(-)
> 
> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> index 1c21955fe7c00..f985d2303095c 100644
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c
> @@ -1755,20 +1755,7 @@ static void __usb_hcd_giveback_urb(struct urb *urb)
>  
>  	/* pass ownership to the completion handler */
>  	urb->status = status;
> -
> -	/*
> -	 * We disable local IRQs here avoid possible deadlock because
> -	 * drivers may call spin_lock() to hold lock which might be
> -	 * acquired in one hard interrupt handler.
> -	 *
> -	 * The local_irq_save()/local_irq_restore() around complete()
> -	 * will be removed if current USB drivers have been cleaned up
> -	 * and no one may trigger the above deadlock situation when
> -	 * running complete() in tasklet.
> -	 */
> -	local_irq_save(flags);
>  	urb->complete(urb);
> -	local_irq_restore(flags);
>  
>  	usb_anchor_resume_wakeups(anchor);
>  	atomic_dec(&urb->use_count);

Acked-by: Alan Stern <stern@rowland.harvard.edu>

WARNING: multiple messages have this Message-ID (diff)
From: Alan Stern <stern@rowland.harvard.edu>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-media@vger.kernel.org, linux-usb@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	tglx@linutronix.de
Subject: [3/3] usb: core: remove local_irq_save() around ->complete() handler
Date: Mon, 10 Sep 2018 10:11:36 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.1809101011100.1584-100000@iolanthe.rowland.org> (raw)

On Mon, 10 Sep 2018, Sebastian Andrzej Siewior wrote:

> The core disabled interrupts before invocation the ->complete handler
> because the handler might have expected that interrupts are disabled.
> 
> All handlers were audited and use proper locking now. With it, the core
> code no longer needs to disable interrupts before invoking the
> ->complete handler.
> Remove local_irq_save() statement before invoking the ->complete
> handler.
> 
> Cc: Alan Stern <stern@rowland.harvard.edu>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  drivers/usb/core/hcd.c | 13 -------------
>  1 file changed, 13 deletions(-)
> 
> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> index 1c21955fe7c00..f985d2303095c 100644
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c
> @@ -1755,20 +1755,7 @@ static void __usb_hcd_giveback_urb(struct urb *urb)
>  
>  	/* pass ownership to the completion handler */
>  	urb->status = status;
> -
> -	/*
> -	 * We disable local IRQs here avoid possible deadlock because
> -	 * drivers may call spin_lock() to hold lock which might be
> -	 * acquired in one hard interrupt handler.
> -	 *
> -	 * The local_irq_save()/local_irq_restore() around complete()
> -	 * will be removed if current USB drivers have been cleaned up
> -	 * and no one may trigger the above deadlock situation when
> -	 * running complete() in tasklet.
> -	 */
> -	local_irq_save(flags);
>  	urb->complete(urb);
> -	local_irq_restore(flags);
>  
>  	usb_anchor_resume_wakeups(anchor);
>  	atomic_dec(&urb->use_count);

Acked-by: Alan Stern <stern@rowland.harvard.edu>

  reply	other threads:[~2018-09-10 19:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-10  9:19 [PATCH 0/3] media: use irqsave() in USB's complete callback + remove local_irq_save Sebastian Andrzej Siewior
2018-09-10  9:19 ` [PATCH 1/3] media: em28xx-audio: use irqsave() in USB's complete callback Sebastian Andrzej Siewior
2018-09-10  9:19   ` [1/3] " Sebastian Andrzej Siewior
2018-09-10  9:19 ` [PATCH 2/3] media: tm6000: " Sebastian Andrzej Siewior
2018-09-10  9:19   ` [2/3] " Sebastian Andrzej Siewior
2018-09-10  9:20 ` [PATCH 3/3] usb: core: remove local_irq_save() around ->complete() handler Sebastian Andrzej Siewior
2018-09-10  9:20   ` [3/3] " Sebastian Andrzej Siewior
2018-09-10 14:11   ` Alan Stern [this message]
2018-09-10 14:11     ` Alan Stern
2018-09-10  9:25 ` [PATCH 0/3] media: use irqsave() in USB's complete callback + remove local_irq_save Mauro Carvalho Chehab
2018-09-10  9:30   ` Sebastian Andrzej Siewior
2018-09-10 13:37     ` Greg Kroah-Hartman
2018-09-10 15:58       ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44L0.1809101011100.1584-100000@iolanthe.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=bigeasy@linutronix.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.