From nobody Fri Dec 19 12:29:56 2025 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47FFB168B2 for ; Wed, 20 Dec 2023 07:38:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CBFcRaF9" Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-553a45208ffso1791320a12.3 for ; Tue, 19 Dec 2023 23:38:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703057891; x=1703662691; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gxdaR881KYWxnVjE5RFuD+xNEp0CWp7EUb3EZJFwG58=; b=CBFcRaF9um8CTe/6RBFNzYJ3JxOkiLFvFntXhMzq3vF+ERECkg96EraCj02i07m3+3 UmSjzGYEEWmEy53Qfm2mmAcBg2fe+YJpNFrf7bq7WUfFSoYhhokXOFePamggOz1xz+3K NAYqun3zcUNtKHoDUSpn0mA34JQM7hsX/mTv0qhWT7mcTRA+NW88ZgQtpI6E97NdS9L0 PjAYCWcMMWKMzo3MbH6nSW3mc8sIMlLvAb1gg6muTunroGvwGDmj4VT9zvoA13Tyw3aM 9cqcXfskRALHK07Xp+91il646Sp4Ay4G5dHx3csjDk+zuDi/rlwvB1M3yRq6hD11ubiU UegA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703057891; x=1703662691; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gxdaR881KYWxnVjE5RFuD+xNEp0CWp7EUb3EZJFwG58=; b=OQFRS3PG+SYvMWgLN1aRYzuyrYjf62cxzQ5sbyujz/QZm5mblgGIcmCIdM9ISQhb+E gVdQq8AaRKl96iNnCVqxlcS3kKWfpfa/Nq/uOC1gofXNLTyCt4onzAftDTBq/4q0Fv7O tpKJxiqbCeCFiub5EVzwUcOn0/aqYskCf5rYJgF1YDW4W5HRFN+Ttg4Chk5for/AqENk 4dXOSnLpHNbb9j0fBY6UCEqa9HTYu+etlEsHbffxfugFpbkvynoB6ouOckvVqApTW0ne sr5vkjVkvM8/VFtIjKtb0yfw9J3o4iW8+Blaz7DJ17Wn0ylysDbypcWjT4uKychITRK8 G8+Q== X-Gm-Message-State: AOJu0YwfIu6KWOC2A0bswlv3pgmvgXEs1sFUdIo2ZrLu4uPjsZEnPGRZ 1+WWmF5cUqfCHhqMg5gwXw== X-Google-Smtp-Source: AGHT+IF1+fG3lPptD5qJNeH9L9Yw2E+IRSt3K4z5bx6nfNUz4NixxmGTMGu3Eq9TuPiyNB8OraLeiw== X-Received: by 2002:a50:d71a:0:b0:553:99fb:ae47 with SMTP id t26-20020a50d71a000000b0055399fbae47mr526017edi.27.1703057891414; Tue, 19 Dec 2023 23:38:11 -0800 (PST) Received: from alex-pc-ubuntu.lan (31-10-153-16.cgn.dynamic.upc.ch. [31.10.153.16]) by smtp.gmail.com with ESMTPSA id p7-20020a056402500700b0055283720ec3sm5979043eda.76.2023.12.19.23.38.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 23:38:11 -0800 (PST) From: Aleksandrs Vinarskis To: tiwai@suse.de Cc: alex.vinarskis@gmail.com, alsa-devel@alsa-project.org, david.rhodes@cirrus.com, james.schulman@cirrus.com, josbeir@gmail.com, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, perex@perex.cz, sbinding@opensource.cirrus.com, stuarth@opensource.cirrus.com, tiwai@suse.com Subject: [PATCH v2 1/2] ALSA: hda: cs35l41: Safety-guard against capped SPI speed Date: Wed, 20 Dec 2023 08:38:08 +0100 Message-Id: <20231220073809.22027-2-alex.vinarskis@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231220073809.22027-1-alex.vinarskis@gmail.com> References: <87ttokpyws.wl-tiwai@suse.de> <20231220073809.22027-1-alex.vinarskis@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Some devices with intel-lpss based SPI controllers may have misconfigured clock divider due to firmware bug. This would result in capped SPI speeds, which leads to longer DSP firmware loading times. This safety guards against possible hangs during wake-up by not initializing the device if lpss was not patched/fixed UEFI was not installed Signed-off-by: Aleksandrs Vinarskis --- sound/pci/hda/cs35l41_hda_property.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sound/pci/hda/cs35l41_hda_property.c b/sound/pci/hda/cs35l41_h= da_property.c index c9eb70290973..cb305b093311 100644 --- a/sound/pci/hda/cs35l41_hda_property.c +++ b/sound/pci/hda/cs35l41_hda_property.c @@ -210,6 +210,19 @@ static int generic_dsd_config(struct cs35l41_hda *cs35= l41, struct device *physde =20 if (cfg->bus =3D=3D SPI) { cs35l41->index =3D id; + /* + * Some devices with intel-lpss based SPI controllers may have misconfig= ured + * clock divider due to firmware bug. This would result in capped SPI sp= eeds, + * which leads to longer DSP firmware loading times. + * Avoid initializing device if lpss was not patched/fixed UEFI was not = installed + */ + spi =3D to_spi_device(cs35l41->dev); + if (spi->max_speed_hz < CS35L41_SPI_MAX_FREQ/2) { + dev_err(cs35l41->dev, + "SPI's max_speed_hz is capped at %u Hz, will not continue to avoid han= ging\n", + spi->max_speed_hz); + return -EINVAL; + } /* * Manually set the Chip Select for the second amp in th= e node. * This is only supported for systems with 2 amps, since we cannot expan= d the @@ -219,8 +232,6 @@ static int generic_dsd_config(struct cs35l41_hda *cs35l= 41, struct device *physde * first. */ if (cfg->cs_gpio_index >=3D 0) { - spi =3D to_spi_device(cs35l41->dev); - if (cfg->num_amps !=3D 2) { dev_warn(cs35l41->dev, "Cannot update SPI CS, Number of Amps (%d) !=3D 2\n", --=20 2.40.1 From nobody Fri Dec 19 12:29:56 2025 Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F24D6171CA for ; Wed, 20 Dec 2023 07:38:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="k2Ho7DVX" Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-54c5d041c23so6536683a12.2 for ; Tue, 19 Dec 2023 23:38:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703057892; x=1703662692; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZHyUbHVpES213ODZcnBd6hLrNU+I64lailKfIQRqxos=; b=k2Ho7DVXmYzfAInGPcabCuJhxf77/FW7+PulZG63QkPTMRFzohR7dFzr6V3loy6iQF NsqWN2wiZ5jvv/eYeK1c55UZh4LFYGUiAPao1z0fc4m1cn0CX2iG3/ABHe2LdvoEWbBW JWfUGEDMqLaFVAHwDf9+ac/Z9d09pENXu2Q6pZcaAiCFYKl4xqX1abAJI6QxaKCryzvo I7I+z/zoWPgJA9jrQtwO+hnAPzSU5SHKIq1+BWJZStsUTlmchW4/4Xg93hQB/9Jd5Rjv pA3BDxjmdDe8mPcmDHxuMF4ogfaC1BBfK1P6/swvIwHmxY1/1gxPT985ZLzcGlB8WDZM +oZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703057892; x=1703662692; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZHyUbHVpES213ODZcnBd6hLrNU+I64lailKfIQRqxos=; b=GkEx9tsAEjSWNTvh4zwcquMmGTFDiCakltd/PO1E24NBzAzLpmjENRxS481VAUDecj u5HhYIbiw1HEOj8OtvA7ZI1L4zs8Gt3yW/8wr215lN1KuGxEnpfwu03hkEDpZjXlCohZ imvMCOzTMJxmNYlDp7Pn/tmxPKHYFay1QeJXG7Pw39GKL9HagdzAZ4piJdeDB2eRIg3M bn7ZROP/3PBz0TFfaK+jo1cVDxnaFfhn07lBe0/OwwdaIM/mlzG04IFF3b3ndPPKauES usheG3KO5Kylqubry+qW2nRXuG/lnJD5Cfaz2OlJi9auzhpB1vJUWjZhWdt6U1Mrxz7U BJRg== X-Gm-Message-State: AOJu0YwtlCXWhMV5/0XoMZ1Mc5fyMfTYXZln4n3IoRbHmTZUd4fhN6nx gUuYYoxng0iNY28RLsP8KA== X-Google-Smtp-Source: AGHT+IFq8fykuywISDMznNtD+bwpovn1I9rqNtzdYNP/Iv9ilU/ky9etGWkivuriBSkpv49QUETGbg== X-Received: by 2002:a50:8753:0:b0:553:3354:297f with SMTP id 19-20020a508753000000b005533354297fmr1542463edv.59.1703057892157; Tue, 19 Dec 2023 23:38:12 -0800 (PST) Received: from alex-pc-ubuntu.lan (31-10-153-16.cgn.dynamic.upc.ch. [31.10.153.16]) by smtp.gmail.com with ESMTPSA id p7-20020a056402500700b0055283720ec3sm5979043eda.76.2023.12.19.23.38.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 23:38:11 -0800 (PST) From: Aleksandrs Vinarskis To: tiwai@suse.de Cc: alex.vinarskis@gmail.com, alsa-devel@alsa-project.org, david.rhodes@cirrus.com, james.schulman@cirrus.com, josbeir@gmail.com, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, perex@perex.cz, sbinding@opensource.cirrus.com, stuarth@opensource.cirrus.com, tiwai@suse.com Subject: [PATCH v2 2/2] ALSA: hda: cs35l41: Support Dell XPS 9530 (2023) Date: Wed, 20 Dec 2023 08:38:09 +0100 Message-Id: <20231220073809.22027-3-alex.vinarskis@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231220073809.22027-1-alex.vinarskis@gmail.com> References: <87ttokpyws.wl-tiwai@suse.de> <20231220073809.22027-1-alex.vinarskis@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add new model entries into configuration table. Co-developed-by: Jasper Smet Signed-off-by: Jasper Smet Signed-off-by: Aleksandrs Vinarskis --- sound/pci/hda/cs35l41_hda_property.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/pci/hda/cs35l41_hda_property.c b/sound/pci/hda/cs35l41_h= da_property.c index cb305b093311..ee105743333f 100644 --- a/sound/pci/hda/cs35l41_hda_property.c +++ b/sound/pci/hda/cs35l41_hda_property.c @@ -41,6 +41,7 @@ static const struct cs35l41_config cs35l41_config_table[]= =3D { * Since this laptop has valid ACPI, we do not need to handle cs-gpios, si= nce that already exists * in the ACPI. The Reset GPIO is also valid, so we can use the Reset defi= ned in _DSD. */ + { "10280BEB", SPI, 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 1,= -1, 0, 0, 0, 0 }, { "103C89C6", SPI, 2, INTERNAL, { CS35L41_RIGHT, CS35L41_LEFT, 0, 0 }, -1= , -1, -1, 1000, 4500, 24 }, { "104312AF", SPI, 2, INTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 1,= 2, 0, 1000, 4500, 24 }, { "10431433", I2C, 2, INTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0,= 1, -1, 1000, 4500, 24 }, @@ -355,6 +356,7 @@ struct cs35l41_prop_model { static const struct cs35l41_prop_model cs35l41_prop_model_table[] =3D { { "CLSA0100", NULL, lenovo_legion_no_acpi }, { "CLSA0101", NULL, lenovo_legion_no_acpi }, + { "CSC3551", "10280BEB", generic_dsd_config }, { "CSC3551", "103C89C6", generic_dsd_config }, { "CSC3551", "104312AF", generic_dsd_config }, { "CSC3551", "10431433", generic_dsd_config }, --=20 2.40.1