From patchwork Thu Aug 25 22:05:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 12955284 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B0CBAECAAA3 for ; Thu, 25 Aug 2022 22:07:08 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B25891614; Fri, 26 Aug 2022 00:06:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B25891614 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661465226; bh=Q5+Bi1B/SMTx6MvZqr40BzbPGKrMBPLeIBYyqLazQ/8=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=BT9fvjZeHg8uTVIi5KPUj0A3FMliHeipQIKKAhpmzuoUyxSq4FMs3yvRDofdpcm06 J6nJn8ObXAWrS9vT1Gfg3SsmTToMjGQ5Z7FbKrgwx5VhNFhV0EhfavfImh7T0kNWX2 EwuD7frCtqkTT27LpzMnQxtUT0ic1Hw3/kukSzZw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 59466F80245; Fri, 26 Aug 2022 00:06:16 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9338DF8025A; Fri, 26 Aug 2022 00:06:15 +0200 (CEST) Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 71536F800BD for ; Fri, 26 Aug 2022 00:06:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 71536F800BD Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="gh6ftKJI" Received: from localhost (unknown [188.27.54.142]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madras.collabora.co.uk (Postfix) with ESMTPSA id D20966601EB5; Thu, 25 Aug 2022 23:06:07 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1661465168; bh=Q5+Bi1B/SMTx6MvZqr40BzbPGKrMBPLeIBYyqLazQ/8=; h=From:To:Cc:Subject:Date:From; b=gh6ftKJIVQLKO5dOmvcFnfcDOzXHWNzMS9IHXZj2byYLR8MxxEqTYAsGt7UmckXyl bNx2FSRFzzKbrfrDQPx6UsRpdJzjGrAmb/9nJaOD7OyndFWU9x8WtENvd0aq2JYNCU bPGGD1LMHXMtMYWqcN5i4vXfXi22vq0EBK+8kOSD3fhMnY+jvLDCWJcbmLIKl+Ziix K1i8wgWCxzjORxZbhRZfNBwhZcWkjOk8niA0b8YiCI3TO+V2Wn0igc3DyunWYxm2Rv u/Jv9Xoc1Sj8wL6TXlsie24cwPDe+Q6TpC9WzjpCN1VGketA87UoLR8asvOE78Hy1F kxoL511toqAlQ== From: Cristian Ciocaltea To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Vlad Karpovich , Charles Keepax Subject: [PATCH v2] ASoC: wm_adsp: Handle optional legacy support Date: Fri, 26 Aug 2022 01:05:30 +0300 Message-Id: <20220825220530.1205141-1-cristian.ciocaltea@collabora.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org, kernel@collabora.com, linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The tracing capabilities for the speaker protection fw enabled via commit c55b3e46cb99 ("ASoC: wm_adsp: Add trace caps to speaker protection FW") are not be available on all platforms, such as the Valve's Steam Deck which is based on the Halo Core DSP. As a consequence, whenever the firmware is loaded, a rather misleading 'Failed to parse legacy: -19' error message is written to the kernel ring buffer: [ 288.977412] steamdeck kernel: cs35l41 spi-VLV1776:01: DSP1: Firmware version: 3 [ 288.978002] steamdeck kernel: cs35l41 spi-VLV1776:01: DSP1: cs35l41-dsp1-spk-prot.wmfw: Fri 02 Apr 2021 21:03:50 W. Europe Daylight Time [ 289.094065] steamdeck kernel: cs35l41 spi-VLV1776:01: DSP1: Firmware: 400a4 vendor: 0x2 v0.33.0, 2 algorithms [ 289.095073] steamdeck kernel: cs35l41 spi-VLV1776:01: DSP1: 0: ID cd v29.53.0 XM@94 YM@e [ 289.095665] steamdeck kernel: cs35l41 spi-VLV1776:01: DSP1: 1: ID f20b v0.0.1 XM@170 YM@0 [ 289.096275] steamdeck kernel: cs35l41 spi-VLV1776:01: DSP1: Protection: C:\Users\ocanavan\Desktop\cirrusTune_july2021.bin [ 291.172383] steamdeck kernel: cs35l41 spi-VLV1776:01: DSP1: Failed to parse legacy: -19 Update wm_adsp_buffer_init() to print a more descriptive info message when wm_adsp_buffer_parse_legacy() returns -ENODEV. Fixes: c55b3e46cb99 ("ASoC: wm_adsp: Add trace caps to speaker protection FW") Signed-off-by: Cristian Ciocaltea Acked-by: Charles Keepax --- Changes in v2: - Add a generic handling of the issue, not bound to a particular firmware, as suggested by Charles - Update commit message, including the subject, to reflect the changes sound/soc/codecs/wm_adsp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) base-commit: 568035b01cfb107af8d2e4bd2fb9aea22cf5b868 diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index cfaa45ede916..8a2e9771bb50 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c @@ -1602,7 +1602,9 @@ static int wm_adsp_buffer_init(struct wm_adsp *dsp) if (list_empty(&dsp->buffer_list)) { /* Fall back to legacy support */ ret = wm_adsp_buffer_parse_legacy(dsp); - if (ret) + if (ret == -ENODEV) + adsp_info(dsp, "Legacy support not available\n"); + else if (ret) adsp_warn(dsp, "Failed to parse legacy: %d\n", ret); }