• Cristian Ciocaltea's avatar
    ASoC: SOF: amd: Compute file paths on firmware load · d9cacc1a
    Cristian Ciocaltea authored
    Commit 6c393ebb ("ASoC: SOF: core: Implement IPC version fallback if
    firmware files are missing") changed the order of some operations and
    the firmware paths are not available anymore at snd_sof_probe() time.
    
    Precisely, fw_filename_prefix is set by sof_select_ipc_and_paths() via
    
      plat_data->fw_filename_prefix = out_profile.fw_path;
    
    but sof_init_environment() which calls this function was moved from
    snd_sof_device_probe() to sof_probe_continue(). Moreover,
    snd_sof_probe() was moved from sof_probe_continue() to
    sof_init_environment(), but before the call to
    sof_select_ipc_and_paths().
    
    The problem here is that amd_sof_acp_probe() uses fw_filename_prefix to
    compute fw_code_bin and fw_data_bin paths, and because the field is not
    yet initialized, the paths end up containing (null):
    
    snd_sof_amd_vangogh 0000:04:00.5: Direct firmware load for (null)/sof-vangogh-code.bin failed with error -2
    snd_sof_amd_vangogh 0000:04:00.5: sof signed firmware code bin is missing
    snd_sof_amd_vangogh 0000:04:00.5: error: failed to load DSP firmware -2
    snd_sof_amd_vangogh: probe of 0000:04:00.5 failed with error -2
    
    Move usage of fw_filename_prefix right before request_firmware() calls
    in acp_sof_load_signed_firmware().
    
    Fixes: 6c393ebb ("ASoC: SOF: core: Implement IPC version fallback if firmware files are missing")
    Signed-off-by: default avatarCristian Ciocaltea <cristian.ciocaltea@collabora.com>
    Reviewed-by: default avatarEmil Velikov <emil.velikov@collabora.com>
    Link: https://msgid.link/r/20231219030728.2431640-9-cristian.ciocaltea@collabora.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    d9cacc1a
acp-loader.c 9.15 KB