[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231209205351.880797-8-cristian.ciocaltea@collabora.com>
Date: Sat, 9 Dec 2023 22:53:46 +0200
From: Cristian Ciocaltea <cristian.ciocaltea@...labora.com>
To: Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
Peter Ujfalusi <peter.ujfalusi@...ux.intel.com>,
Bard Liao <yung-chuan.liao@...ux.intel.com>,
Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
Daniel Baluta <daniel.baluta@....com>,
Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
Venkata Prasad Potturu <venkataprasad.potturu@....com>,
Alper Nebi Yasak <alpernebiyasak@...il.com>,
Syed Saba Kareem <Syed.SabaKareem@....com>,
Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
Marian Postevca <posteuca@...ex.one>,
Vijendar Mukunda <Vijendar.Mukunda@....com>,
V sujith kumar Reddy <Vsujithkumar.Reddy@....com>,
Mastan Katragadda <Mastan.Katragadda@....com>,
Ajit Kumar Pandey <AjitKumar.Pandey@....com>
Cc: linux-sound@...r.kernel.org, linux-kernel@...r.kernel.org,
sound-open-firmware@...a-project.org, kernel@...labora.com
Subject: [PATCH 07/11] ASoC: SOF: core: Skip firmware test for undefined fw_name
Some SOF drivers like AMD ACP do not always rely on a single static
firmware file, but may require multiple files having their names
dynamically computed on probe time, e.g. based on chip name.
In those cases, providing an invalid default_fw_filename in their
sof_dev_desc struct will prevent probing due to 'SOF firmware
and/or topology file not found' error.
Fix the issue by allowing drivers to omit initialization for this member
(or alternatively provide a dynamic override via ipc_file_profile_base)
and update sof_test_firmware_file() to verify the given profile data and
skip firmware testing if either fw_path or fw_name is not defined.
Fixes: 6c393ebbd74a ("ASoC: SOF: core: Implement IPC version fallback if firmware files are missing")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@...labora.com>
---
sound/soc/sof/fw-file-profile.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/sof/fw-file-profile.c b/sound/soc/sof/fw-file-profile.c
index 138a1ca2c4a8..e63700234df0 100644
--- a/sound/soc/sof/fw-file-profile.c
+++ b/sound/soc/sof/fw-file-profile.c
@@ -21,6 +21,9 @@ static int sof_test_firmware_file(struct device *dev,
const u32 *magic;
int ret;
+ if (!profile->fw_path || !profile->fw_name || !*profile->fw_name)
+ return 0;
+
fw_filename = kasprintf(GFP_KERNEL, "%s/%s", profile->fw_path,
profile->fw_name);
if (!fw_filename)
--
2.43.0
Powered by blists - more mailing lists