Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2381586lqp; Sun, 24 Mar 2024 16:55:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUgigm9HYmxM8NI2FKVrR8wTjL0rbaSQhooeeWvAfiQCZMkn/slmPhTup66xfvjDhkLstA9j/r8BmGnNUBRvaD8BkyGBCH9uoyKsjDs1g== X-Google-Smtp-Source: AGHT+IHd/AlKYWZspcDlTKvbRP5EnCwNY1+BMgskm9laU2GJGdcrDeEr5ZQ+esOohrHJQa5PbUbk X-Received: by 2002:a50:d4da:0:b0:56b:b5a1:4685 with SMTP id e26-20020a50d4da000000b0056bb5a14685mr3861034edj.27.1711324555182; Sun, 24 Mar 2024 16:55:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711324555; cv=pass; d=google.com; s=arc-20160816; b=G8j91AyECfcawH0m8oPCtFoNh7Vsv5w+hdj6rBs9ui9DSfdEQ6qAqLqQsSGKInodgu g6XILPTvL57U6Bs7WZUqjtzHOHpz1J0EuNqxQsY4nzbL/VgSUfk6Q87pzfAIOqwuHi+O MtoM6KN8OC0ETcuf71k+AYlojRS09WldBIY1zt7EoWMWGB4fivB/5U34K/aVthQRR7Wc V/2OwvYY92MKzj2mBq2rhAC7JWM9xXovfBkEwiVt+NiPK1t0Wst9p+VXpvw2tOFToxmZ T2rJcKV5w3pLAtLIyak5GIvfqSJ4izwUwKMlVjAFg1Ax8GVDHUDN6+Rth0OgshuGUuV8 Ki/A== 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=xGeiC0YmgV0tG/gI5Dst/UPTqhx0WsUjAZ26uQGZKIo=; fh=fnRX2Rh3avYL2oWMoqtjqGyA8OVwwnQ7EUHIxaNO+e4=; b=w9mUqcQbL5e+gXapbOX9SoPt+n0yYUSzWl7VUsife5NoZWT8QOXbbXbzPz3cYf5Z9r 35kykojz9MtngT89pduNQQ2Z2N0trxdfu5J/qE7MToC6bcXEEiVgcPWV/DvA+Sqqufi+ EWWe6JqB1r/Qalos9Bnobu/4NJrj7p+BXe8Zhx2HgUiBAN+VebyiUlD/glyhbxABWlCJ 7aRGFn1mAX3zWXc0x4xKpJgSv8EcNZV1jsWpSdAqCP1ddC8t/l1x5k5pY2lWnAot2tfB JivCce25GoUz54SVB+FSFs/mM73+3y/20go6CbjZvkQ0qYgCWy+QxoCg39u1I1S+A8hE Ap5Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BdT2cT6q; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113259-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113259-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i3-20020a0564020f0300b0056c09c23c6dsi848172eda.312.2024.03.24.16.55.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:55:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113259-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BdT2cT6q; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113259-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113259-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id BA7581F223DE for ; Sun, 24 Mar 2024 23:55:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC8B0188A62; Sun, 24 Mar 2024 22:40:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BdT2cT6q" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D37AD13CAAE; Sun, 24 Mar 2024 22:40:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320058; cv=none; b=KatgnXT3aPUEoYVVeblnvgMH0/ScLMdw3Pdz+TgxL7dEfOjTOQXM31bcOtdBF0im9W9s0aQbXWF9WbP8MZOKhtTeeWs7mxYH/LwKWryXw4whdiLgf/6ntGYH9V0jsyCX/imntROgBax1meQdHK1twIr5AM8RoBS1I8F+lGOX1i4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320058; c=relaxed/simple; bh=jqBEbx6uLVaceB5dNxt0n9v1/Q0sXsq3XUNnRAUTcTk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uLEQxqqKIM+PH+Yd7ubLYP34QWNpm/8sOifh0i62KoZXCp/AQn+D8B0U9bW0wSiesT7gUcV3/v9GBcAyVkVHqO01Wp9edBmvc0dSZo4lcCPLLtDkNuPoj7SsFhjJ2lO9Pyut2N/ljbAoQx41fWG8axGzLtmfVgMv4EjN0N3VsGE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BdT2cT6q; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07C62C433F1; Sun, 24 Mar 2024 22:40:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320058; bh=jqBEbx6uLVaceB5dNxt0n9v1/Q0sXsq3XUNnRAUTcTk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BdT2cT6qrpz4/0tTQwjq7Tl1zirK1h+0vV6608Zfyhuc4dOTfROK3V+GvLyfjpS/5 t2LUslw7+q+Q+gOUvhk/NHbCzsfQqm4hW9M9VcvlLX4HmKuflf/IZOiLZNg20UHT6J J4dGDgQkBzdklvaKrCOtHxU7Aykp5f2/C7Ub3i9Fwz8yGTDbQ6zFDJhcClwL7xabH9 nk9r95BSR4e1ew5ixbhQvBRCipPvtzGBqmjZJBDP4zD9sbxSuTCLELRHqWI9UmB4Jm v2ciPART6V+WsQ90KE+RWqDsuQeAShcV6nlI2lQvgNYNqAVh8NpfH8cCTFgK6V+Ab4 QnE8j9sPJcNBw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Cristian Ciocaltea , =?UTF-8?q?P=C3=A9ter=20Ujfalusi?= , Mark Brown , Sasha Levin Subject: [PATCH 6.8 368/715] ASoC: SOF: core: Skip firmware test for custom loaders Date: Sun, 24 Mar 2024 18:29:07 -0400 Message-ID: <20240324223455.1342824-369-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Cristian Ciocaltea [ Upstream commit 369b997a1371aeecd0a1fb0f9f4ef3747a1d07a4 ] The ACP driver for Vangogh platform uses a quirk for Valve Galileo device to setup a custom firmware loader, which neither requires nor uses the firmware file indicated via the default_fw_filename member of struct sof_dev_desc. Since commit 6c393ebbd74a ("ASoC: SOF: core: Implement IPC version fallback if firmware files are missing"), the provided filename gets verified and triggers a fatal error on probe: [ 7.719337] snd_sof_amd_vangogh 0000:04:00.5: enabling device (0000 -> 0002) [ 7.721486] snd_sof_amd_vangogh 0000:04:00.5: SOF firmware and/or topology file not found. [ 7.721565] snd_sof_amd_vangogh 0000:04:00.5: Supported default profiles [ 7.721569] snd_sof_amd_vangogh 0000:04:00.5: - ipc type 0 (Requested): [ 7.721573] snd_sof_amd_vangogh 0000:04:00.5: Firmware file: amd/sof/sof-vangogh.ri [ 7.721577] snd_sof_amd_vangogh 0000:04:00.5: Topology file: amd/sof-tplg/sof-vangogh-nau8821-max.tplg [ 7.721582] snd_sof_amd_vangogh 0000:04:00.5: Check if you have 'sof-firmware' package installed. [ 7.721585] snd_sof_amd_vangogh 0000:04:00.5: Optionally it can be manually downloaded from: [ 7.721589] snd_sof_amd_vangogh 0000:04:00.5: https://github.com/thesofproject/sof-bin/ [ 7.721997] snd_sof_amd_vangogh: probe of 0000:04:00.5 failed with error -2 According to AMD, a combined ".ri" file which includes the code and data segments cannot be used due to a limitation preventing the code image to be signed on build time. Fix the issue by skipping the firmware file test if a custom loader is being used instead of the generic one. Fixes: 6c393ebbd74a ("ASoC: SOF: core: Implement IPC version fallback if firmware files are missing") Co-developed-by: Péter Ujfalusi Signed-off-by: Péter Ujfalusi Signed-off-by: Cristian Ciocaltea Link: https://msgid.link/r/20231219030728.2431640-8-cristian.ciocaltea@collabora.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/sof/fw-file-profile.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/sound/soc/sof/fw-file-profile.c b/sound/soc/sof/fw-file-profile.c index 138a1ca2c4a85..b56b14232444c 100644 --- a/sound/soc/sof/fw-file-profile.c +++ b/sound/soc/sof/fw-file-profile.c @@ -89,6 +89,12 @@ static int sof_test_topology_file(struct device *dev, return ret; } +static bool sof_platform_uses_generic_loader(struct snd_sof_dev *sdev) +{ + return (sdev->pdata->desc->ops->load_firmware == snd_sof_load_firmware_raw || + sdev->pdata->desc->ops->load_firmware == snd_sof_load_firmware_memcpy); +} + static int sof_file_profile_for_ipc_type(struct snd_sof_dev *sdev, enum sof_ipc_type ipc_type, @@ -130,7 +136,8 @@ sof_file_profile_for_ipc_type(struct snd_sof_dev *sdev, * For default path and firmware name do a verification before * continuing further. */ - if (base_profile->fw_path || base_profile->fw_name) { + if ((base_profile->fw_path || base_profile->fw_name) && + sof_platform_uses_generic_loader(sdev)) { ret = sof_test_firmware_file(dev, out_profile, &ipc_type); if (ret) return ret; @@ -181,7 +188,8 @@ sof_file_profile_for_ipc_type(struct snd_sof_dev *sdev, out_profile->ipc_type = ipc_type; /* Test only default firmware file */ - if (!base_profile->fw_path && !base_profile->fw_name) + if ((!base_profile->fw_path && !base_profile->fw_name) && + sof_platform_uses_generic_loader(sdev)) ret = sof_test_firmware_file(dev, out_profile, NULL); if (!ret) @@ -267,7 +275,11 @@ static void sof_print_profile_info(struct snd_sof_dev *sdev, dev_info(dev, "Firmware paths/files for ipc type %d:\n", profile->ipc_type); - dev_info(dev, " Firmware file: %s/%s\n", profile->fw_path, profile->fw_name); + /* The firmware path is only valid when generic loader is used */ + if (sof_platform_uses_generic_loader(sdev)) + dev_info(dev, " Firmware file: %s/%s\n", + profile->fw_path, profile->fw_name); + if (profile->fw_lib_path) dev_info(dev, " Firmware lib path: %s\n", profile->fw_lib_path); dev_info(dev, " Topology file: %s/%s\n", profile->tplg_path, profile->tplg_name); -- 2.43.0