From nobody Thu Dec 18 07:57:19 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1382C77B7A for ; Tue, 6 Jun 2023 10:35:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236918AbjFFKff (ORCPT ); Tue, 6 Jun 2023 06:35:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237301AbjFFKfT (ORCPT ); Tue, 6 Jun 2023 06:35:19 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4793B1 for ; Tue, 6 Jun 2023 03:34:59 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3565OZKo029668; Tue, 6 Jun 2023 05:34:46 -0500 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=I3l9dEf9Pxrt0iwsB+1r4Bv1ieTEMmtO3O+2uHhuyLc=; b=e25Mszs4AxgJCBdm903tcJ8vy2ERaVTYIEXI6hAMUqeTNC8wu+vBxf1vwj7Z2yuZQ8Qh 3IAR5lWnr5cIiFOo1al7Fx2UghT13lwKnAd1ESk9/vLII87Nn3awEvvsazz1dN9ze2ZF ifzCqHHE4jJs7emlj3YwChEsrj/EjXApSuFXIeR5zBqkpQZ53aq2wBLOf4T+Egli/GNT k7c2v3qAPX1s3aUaIIkMoSMwKO1eLQ4G+1nDkvH9uGlvbh6esLSHfdC83LvhSpAZiXp6 QBmoFCJWfn6RvByW3sxjuRskZmFOCxYZRUTm5s5vWY+OzLYwjiTta7asL73UImXOMwUs 5A== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3r01xnaxj3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 Jun 2023 05:34:45 -0500 Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 6 Jun 2023 11:34:44 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Tue, 6 Jun 2023 11:34:44 +0100 Received: from sbinding-cirrus-dsktp2.ad.cirrus.com (unknown [198.90.238.36]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id ECC9211C6; Tue, 6 Jun 2023 10:34:43 +0000 (UTC) From: Stefan Binding To: Jaroslav Kysela , Takashi Iwai CC: , , , Stefan Binding Subject: [PATCH v3 1/3] ALSA: hda: cs35l41: Clean up Firmware Load Controls Date: Tue, 6 Jun 2023 11:34:34 +0100 Message-ID: <20230606103436.455348-2-sbinding@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230606103436.455348-1-sbinding@opensource.cirrus.com> References: <20230606103436.455348-1-sbinding@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: 4xlscCVFeXNPze3XgusGQATzVDpQDq75 X-Proofpoint-GUID: 4xlscCVFeXNPze3XgusGQATzVDpQDq75 X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Ensure Firmware Load control and Firmware Type control returns 1 when the value changes. Remove fw_mutex from firmware load control put, since it is unnecessary, and prevents any possibility of mutex inversion. Signed-off-by: Stefan Binding --- sound/pci/hda/cs35l41_hda.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index b5210abb5141f..d100189e15b83 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -835,34 +835,26 @@ static int cs35l41_fw_load_ctl_put(struct snd_kcontro= l *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct cs35l41_hda *cs35l41 =3D snd_kcontrol_chip(kcontrol); - unsigned int ret =3D 0; - - mutex_lock(&cs35l41->fw_mutex); =20 if (cs35l41->request_fw_load =3D=3D ucontrol->value.integer.value[0]) - goto err; + return 0; =20 if (cs35l41->fw_request_ongoing) { dev_dbg(cs35l41->dev, "Existing request not complete\n"); - ret =3D -EBUSY; - goto err; + return -EBUSY; } =20 /* Check if playback is ongoing when initial request is made */ if (cs35l41->playback_started) { dev_err(cs35l41->dev, "Cannot Load/Unload firmware during Playback\n"); - ret =3D -EBUSY; - goto err; + return -EBUSY; } =20 cs35l41->fw_request_ongoing =3D true; cs35l41->request_fw_load =3D ucontrol->value.integer.value[0]; schedule_work(&cs35l41->fw_load_work); =20 -err: - mutex_unlock(&cs35l41->fw_mutex); - - return ret; + return 1; } =20 static int cs35l41_fw_type_ctl_get(struct snd_kcontrol *kcontrol, @@ -881,8 +873,12 @@ static int cs35l41_fw_type_ctl_put(struct snd_kcontrol= *kcontrol, struct cs35l41_hda *cs35l41 =3D snd_kcontrol_chip(kcontrol); =20 if (ucontrol->value.enumerated.item[0] < HDA_CS_DSP_NUM_FW) { - cs35l41->firmware_type =3D ucontrol->value.enumerated.item[0]; - return 0; + if (cs35l41->firmware_type !=3D ucontrol->value.enumerated.item[0]) { + cs35l41->firmware_type =3D ucontrol->value.enumerated.item[0]; + return 1; + } else { + return 0; + } } =20 return -EINVAL; --=20 2.34.1 From nobody Thu Dec 18 07:57:19 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2DFAC77B7A for ; Tue, 6 Jun 2023 10:35:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235699AbjFFKfl (ORCPT ); Tue, 6 Jun 2023 06:35:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237302AbjFFKfT (ORCPT ); Tue, 6 Jun 2023 06:35:19 -0400 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F350510F2 for ; Tue, 6 Jun 2023 03:35:00 -0700 (PDT) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3565N8jJ006095; Tue, 6 Jun 2023 05:34:47 -0500 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=eYBg8d8Hvj15ndjFUQ9ONSXAzqhuPZlCNKFw2fRkfqM=; b=lPERgH4VbDVJISBOYuuiYc/9MyB5ccv1+/2EAhdlbAsQJF4VYx2k3PV7Dq0dGQwsquwL AB1xxFkf7mPCW0+06S6t+Oh78ra9o1FZ3KsCkqNW2OH8rlSjVuX0v3dLcGI7HfKHr7vQ znLBodm7StYHJK+brz4Si2gLmybr6jLuSNeq1dk71SWb4sPnrv1AjkJ9pYVTjpMRzF6n Un/Chte2EQvQ+GJADiZpio55iyMvzizJ/0F3vHm62UXpoAE52viM07NZpn4C0EiJwPkt 6WgB6ixA9g/TtFA0ZwVBTwBOutIrWag0oedO30kNT4aO3kwy1LfcIouoD1FCd/aVhxQx cw== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3r02x1asf3-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 Jun 2023 05:34:46 -0500 Received: from ediex02.ad.cirrus.com (198.61.84.81) 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.26; Tue, 6 Jun 2023 11:34:44 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Tue, 6 Jun 2023 11:34:44 +0100 Received: from sbinding-cirrus-dsktp2.ad.cirrus.com (unknown [198.90.238.36]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 2DB09B2F; Tue, 6 Jun 2023 10:34:44 +0000 (UTC) From: Stefan Binding To: Jaroslav Kysela , Takashi Iwai CC: , , , Stefan Binding Subject: [PATCH v3 2/3] ALSA: hda: cs35l41: Fix endian conversions Date: Tue, 6 Jun 2023 11:34:35 +0100 Message-ID: <20230606103436.455348-3-sbinding@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230606103436.455348-1-sbinding@opensource.cirrus.com> References: <20230606103436.455348-1-sbinding@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: pGAQLpAMfUUpUum8VCGzvu5H1KEWN9ym X-Proofpoint-GUID: pGAQLpAMfUUpUum8VCGzvu5H1KEWN9ym X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Found during static analysis, ensure variables are correct types before endian conversion. Signed-off-by: Stefan Binding --- sound/pci/hda/cs35l41_hda.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index d100189e15b83..ce5faa6205170 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -308,8 +308,8 @@ static int cs35l41_request_firmware_files(struct cs35l4= 1_hda *cs35l41, } =20 #if IS_ENABLED(CONFIG_EFI) -static int cs35l41_apply_calibration(struct cs35l41_hda *cs35l41, unsigned= int ambient, - unsigned int r0, unsigned int status, unsigned int checksum) +static int cs35l41_apply_calibration(struct cs35l41_hda *cs35l41, __be32 a= mbient, __be32 r0, + __be32 status, __be32 checksum) { int ret; =20 @@ -745,7 +745,7 @@ static int cs35l41_runtime_resume(struct device *dev) =20 static int cs35l41_smart_amp(struct cs35l41_hda *cs35l41) { - int halo_sts; + __be32 halo_sts; int ret; =20 ret =3D cs35l41_init_dsp(cs35l41); @@ -773,7 +773,7 @@ static int cs35l41_smart_amp(struct cs35l41_hda *cs35l4= 1) &halo_sts, sizeof(halo_sts)); =20 if (ret) { - dev_err(cs35l41->dev, "Timeout waiting for HALO Core to start. State: %d= \n", + dev_err(cs35l41->dev, "Timeout waiting for HALO Core to start. State: %u= \n", halo_sts); goto clean_dsp; } --=20 2.34.1 From nobody Thu Dec 18 07:57:19 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D838C77B73 for ; Tue, 6 Jun 2023 10:35:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236977AbjFFKfu (ORCPT ); Tue, 6 Jun 2023 06:35:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237311AbjFFKfT (ORCPT ); Tue, 6 Jun 2023 06:35:19 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 948BB10F3 for ; Tue, 6 Jun 2023 03:35:01 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3565OZKp029668; Tue, 6 Jun 2023 05:34:46 -0500 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=AyhWPP1kgYcDXpfUImk0iDeFfbb+pb4A3CvCDnU8C2g=; b=K/jiTA2CBi2wOKTjOSv7HS0TE6h7sEgf3FNeKuNdKnDqt49DJj1VnubDc1mfTnLRBMFS FG0oZs7nF3QEFg/zO1SFg7aUeQ6gMpUXlVRL/LWHFgV9UrMM6TQe4fjD++Y6orQiKLLb 3HLgrCsYIGmKH+UGc5Av6rIVqpqSCntU/o7uIsMJS68OpWnylMwCr8LJzKWc4tuHSAjy SFZl0qJ0lZt+pUM0XpBBrnvLnHbViiMTfk4pM/NComyrcfvhIlzivLV2xW4eI4vTsAMM KE+uNYn0/q9RkIBQRa+yZkjmynW3bgktFnhjzPcZCRN5EJOWUI9nj7Bdy0JwoYccgYyp aw== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3r01xnaxj3-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 Jun 2023 05:34:46 -0500 Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 6 Jun 2023 11:34:44 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Tue, 6 Jun 2023 11:34:44 +0100 Received: from sbinding-cirrus-dsktp2.ad.cirrus.com (unknown [198.90.238.36]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 6A65415A4; Tue, 6 Jun 2023 10:34:44 +0000 (UTC) From: Stefan Binding To: Jaroslav Kysela , Takashi Iwai CC: , , , Stefan Binding Subject: [PATCH v3 3/3] ALSA: hda/realtek: Delete cs35l41 component master during free Date: Tue, 6 Jun 2023 11:34:36 +0100 Message-ID: <20230606103436.455348-4-sbinding@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230606103436.455348-1-sbinding@opensource.cirrus.com> References: <20230606103436.455348-1-sbinding@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: VI5rgjUz7OKTiLaTImVqJ-67K0d56j5K X-Proofpoint-GUID: VI5rgjUz7OKTiLaTImVqJ-67K0d56j5K X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This ensures that the driver is properly cleaned up when freed. Signed-off-by: Stefan Binding --- sound/pci/hda/patch_realtek.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index f10790ace5c1d..a0e88fd17aa42 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -6757,6 +6757,9 @@ static void cs35l41_generic_fixup(struct hda_codec *c= dc, int action, const char else spec->gen.pcm_playback_hook =3D comp_generic_playback_hook; break; + case HDA_FIXUP_ACT_FREE: + component_master_del(dev, &comp_master_ops); + break; } } =20 --=20 2.34.1