Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2423736rdb; Wed, 21 Feb 2024 07:17:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVdXJh9hCp/56KKePShzsyPXSINQ07N8nyvr5znLKUoZt0/rZD+CTdLskKV4YPihJbCmzATBYFh6R4Xf4Z5FTeWPeg0VOYYsNqLhRV4LQ== X-Google-Smtp-Source: AGHT+IFcLnAxq3Hg6Pz6G/nY+9iO/eRXgvJ7MoXGKjMd7jePZjOVEGoWoT6YXz3mywL8t3ia4QMR X-Received: by 2002:a05:6a20:9598:b0:1a0:8a96:a6b9 with SMTP id iu24-20020a056a20959800b001a08a96a6b9mr15408239pzb.29.1708528676113; Wed, 21 Feb 2024 07:17:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708528676; cv=pass; d=google.com; s=arc-20160816; b=vQZZrAe5g0nOsXmDMqjkrFYvIok4Kjiyau6z5nuhmtaNKDw0hPSIZFJ7imLo49NgQ+ GgIBtWW9lUXll0HgO4c4/lkYTPrYq6SjMxizGBD8LJ0LDc1Eo4b4hSBxm4FiPcK0AXro w3ABo5Jmxw5A6o+zGahlM6nRKJZ4abJ1onu6T3RW5rnHvhMlkiYAbtRKMnG+QUae93oA +na0juOstrBlidP+sAkPYWpIikCVH14KaseFrw+/AQ0jmdC1ds/rwG7J4e5ihaDVDpcd 9MTHUCpV1y43U13l1U3D4ZGvchQDC1tmiiMOSiKZnTfvzKVI7IUMVeBGMBFTs+bv60je /Y2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=GPX9S1rm9Vg8m5o14NSvRKfN2x1/7W0W6eYoN9/iRhQ=; fh=j1wfx+Y1gw6Ds+sNuwdsEMvQffxGHz9AhyK97x1PvPA=; b=CWywLcJPKOExDwXLFJI53IruNVwIsFd/C7xbNcQR63yGLK3J736FxmnyI8k+MpXrh+ 46VtHsCqy19UHs5WcFi/tyYicHnA1lIrmm2Lkyqjpz1srjcmYKx97Q1EY4jmcH/jn5rR 8rdNhtvWhmqIVGRF1+bhRX9ifwGBsXt24lwvzYoJjz2kefbNI47WyhgqFrPm5f4rvx4Z dyXr8LVj9pw33D7HDFkuLCDC6IIJKv4lpyNoz2lKBzTgL+WSALpra+rtvjZAhwpg7+6Q bgMWG9f1Ttj3k0p/m7tgcHC6o99dJuk+DoxD0ijunduXiOXS/0MZinO3tKLlb+4AOJF9 jsAg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=mzO4ha5z; arc=pass (i=1 spf=pass spfdomain=opensource.cirrus.com dkim=pass dkdomain=cirrus.com dmarc=pass fromdomain=opensource.cirrus.com); spf=pass (google.com: domain of linux-kernel+bounces-74957-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74957-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h18-20020a056a00231200b006e466aa6862si5155833pfh.122.2024.02.21.07.17.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 07:17:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74957-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=mzO4ha5z; arc=pass (i=1 spf=pass spfdomain=opensource.cirrus.com dkim=pass dkdomain=cirrus.com dmarc=pass fromdomain=opensource.cirrus.com); spf=pass (google.com: domain of linux-kernel+bounces-74957-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74957-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1BABE288418 for ; Wed, 21 Feb 2024 15:05:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 480B58003E; Wed, 21 Feb 2024 15:05:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="mzO4ha5z" Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D952B7FBA9; Wed, 21 Feb 2024 15:05:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.152.168 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708527926; cv=none; b=R5Aw0Ny+8aA/ynAyIYTI6TGIil6Kuk8huDSpeyHlOVSnWJwdhf1Kb9Cy2ZVH8yjBQrZdE21ngM2P8u7ORfFPO7LkybA5b5smRZRuuQIMCx1juDMpbJqYEiLCpYxk78luG1A91GhBj/MG4NJ2tkfhyh3/DG4VJ/J35DNDI+3LSAM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708527926; c=relaxed/simple; bh=UyKUyA0qy67u/z9olIiAbwtiRO0bhToCby8jmDX8fYg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sTyO4i26kOG+o+qSWW782fhJ+V0hO9mmNnJUoKSqCPHBPWPa7c1/RH53U/sr9V1IgMw1aVRObWp4FWEoX/A5VOhDVmFYvKAMZI2A8aD/80lqTyR8MjXf8WAqf7ahujHat2vsZkzV7rgTWYNF4S6PEliYyl1bow2nC913QdpxVQs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=mzO4ha5z; arc=none smtp.client-ip=67.231.152.168 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41LCUQsF011338; Wed, 21 Feb 2024 09:05:09 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= PODMain02222019; bh=GPX9S1rm9Vg8m5o14NSvRKfN2x1/7W0W6eYoN9/iRhQ=; b= mzO4ha5zy8nyIjrVN2bdR++IumITPnNQBE1Rnu3EWPYm4e2Iy8sKD53722eVlyVR CZWirtpVIqTH/GAsp35DtOPAhssdnG5gTzLXQDILZNOPQIZklk7fMMXytYm5eZDX Fn3Hftjs4a1RwPjmCyjbz+nKbvV0ZipvI1qDpfT3OHjAQTzj2SAw1NyPE/Ha5aCP e0StsRlVcPDXsQq0BR+vdqvpkLzrKy9U8vTkk25G4ygO30YJujQtvVPUwAIf55K1 yrhD3/4NcZZCtkR5BepZIyJSTm9RHHQkH/4ihWtQT2pzPduVWE4bguQ5xLarHwPo 8VPu8g8aTlwkHOmufmr5CQ== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3wd205h4tk-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Feb 2024 09:05:09 -0600 (CST) Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 21 Feb 2024 15:05:07 +0000 Received: from ediswmail9.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40 via Frontend Transport; Wed, 21 Feb 2024 15:05:07 +0000 Received: from ediswws06.ad.cirrus.com (ediswws06.ad.cirrus.com [198.90.208.18]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTP id 248E0820249; Wed, 21 Feb 2024 15:05:07 +0000 (UTC) From: Richard Fitzgerald To: , CC: , , , , "Simon Trimmer" , Richard Fitzgerald Subject: [PATCH 2/9] ALSA: hda: hda_cs_dsp_ctl: Only call notify when a control has been added to a card Date: Wed, 21 Feb 2024 15:05:00 +0000 Message-ID: <20240221150507.1039979-3-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240221150507.1039979-1-rf@opensource.cirrus.com> References: <20240221150507.1039979-1-rf@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: dLqKW47PULXLedpvlwNu-fXJ16-lFzlY X-Proofpoint-GUID: dLqKW47PULXLedpvlwNu-fXJ16-lFzlY X-Proofpoint-Spam-Reason: safe From: Simon Trimmer There is a window of time where the cs_dsp_coeff_ctl has been created but has not been registered as a control with ALSA. The hda_cs_dsp_write_ctl() helper function can be used update the cs_dsp coefficient before it has been registered, but it should only call snd_ctl_notify() once the control is associated with a card. Signed-off-by: Simon Trimmer Signed-off-by: Richard Fitzgerald Fixes: e414b05e724f ("ALSA: hda: hda_cs_dsp_ctl: Add apis to write the controls directly") --- sound/pci/hda/hda_cs_dsp_ctl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/pci/hda/hda_cs_dsp_ctl.c b/sound/pci/hda/hda_cs_dsp_ctl.c index 463ca06036bf..0f5fdd44721c 100644 --- a/sound/pci/hda/hda_cs_dsp_ctl.c +++ b/sound/pci/hda/hda_cs_dsp_ctl.c @@ -224,9 +224,10 @@ int hda_cs_dsp_write_ctl(struct cs_dsp *dsp, const char *name, int type, if (ret == 0 || (cs_ctl->flags & WMFW_CTL_FLAG_SYS)) return 0; + /* Notify when a control has been added to a card */ ctl = cs_ctl->priv; - - snd_ctl_notify(ctl->card, SNDRV_CTL_EVENT_MASK_VALUE, &ctl->kctl->id); + if (ctl && ctl->kctl) + snd_ctl_notify(ctl->card, SNDRV_CTL_EVENT_MASK_VALUE, &ctl->kctl->id); return 0; } -- 2.30.2