Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: SOF: ipc4/Intel: Support for partial context

Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

The firmware will be able to only save and restore the context related to
library management.
This means that even without a full context save, the libraries do not
need to be re-loaded to the firmware after second or consecutive boots.

This is reported via the FW_READY notification, where BIT(15) indicates:
0 - the library restore is not done
1 - library restore is done

This bit is only valid if full context save is not enabled, full context
save is by definition saves and restores the library related book-keeping
as well.

Add a new flag to tell the platform code if the libraries have been
restored, no need to reload them after boot.

+28 -4
+2
include/sound/sof/ipc4/header.h
··· 498 498 #define SOF_IPC4_LOG_CORE_GET(x) (((x) & SOF_IPC4_LOG_CORE_MASK) >> \ 499 499 SOF_IPC4_LOG_CORE_SHIFT) 500 500 501 + #define SOF_IPC4_FW_READY_LIB_RESTORED BIT(15) 502 + 501 503 /* Value of notification type field - must fit into 8 bits */ 502 504 enum sof_ipc4_notification_type { 503 505 /* Phrase detected (notification from WoV module) */
+5 -2
sound/soc/sof/intel/hda-loader.c
··· 579 579 struct sof_ipc4_msg msg = {}; 580 580 int ret, ret1; 581 581 582 - /* if IMR booting is enabled and fw context is saved for D3 state, skip the loading */ 583 - if (reload && hda->booted_from_imr && ipc4_data->fw_context_save) 582 + /* 583 + * if IMR booting is enabled and libraries have been restored during fw 584 + * boot, skip the loading 585 + */ 586 + if (reload && hda->booted_from_imr && ipc4_data->libraries_restored) 584 587 return 0; 585 588 586 589 /* the fw_lib has been verified during loading, we can trust the validity here */
+6
sound/soc/sof/ipc4-loader.c
··· 494 494 break; 495 495 case SOF_IPC4_FW_CONTEXT_SAVE: 496 496 ipc4_data->fw_context_save = *tuple->value; 497 + /* 498 + * Set the default libraries_restored value - if full 499 + * context save is supported then it means that 500 + * libraries are restored 501 + */ 502 + ipc4_data->libraries_restored = ipc4_data->fw_context_save; 497 503 break; 498 504 default: 499 505 break;
+3
sound/soc/sof/ipc4-priv.h
··· 72 72 * @max_num_pipelines: max number of pipelines 73 73 * @max_libs_count: Maximum number of libraries support by the FW including the 74 74 * base firmware 75 + * @fw_context_save: Firmware supports full context save and restore 76 + * @libraries_restored: The libraries have been retained during firmware boot 75 77 * 76 78 * @load_library: Callback function for platform dependent library loading 77 79 * @pipeline_state_mutex: Mutex to protect pipeline triggers, ref counts, states and deletion ··· 89 87 int max_num_pipelines; 90 88 u32 max_libs_count; 91 89 bool fw_context_save; 90 + bool libraries_restored; 92 91 93 92 int (*load_library)(struct snd_sof_dev *sdev, 94 93 struct sof_ipc4_fw_library *fw_lib, bool reload);
+12 -2
sound/soc/sof/ipc4.c
··· 576 576 577 577 static int ipc4_fw_ready(struct snd_sof_dev *sdev, struct sof_ipc4_msg *ipc4_msg) 578 578 { 579 - /* no need to re-check version/ABI for subsequent boots */ 580 - if (!sdev->first_boot) 579 + if (!sdev->first_boot) { 580 + struct sof_ipc4_fw_data *ipc4_data = sdev->private; 581 + 582 + /* 583 + * After the initial boot only check if the libraries have been 584 + * restored when full context save is not enabled 585 + */ 586 + if (!ipc4_data->fw_context_save) 587 + ipc4_data->libraries_restored = !!(ipc4_msg->primary & 588 + SOF_IPC4_FW_READY_LIB_RESTORED); 589 + 581 590 return 0; 591 + } 582 592 583 593 sof_ipc4_create_exception_debugfs_node(sdev); 584 594