Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7403450rwi; Mon, 24 Oct 2022 14:13:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5D+XD6B4/CQ8O8u8A7Ei496Xgb/178L34wn5zskY85Ot+wpNY+e+GQYPY1D3D+w7WQY+eZ X-Received: by 2002:a05:6402:f8e:b0:461:8b1c:eb0c with SMTP id eh14-20020a0564020f8e00b004618b1ceb0cmr11955607edb.20.1666646029242; Mon, 24 Oct 2022 14:13:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666646029; cv=none; d=google.com; s=arc-20160816; b=AgxjOoEeaTV+NQJ58HIhLHEDhaNRBwo3z5yWkcT4YLBn8NAbYE/lNsKMWizYxJ55xY 1pl2dVEPpMa+S43iZOaw2lMvwsoJcVVdHWce9YA2xMLaiPBGuSj+K6yikzaKqLDa9shL OEqc6lLOOUG4zv5GwnNPMZznsU6qEmyKuZSCOlrQqbnUUGHb0kA9at2PKucY0Cxwo1VO zyd6RwGfJfCKMUzWeRuoxMBM/KBIBogq95f6XI2473Hm/1LmDrCm+bbioOc8Shby0A48 TQJCOi1l0zx7XmzqLFogF/wWhq5tMRs8BBiqK/O+wxCXxYe4G/mANJLCUFRgzPlAXrqm 1Tbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=atmIPW4pkPtSzPiN6DQiWJf8LCKdXKDapj4r6ahHn6s=; b=Kup1FXIXM5kYCaT1iAqFFAevg5pe3kA3QuIySAu4Ux036ZDzIPMaWiMWusFb9cc6j8 oElKjODz6k+bju+gs/qPuQktzgHA0DGofS7Wqqal9b16cTVt09rbcaGPS4hxvVTfPRy0 yTIt0QN8ikCQBKwzEE3Lq5U8MBZWcFGSv2PGQ5A5bBLO8eelmzOCK5Li5bnjfmMpdwec +MKmagBK5xOZlokzGLf6501KzWYhu3tatzEujpYNngtz49ai0h4iN2479MlVI853gBR2 Df6Hk6sxS+GdMmfzI+bpqYRBbfWwMQHEN8Zgk8PCeliEqd2LWN+R+7x0exv2bRH5jmOw 7AJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=rMvkFD4p; dkim=neutral (no key) header.i=@suse.de header.b=CahLQ35+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z66-20020a509e48000000b0045c9dbe290csi691843ede.406.2022.10.24.14.13.03; Mon, 24 Oct 2022 14:13:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=rMvkFD4p; dkim=neutral (no key) header.i=@suse.de header.b=CahLQ35+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232879AbiJXVIK (ORCPT + 99 others); Mon, 24 Oct 2022 17:08:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231974AbiJXVHn (ORCPT ); Mon, 24 Oct 2022 17:07:43 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3342914D20; Mon, 24 Oct 2022 12:14:50 -0700 (PDT) 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 1F2E621BF0; Mon, 24 Oct 2022 14:39:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1666622379; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=atmIPW4pkPtSzPiN6DQiWJf8LCKdXKDapj4r6ahHn6s=; b=rMvkFD4pVT61mPfUmVbAenV97V4QAIipqH2l4E48eJWx+giF535kqg4u1kGg2/HFBRQYD9 t12rKyjvbto/QZE4KbLAcDzIa2GmQJqPtLadiFs2oSzzJ5eFuI/A6xI/7UNwe3rZzMXse/ +fBTpwUig/Xo9+4lZbbQYw6lYNek7BY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1666622379; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=atmIPW4pkPtSzPiN6DQiWJf8LCKdXKDapj4r6ahHn6s=; b=CahLQ35+Cy29a0PVeJ16FbzxPprgdMJqGE4RUyHKI1eJuFK+Z5zo/a95RWeHIfWrch1T6H hjNxA5M1zmeR3gDw== 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 EFBB413A79; Mon, 24 Oct 2022 14:39:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6lW5OaqjVmN3KAAAMHmgww (envelope-from ); Mon, 24 Oct 2022 14:39:38 +0000 From: Takashi Iwai To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , Sasha Levin , linux-kernel@vger.kernel.org Subject: [PATCH 6.0.y] Revert "ALSA: hda: Fix page fault in snd_hda_codec_shutdown()" Date: Mon, 24 Oct 2022 16:39:31 +0200 Message-Id: <20221024143931.15722-1-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 7494e2e6c55ed192f2b91c821fd6832744ba8741. Which was upstream commit f2bd1c5ae2cb0cf9525c9bffc0038c12dd7e1338. The patch caused a regression leading to the missing HD-audio device with ASoC SOF driver. It was a part of large series and backporting it alone breaks things while backporting the whole is too intrusive as stable changes. And, the issue the patch tries to address is a corner case, hence it's better to revert. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=216613 Signed-off-by: Takashi Iwai --- It's only for 6.0.y; 6.1-rc is fine sound/pci/hda/hda_codec.c | 41 ++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 4ae8b9574778..384426d7e9dd 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -931,28 +931,8 @@ snd_hda_codec_device_init(struct hda_bus *bus, unsigned int codec_addr, } codec->bus = bus; - codec->depop_delay = -1; - codec->fixup_id = HDA_FIXUP_ID_NOT_SET; - codec->core.dev.release = snd_hda_codec_dev_release; - codec->core.exec_verb = codec_exec_verb; codec->core.type = HDA_DEV_LEGACY; - mutex_init(&codec->spdif_mutex); - mutex_init(&codec->control_mutex); - snd_array_init(&codec->mixers, sizeof(struct hda_nid_item), 32); - snd_array_init(&codec->nids, sizeof(struct hda_nid_item), 32); - snd_array_init(&codec->init_pins, sizeof(struct hda_pincfg), 16); - snd_array_init(&codec->driver_pins, sizeof(struct hda_pincfg), 16); - snd_array_init(&codec->cvt_setups, sizeof(struct hda_cvt_setup), 8); - snd_array_init(&codec->spdif_out, sizeof(struct hda_spdif_out), 16); - snd_array_init(&codec->jacktbl, sizeof(struct hda_jack_tbl), 16); - snd_array_init(&codec->verbs, sizeof(struct hda_verb *), 8); - INIT_LIST_HEAD(&codec->conn_list); - INIT_LIST_HEAD(&codec->pcm_list_head); - INIT_DELAYED_WORK(&codec->jackpoll_work, hda_jackpoll_work); - refcount_set(&codec->pcm_ref, 1); - init_waitqueue_head(&codec->remove_sleep); - return codec; } EXPORT_SYMBOL_GPL(snd_hda_codec_device_init); @@ -1005,8 +985,29 @@ int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card, if (snd_BUG_ON(codec_addr > HDA_MAX_CODEC_ADDRESS)) return -EINVAL; + codec->core.dev.release = snd_hda_codec_dev_release; + codec->core.exec_verb = codec_exec_verb; + codec->card = card; codec->addr = codec_addr; + mutex_init(&codec->spdif_mutex); + mutex_init(&codec->control_mutex); + snd_array_init(&codec->mixers, sizeof(struct hda_nid_item), 32); + snd_array_init(&codec->nids, sizeof(struct hda_nid_item), 32); + snd_array_init(&codec->init_pins, sizeof(struct hda_pincfg), 16); + snd_array_init(&codec->driver_pins, sizeof(struct hda_pincfg), 16); + snd_array_init(&codec->cvt_setups, sizeof(struct hda_cvt_setup), 8); + snd_array_init(&codec->spdif_out, sizeof(struct hda_spdif_out), 16); + snd_array_init(&codec->jacktbl, sizeof(struct hda_jack_tbl), 16); + snd_array_init(&codec->verbs, sizeof(struct hda_verb *), 8); + INIT_LIST_HEAD(&codec->conn_list); + INIT_LIST_HEAD(&codec->pcm_list_head); + refcount_set(&codec->pcm_ref, 1); + init_waitqueue_head(&codec->remove_sleep); + + INIT_DELAYED_WORK(&codec->jackpoll_work, hda_jackpoll_work); + codec->depop_delay = -1; + codec->fixup_id = HDA_FIXUP_ID_NOT_SET; #ifdef CONFIG_PM codec->power_jiffies = jiffies; -- 2.35.3