Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5936417pxb; Mon, 14 Feb 2022 11:07:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJyD3SAIViDh1zGB5pCQSpZIwy53rYUQD+jfPJgToolZPjfsrZO67M7xPvaxCUMf3nstHNOO X-Received: by 2002:a63:ff0a:: with SMTP id k10mr380754pgi.179.1644865663900; Mon, 14 Feb 2022 11:07:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644865663; cv=none; d=google.com; s=arc-20160816; b=cKvUhGULGQ3ImfTHf3l/nRwvReEC47Ic7yI4FAQAFCexSx44fLE5kM9L4dJ5MSOJg1 lwQoDdL9BbhQhlVa9FccUD5fafpelO0BvhFlCzSm22w0vo7t6YIVCg3+52L2KheEs/OJ IavgKd/bi+srBjdGYL8JHYHF9iurRXyX770ClrXL8KY0mJ3L+t0/6hDBADiVnMs2bhbB UVgilU7yXD3O8wFinHpIShCJ3A/nXbvUJHzXu3SNpcPYDW0a3/O1wKuPj+F9s/FE8Awb mGPdnEaO3/Od7lnx2MbsZoIKMSp+Uq8TJd8HwQusFdhDwUqy/X0GnYv9ZUulnVAgHy/p KQRg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=/sMYS+cVvTTfZe3V6GT2ukfPu0oCB4cflXXpLo4Rlxk=; b=QaaO11cv25TqwcxlJn2JY4WR5RCO+QSwN5kSc9x9GwgQ9Guc8IcwVhjiMYua4cBHuq hFidTHDraxiob0/pkNUMGKFRpconw0T3fCHcY8VsETlxk5iiSEcXGo9nnaI+1u9oe7H1 n2GoaWH4Lw1x6ttmELAexsBxvZ6roI9/xLVP9CLlb4BhGrvqqhtlBBqlcdeYSKAvezb8 ouji9/O9kYCZEAIYYYnAfPrvyy73UNSIXkn/9VTBljCCgHcyhHpW5YFgXMFfpELlgJwb WJolIrUCv/igbqPz+vSyC0AWuHYoChjX4YwTRENJeJd3RMcALOy3XwZdkJ0ylcP9zK4u GCfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@web.de header.s=dbaedf251592 header.b=nhMVruSl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=web.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f128si27570971pfa.40.2022.02.14.11.07.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 11:07:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=dbaedf251592 header.b=nhMVruSl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=web.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 431CF8B6D0; Mon, 14 Feb 2022 11:03:43 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344004AbiBNMyr (ORCPT + 99 others); Mon, 14 Feb 2022 07:54:47 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:45902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232769AbiBNMyr (ORCPT ); Mon, 14 Feb 2022 07:54:47 -0500 Received: from mout.web.de (mout.web.de [212.227.15.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AA3B9FF2 for ; Mon, 14 Feb 2022 04:54:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1644843277; bh=/INngvtpDk4+hVpxelv8+QybeQFB3fH4rs+P9VeEM9M=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=nhMVruSlyEW3wYRABGU2t7dG4F82yQ6GKVT9c0Y4VkgtY2LyhxqkwF9JxpgZZGJzP Ql3Vusn650nJXPuw0D3npX+JJbIL6Af3I5GsyWr/LgHUBvEbzuMq7WY+E45Y7mMSMi w2+BASh0q2yCy2J+/NaFIwyxGhp3VA47pYY3f4/k= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from schienar ([128.141.229.125]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MFs1z-1nVRv13q6J-00H83y; Mon, 14 Feb 2022 13:54:37 +0100 Date: Mon, 14 Feb 2022 13:54:35 +0100 From: Julian Wollrath To: Takashi Iwai Cc: linux-kernel@vger.kernel.org Subject: Re: v5.17.0-rc3: Regression bisecting failing suspend to disk: ALSA: hda: realtek: Fix race at concurrent COEF updates Message-ID: <20220214135435.47cff518@schienar> In-Reply-To: References: <20220214132838.4db10fca@schienar> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:wzhvPK8bHmJhVrBMm3Eo91URoBxFY/pww+uIZ9foLMlEzb2f1ug GV1B5gg1HrZrddCjGZbz5HSVlJ6ATRK74o/LTswu7akoDddba/pg9nFnfCOnWQGTUs04H5e aKDCIhjHks1hCQyojProD0VSCd/mrePH0wzLGeNp8KUj1G4dXrbYEj9BKPaak+1DnzZUyN/ 1ZnZXYzsSQJeMiR3kH9Yg== X-UI-Out-Filterresults: notjunk:1;V03:K0:cAx6LYdP+jo=:USA3A5ITINdYgV7NaPCxE1 k6amxKApZmneOMx+Lq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frbJXPcg6i/154 jglXeQcju3GBAE= X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Dear Takashi, > Does the patch below help? yes, that patch does the trick and removes the problem. Thank you! Julian > > > thanks, > > Takashi > > --- a/sound/pci/hda/patch_realtek.c > +++ b/sound/pci/hda/patch_realtek.c > @@ -138,6 +138,22 @@ struct alc_spec { > * COEF access helper functions > */ > > +static void coef_mutex_lock(struct hda_codec *codec) > +{ > + struct alc_spec *spec =3D codec->spec; > + > + snd_hda_power_up_pm(codec); > + mutex_lock(&spec->coef_mutex); > +} > + > +static void coef_mutex_unlock(struct hda_codec *codec) > +{ > + struct alc_spec *spec =3D codec->spec; > + > + mutex_unlock(&spec->coef_mutex); > + snd_hda_power_down_pm(codec); > +} > + > static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t > nid, unsigned int coef_idx) > { > @@ -151,12 +167,11 @@ static int __alc_read_coefex_idx(struct > hda_codec *codec, hda_nid_t nid, static int > alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, unsigned > int coef_idx) { > - struct alc_spec *spec =3D codec->spec; > unsigned int val; > > - mutex_lock(&spec->coef_mutex); > + coef_mutex_lock(codec); > val =3D __alc_read_coefex_idx(codec, nid, coef_idx); > - mutex_unlock(&spec->coef_mutex); > + coef_mutex_unlock(codec); > return val; > } > > @@ -173,11 +188,9 @@ static void __alc_write_coefex_idx(struct > hda_codec *codec, hda_nid_t nid, static void > alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, unsigned > int coef_idx, unsigned int coef_val) { > - struct alc_spec *spec =3D codec->spec; > - > - mutex_lock(&spec->coef_mutex); > + coef_mutex_lock(codec); > __alc_write_coefex_idx(codec, nid, coef_idx, coef_val); > - mutex_unlock(&spec->coef_mutex); > + coef_mutex_unlock(codec); > } > > #define alc_write_coef_idx(codec, coef_idx, coef_val) \ > @@ -198,11 +211,9 @@ static void alc_update_coefex_idx(struct > hda_codec *codec, hda_nid_t nid, unsigned int coef_idx, unsigned int > mask, unsigned int bits_set) > { > - struct alc_spec *spec =3D codec->spec; > - > - mutex_lock(&spec->coef_mutex); > + coef_mutex_lock(codec); > __alc_update_coefex_idx(codec, nid, coef_idx, mask, > bits_set); > - mutex_unlock(&spec->coef_mutex); > + coef_mutex_unlock(codec); > } > > #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ > @@ -235,9 +246,7 @@ struct coef_fw { > static void alc_process_coef_fw(struct hda_codec *codec, > const struct coef_fw *fw) > { > - struct alc_spec *spec =3D codec->spec; > - > - mutex_lock(&spec->coef_mutex); > + coef_mutex_lock(codec); > for (; fw->nid; fw++) { > if (fw->mask =3D=3D (unsigned short)-1) > __alc_write_coefex_idx(codec, fw->nid, > fw->idx, fw->val); @@ -245,7 +254,7 @@ static void > alc_process_coef_fw(struct hda_codec *codec, > __alc_update_coefex_idx(codec, fw->nid, fw->idx, fw->mask, fw->val); > } > - mutex_unlock(&spec->coef_mutex); > + coef_mutex_unlock(codec); > } > > /* =2D- () ascii ribbon campaign - against html e-mail /\ - against proprietary attachments