From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Henningsson Subject: Re: [RFC PATCH] ALSA: usb - fix race in creation of M-Audio Fast track pro driver Date: Mon, 14 Jan 2013 08:21:56 +0100 Message-ID: <50F3B214.2050306@canonical.com> References: <1357315338-2843-1-git-send-email-david.henningsson@canonical.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by alsa0.perex.cz (Postfix) with ESMTP id 1704126007E for ; Mon, 14 Jan 2013 08:21:58 +0100 (CET) In-Reply-To: <1357315338-2843-1-git-send-email-david.henningsson@canonical.com> 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: David Henningsson Cc: tiwai@suse.de, 1095315@bugs.launchpad.net, alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org On 01/04/2013 05:02 PM, David Henningsson wrote: > A patch in the 3.2 kernel caused regression with hotplugging the > M-Audio Fast track pro, or sound after suspend. I don't have the > device so I haven't done a full analysis, but it seems userspace > (both udev and pulseaudio) got confused when a card was created, > immediately destroyed, and then created again. Since there were no counter proposal patches and the below code actually fixes a problem for users, would you mind committing it? > > However, at least one person in the bug report (martin djfun) > reports that this patch resolves the issue for him. It also leaves > a message in the log: > "snd-usb-audio: probe of 1-1.1:1.1 failed with error -5" which is > a bit misleading. It is better than non-working audio, but maybe > there's a more elegant solution? > > BugLink: https://bugs.launchpad.net/bugs/1095315 > Signed-off-by: David Henningsson > --- > sound/usb/quirks.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > ...oh, and if you end up taking this patch as it is, you should probably > add cc to stable (3.2+). > > diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c > index acc12f0..e71fc8b 100644 > --- a/sound/usb/quirks.c > +++ b/sound/usb/quirks.c > @@ -387,11 +387,13 @@ static int snd_usb_fasttrackpro_boot_quirk(struct usb_device *dev) > * rules > */ > err = usb_driver_set_configuration(dev, 2); > - if (err < 0) { > + if (err < 0) > snd_printdd("error usb_driver_set_configuration: %d\n", > err); > - return -ENODEV; > - } > + /* Always return an error, so that we stop creating a device > + that will just be destroyed and recreated with a new > + configuration */ > + return -ENODEV; > } else > snd_printk(KERN_INFO "usb-audio: Fast Track Pro config OK\n"); > > -- David Henningsson, Canonical Ltd. https://launchpad.net/~diwic