From patchwork Wed Nov 5 12:39:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 5233821 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E6207C11AC for ; Wed, 5 Nov 2014 12:39:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1A82C201C0 for ; Wed, 5 Nov 2014 12:39:55 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id E91362017A for ; Wed, 5 Nov 2014 12:39:53 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id AF31A2606BC; Wed, 5 Nov 2014 13:39:49 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 7BB262606A8; Wed, 5 Nov 2014 13:39:41 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9A0D92606A8; Wed, 5 Nov 2014 13:39:39 +0100 (CET) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 8BC522606BB for ; Wed, 5 Nov 2014 13:39:31 +0100 (CET) Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 59B5CACEE; Wed, 5 Nov 2014 12:39:31 +0000 (UTC) Date: Wed, 05 Nov 2014 13:39:30 +0100 Message-ID: From: Takashi Iwai To: Chris J Arges In-Reply-To: References: <1413920787-4877-1-git-send-email-chris.j.arges@canonical.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.4 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: alsa-devel@alsa-project.org, robin@gareus.org, clemens@ladisch.de, th55@gmx.de, david.henningsson@canonical.com Subject: Re: [alsa-devel] [PATCH v2] Scarlett mixer interface inclusion X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" 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 X-Virus-Scanned: ClamAV using ClamSMTP At Wed, 05 Nov 2014 12:33:37 +0100, Takashi Iwai wrote: > > At Wed, 22 Oct 2014 08:36:50 +0200, > Takashi Iwai wrote: > > > > > 2) When unloading a device there are numerous sysfs_remove_group issues: > > > usb 1-1.1: USB disconnect, device number 6 > > > ------------[ cut here ]------------ > > > WARNING: CPU: 0 PID: 54 at /build/buildd/linux-3.16.0/fs/sysfs/group.c:219 sysfs_remove_group+0x99/0xa0() > > > sysfs group ffffffff82cbd6e0 not found for kobject 'midi1' > > (snip) > > > However this issue occured even without the patch applied. > > > > Yes, there was a similar report, but we couldn't reproduce here. > > It's a Oops coming from OSS midi device. This is fairly harmless, but > > annoying. Could you give your kernel config? Maybe there's some > > difference. > > I'm now checking this issue again, and I still couldn't reproduce it > on my local machines. Could you give your kernel config if this still > happens? > > Also, as a blind shot: does the patch below give any difference? Try the one below instead. This is for 3.18 but should be applicable to older kernels, too. (It's not applicable to for-next branch due to the recent cleanups, though.) Takashi diff --git a/sound/usb/card.c b/sound/usb/card.c index 7ecd0e8a5c51..f61ebb17cc64 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c @@ -591,18 +591,19 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, { struct snd_card *card; struct list_head *p; + bool was_shutdown; if (chip == (void *)-1L) return; card = chip->card; down_write(&chip->shutdown_rwsem); + was_shutdown = chip->shutdown; chip->shutdown = 1; up_write(&chip->shutdown_rwsem); mutex_lock(®ister_mutex); - chip->num_interfaces--; - if (chip->num_interfaces <= 0) { + if (!was_shutdown) { struct snd_usb_endpoint *ep; snd_card_disconnect(card); @@ -622,6 +623,10 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, list_for_each(p, &chip->mixer_list) { snd_usb_mixer_disconnect(p); } + } + + chip->num_interfaces--; + if (chip->num_interfaces <= 0) { usb_chip[chip->index] = NULL; mutex_unlock(®ister_mutex); snd_card_free_when_closed(card);