Return-path: Received: from cantor2.suse.de ([195.135.220.15]:47014 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932176Ab3GKNtg (ORCPT ); Thu, 11 Jul 2013 09:49:36 -0400 Date: Thu, 11 Jul 2013 15:50:57 +0200 Message-ID: (sfid-20130711_154945_055680_B020A66A) From: Takashi Iwai To: Sergei Shtylyov Cc: Ming Lei , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Oliver Neukum , Alan Stern , linux-input@vger.kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-media@vger.kernel.org, alsa-devel@alsa-project.org, Jaroslav Kysela Subject: Re: [PATCH 45/50] sound: usb: usx2y: spin_lock in complete() cleanup In-Reply-To: <51DEAE4E.90204@cogentembedded.com> References: <1373533573-12272-1-git-send-email-ming.lei@canonical.com> <1373533573-12272-46-git-send-email-ming.lei@canonical.com> <51DEAE4E.90204@cogentembedded.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-wireless-owner@vger.kernel.org List-ID: At Thu, 11 Jul 2013 17:08:30 +0400, Sergei Shtylyov wrote: > > On 11-07-2013 13:06, Ming Lei wrote: > > > Complete() will be run with interrupt enabled, so change to > > spin_lock_irqsave(). > > Changelog doesn't match the patch. Yep, but moreover... > > Cc: Jaroslav Kysela > > Cc: Takashi Iwai > > Cc: alsa-devel@alsa-project.org > > Signed-off-by: Ming Lei > > --- > > sound/usb/usx2y/usbusx2yaudio.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c > > index 4967fe9..e2ee893 100644 > > --- a/sound/usb/usx2y/usbusx2yaudio.c > > +++ b/sound/usb/usx2y/usbusx2yaudio.c > > @@ -273,7 +273,11 @@ static void usX2Y_clients_stop(struct usX2Ydev *usX2Y) > > struct snd_usX2Y_substream *subs = usX2Y->subs[s]; > > if (subs) { > > if (atomic_read(&subs->state) >= state_PRERUNNING) { > > + unsigned long flags; > > + > > + local_irq_save(flags); > > snd_pcm_stop(subs->pcm_substream, SNDRV_PCM_STATE_XRUN); > > + local_irq_restore(flags); > > } ... actually this snd_pcm_stop() call should have been covered by snd_pcm_stream_lock(). Maybe it'd be enough to have a single patch together with the change, i.e. wrapping with snd_pcm_stream_lock_irqsave(). I'll prepare the patch for 3.11 independently from your patch series, so please drop this one. BTW, the word "cleanup" in the subject is inappropriate. This is rather a fix together with the core change. And, I wonder whether we can take a safer approach. When the caller condition changed, we often introduced either a different ops (e.g. ioctl case) or a flag for the new condition, at least during the transition period. Last but not least, is a conversion to tasklet really preferred? tasklet is rather an obsoleted infrastructure nowadays, and people don't recommend to use it any longer, AFAIK. thanks, Takashi