Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <daniel@zonque.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	alsa-devel@alsa-project.org
Cc: tglx@linutronix.de, Daniel Mack <zonque@gmail.com>,
	Takashi Iwai <tiwai@suse.com>,
	John Ogness <john.ogness@linutronix.de>
Subject: Re: [PATCH REPOST 1/2] ALSA: usb: caiaq: audio: use irqsave() in USB's complete callback
Date: Sun, 1 Jul 2018 20:46:43 +0200	[thread overview]
Message-ID: <30fa55ee-2df2-9c19-e1c2-953b14d6bec6@zonque.org> (raw)
In-Reply-To: <20180701152808.8041-2-bigeasy@linutronix.de>

On Sunday, July 01, 2018 05:28 PM, Sebastian Andrzej Siewior wrote:
> From: John Ogness <john.ogness@linutronix.de>
> 
> The USB completion callback does not disable interrupts while acquiring
> the lock. We want to remove the local_irq_disable() invocation from
> __usb_hcd_giveback_urb() and therefore it is required for the callback
> handler to disable the interrupts while acquiring the lock.
> The callback may be invoked either in IRQ or BH context depending on the
> USB host controller.
> Use the _irqsave() variant of the locking primitives.

Acked-by: Daniel Mack <daniel@zonque.org>

> Cc: Jaroslav Kysela <perex@perex.cz>
> Cc: Takashi Iwai <tiwai@suse.com>
> Signed-off-by: John Ogness <john.ogness@linutronix.de>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>   sound/usb/caiaq/audio.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
> index f35d29f49ffe..15344d39a6cd 100644
> --- a/sound/usb/caiaq/audio.c
> +++ b/sound/usb/caiaq/audio.c
> @@ -636,6 +636,7 @@ static void read_completed(struct urb *urb)
>   	struct device *dev;
>   	struct urb *out = NULL;
>   	int i, frame, len, send_it = 0, outframe = 0;
> +	unsigned long flags;
>   	size_t offset = 0;
>   
>   	if (urb->status || !info)
> @@ -672,10 +673,10 @@ static void read_completed(struct urb *urb)
>   		offset += len;
>   
>   		if (len > 0) {
> -			spin_lock(&cdev->spinlock);
> +			spin_lock_irqsave(&cdev->spinlock, flags);
>   			fill_out_urb(cdev, out, &out->iso_frame_desc[outframe]);
>   			read_in_urb(cdev, urb, &urb->iso_frame_desc[frame]);
> -			spin_unlock(&cdev->spinlock);
> +			spin_unlock_irqrestore(&cdev->spinlock, flags);
>   			check_for_elapsed_periods(cdev, cdev->sub_playback);
>   			check_for_elapsed_periods(cdev, cdev->sub_capture);
>   			send_it = 1;
> 

  reply	other threads:[~2018-07-01 18:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-01 15:28 [PATCH REPOST 0/2] ALSA: use irqsave in USB's completion callback Sebastian Andrzej Siewior
2018-07-01 15:28 ` [PATCH REPOST 1/2] ALSA: usb: caiaq: audio: use irqsave() in USB's complete callback Sebastian Andrzej Siewior
2018-07-01 18:46   ` Daniel Mack [this message]
2018-07-01 15:28 ` [PATCH REPOST 2/2] ALSA: usb-midi: " Sebastian Andrzej Siewior
2018-07-01 20:12   ` Clemens Ladisch
2018-07-02 13:52 ` [PATCH REPOST 0/2] ALSA: use irqsave in USB's completion callback Takashi Iwai

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=30fa55ee-2df2-9c19-e1c2-953b14d6bec6@zonque.org \
    --to=daniel@zonque.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=bigeasy@linutronix.de \
    --cc=john.ogness@linutronix.de \
    --cc=tglx@linutronix.de \
    --cc=tiwai@suse.com \
    --cc=zonque@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox