From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04DF9CA9EA0 for ; Fri, 25 Oct 2019 14:09:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D70C2206DD for ; Fri, 25 Oct 2019 14:09:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2503629AbfJYOJz (ORCPT ); Fri, 25 Oct 2019 10:09:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:44918 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388439AbfJYOJz (ORCPT ); Fri, 25 Oct 2019 10:09:55 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id C75AABA63; Fri, 25 Oct 2019 14:09:53 +0000 (UTC) Date: Fri, 25 Oct 2019 16:09:53 +0200 Message-ID: From: Takashi Iwai To: Sasha Levin Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH AUTOSEL 5.3 32/33] ALSA: hda: Add codec on bus address table lately In-Reply-To: <20191025135505.24762-32-sashal@kernel.org> References: <20191025135505.24762-1-sashal@kernel.org> <20191025135505.24762-32-sashal@kernel.org> 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/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 25 Oct 2019 15:55:04 +0200, Sasha Levin wrote: > > From: Takashi Iwai > > [ Upstream commit ee5f85d9290fe25d460bd320b7fe073075d72d33 ] > > The call of snd_hdac_bus_add_device() is needed only for registering > the codec onto the bus caddr_tbl[] that is referred essentially only > in the unsol event handler. That is, the reason of this call and the > release by the counter-part function snd_hdac_bus_remove_device() is > just to assure that the unsol event gets notified to the codec. > > But the current implementation of the unsol notification wouldn't work > properly when the codec is still in a premature init state. So this > patch tries to work around it by delaying the caddr_tbl[] registration > at the point of snd_hdac_device_register(). > > Also, the order of snd_hdac_bus_remove_device() and device_del() calls > are shuffled to make sure that the unsol event is masked before > deleting the device. > > BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204565 > Signed-off-by: Takashi Iwai > Signed-off-by: Sasha Levin Please drop this. This was reverted in the later commit. And this is a deja vu, the AUTOSEL seems constantly picking it up. Sasha, can you add a blacklist for avoiding it for future...? thanks, Takashi > --- > sound/hda/hdac_device.c | 21 ++++++++++++--------- > 1 file changed, 12 insertions(+), 9 deletions(-) > > diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c > index b26cc93e7e103..033bcef8751a8 100644 > --- a/sound/hda/hdac_device.c > +++ b/sound/hda/hdac_device.c > @@ -61,10 +61,6 @@ int snd_hdac_device_init(struct hdac_device *codec, struct hdac_bus *bus, > pm_runtime_get_noresume(&codec->dev); > atomic_set(&codec->in_pm, 0); > > - err = snd_hdac_bus_add_device(bus, codec); > - if (err < 0) > - goto error; > - > /* fill parameters */ > codec->vendor_id = snd_hdac_read_parm(codec, AC_NODE_ROOT, > AC_PAR_VENDOR_ID); > @@ -143,15 +139,22 @@ int snd_hdac_device_register(struct hdac_device *codec) > err = device_add(&codec->dev); > if (err < 0) > return err; > + err = snd_hdac_bus_add_device(codec->bus, codec); > + if (err < 0) > + goto error; > mutex_lock(&codec->widget_lock); > err = hda_widget_sysfs_init(codec); > mutex_unlock(&codec->widget_lock); > - if (err < 0) { > - device_del(&codec->dev); > - return err; > - } > + if (err < 0) > + goto error_remove; > > return 0; > + > + error_remove: > + snd_hdac_bus_remove_device(codec->bus, codec); > + error: > + device_del(&codec->dev); > + return err; > } > EXPORT_SYMBOL_GPL(snd_hdac_device_register); > > @@ -165,8 +168,8 @@ void snd_hdac_device_unregister(struct hdac_device *codec) > mutex_lock(&codec->widget_lock); > hda_widget_sysfs_exit(codec); > mutex_unlock(&codec->widget_lock); > - device_del(&codec->dev); > snd_hdac_bus_remove_device(codec->bus, codec); > + device_del(&codec->dev); > } > } > EXPORT_SYMBOL_GPL(snd_hdac_device_unregister); > -- > 2.20.1 >