From: Takashi Iwai Subject: Re: [PATCH] ALSA: usb-audio: Don't resubmit pending URBs at MIDI error recovery Date: Sat, 06 Dec 2014 21:45:39 +0100 Message-ID: References: <1417885834-10030-1-git-send-email-tiwai@suse.de> <54835F08.9020500@ladisch.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id EA64D2605B0 for ; Sat, 6 Dec 2014 21:45:39 +0100 (CET) In-Reply-To: <54835F08.9020500@ladisch.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Clemens Ladisch Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Sat, 06 Dec 2014 20:54:48 +0100, Clemens Ladisch wrote: > > Takashi Iwai wrote: > > In snd_usbmidi_error_timer(), the driver tries to resubmit MIDI input > > URBs to reactivate the MIDI stream, but this causes the error when > > some of URBs are still pending > > I wonder what kept the other URBs alive. I'm not quite sure, but maybe it's controller-specific issues. FWIW, the reporter used R-Pi. > > For avoiding these errors, check the pending URBs and skip > > resubmitting such ones. > > > > Reported-and-tested-by: Stefan Seyfried > > Cc: > > Signed-off-by: Takashi Iwai > > Anyway, > Acked-by: Clemens Ladisch Queued now. thanks, Takashi > > --- > > sound/usb/midi.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/sound/usb/midi.c b/sound/usb/midi.c > > index d3d49525a16b..5bfb695547f8 100644 > > --- a/sound/usb/midi.c > > +++ b/sound/usb/midi.c > > @@ -365,6 +365,8 @@ static void snd_usbmidi_error_timer(unsigned long data) > > if (in && in->error_resubmit) { > > in->error_resubmit = 0; > > for (j = 0; j < INPUT_URBS; ++j) { > > + if (atomic_read(&in->urbs[j]->use_count)) > > + continue; > > in->urbs[j]->dev = umidi->dev; > > snd_usbmidi_submit_urb(in->urbs[j], GFP_ATOMIC); > > } >