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 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BA9A3C43334 for ; Fri, 15 Jul 2022 18:24:51 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C449D191A; Fri, 15 Jul 2022 20:23:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C449D191A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657909489; bh=cNYA09d1DpslphgC/jiIDOuSPJwKGONFlwhQZofzKys=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=N+Yl4AtY3kIfb6dxa/WPYPPlHVNHSDU6dVo5HoZaz3l2YXXddP55AYuKtzYk/ncb/ Cm9JhpYGxoTTU5MLJcDeuDlc+JN9NUAcq3u9HpjMXos85nZrLULwEoZAq3kfodUpQW 45Z5VCkVJ++zk/AoNDXwu5eLsZ+dg8NkRY0PhMT0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6A194F80153; Fri, 15 Jul 2022 20:23:59 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 64DF0F8015B; Fri, 15 Jul 2022 20:23:58 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 62822F800AA for ; Fri, 15 Jul 2022 20:23:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 62822F800AA Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="kVKLFI+0"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="C+4aXTfD" Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E933534F37; Fri, 15 Jul 2022 18:23:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1657909429; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zlX1SBiHyolk4eKthz5zlfIANizLnqdezHd2/yU49P4=; b=kVKLFI+0jkwvw4etP7WkqW3Cfq37yFym6cbDLA10nibx3NfItK2Tkk9+LBJxubRTFsI5LA MZa8i4od6t4gQ5N4DeRAUdavRkg5OCMZYaDNY+PkrGHgepacEYLtg2fkkT5OTqMV+eg14P sQfFzllYuTqdbg6De6VbwOiurWV394g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1657909429; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zlX1SBiHyolk4eKthz5zlfIANizLnqdezHd2/yU49P4=; b=C+4aXTfDSEH/mlXMjJ1h68+Ej5Ryn38wDNOAG9mQTMiLtdMPmW1nf3qcd6haoCEpHuu9Yc AAXEt7o1rsDKxWDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id AC47013754; Fri, 15 Jul 2022 18:23:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wmbmKLWw0WIhGQAAMHmgww (envelope-from ); Fri, 15 Jul 2022 18:23:49 +0000 Date: Fri, 15 Jul 2022 20:23:49 +0200 Message-ID: <874jziute2.wl-tiwai@suse.de> From: Takashi Iwai To: Pierre-Louis Bossart Subject: Re: [PATCH 6/9] ALSA: hda: Fix page fault in snd_hda_codec_shutdown() In-Reply-To: <3c40df55-3aee-1e08-493b-7b30cd84dc00@linux.intel.com> References: <20220706120230.427296-1-cezary.rojewski@intel.com> <20220706120230.427296-7-cezary.rojewski@intel.com> <3c40df55-3aee-1e08-493b-7b30cd84dc00@linux.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Cc: Cezary Rojewski , Kai Vehmanen , Bard Liao , alsa-devel@alsa-project.org, tiwai@suse.com, hdegoede@redhat.com, broonie@kernel.org, Ranjani Sridharan , amadeuszx.slawinski@linux.intel.com, =?ISO-8859-1?Q?P?= =?ISO-8859-1?Q?=E9ter?= Ujfalusi X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" On Fri, 15 Jul 2022 20:16:14 +0200, Pierre-Louis Bossart wrote: > > > > On 7/6/22 07:02, Cezary Rojewski wrote: > > If early probe of HDAudio bus driver fails e.g.: due to missing > > firmware file, snd_hda_codec_shutdown() ends in manipulating > > uninitialized codec->pcm_list_head causing page fault. > > > > Iinitialization of HDAudio codec in ASoC is split in two: > > - snd_hda_codec_device_init() > > - snd_hda_codec_device_new() > > > > snd_hda_codec_device_init() is called during probe_codecs() by HDAudio > > bus driver while snd_hda_codec_device_new() is called by > > codec-component's ->probe(). The second call will not happen until all > > components required by related sound card are present within the ASoC > > framework. With firmware failing to load during the PCI's deferred > > initialization i.e.: probe_work(), no platform components are ever > > registered. HDAudio codec enumeration is done at that point though, so > > the codec components became registered to ASoC framework, calling > > snd_hda_codec_device_init() in the process. > > > > Now, during platform reboot snd_hda_codec_shutdown() is called for every > > codec found on the HDAudio bus causing oops if any of them has not > > completed both of their initialization steps. Relocating field > > initialization fixes the issue. > > > > Signed-off-by: Cezary Rojewski > > This patch causes an across-the-board regression on all SOF platforms > using an HDaudio or iDISP codec. Only 'nocodec' platforms are > unaffected, see results at > https://sof-ci.01.org/linuxpr/PR3763/build394/devicetest/ > > Reverting this commit seems to fix the issue. > > Upstream merge: > https://github.com/thesofproject/linux/pull/3763 > > Issue and bisect results > https://github.com/thesofproject/linux/issues/3764 > > I don't know what this was supposed to fix on the shutdown path but it's > clearly having side effects on the probe/init path. Yeah, obviously the patch ignores the fact that hdac_hda does initialize the HD-audio codec without snd_hda_codec_device_init(). I'm going to revert the commit. thanks, Takashi