[PATCH 05/17] ASoC: Intel: avs: Add code loading requests

Cezary Rojewski cezary.rojewski at intel.com
Fri Feb 25 19:08:24 CET 2022


On 2022-02-25 2:02 AM, Pierre-Louis Bossart wrote:
> 
>> +#define AVS_CL_TIMEOUT_MS	5000
> 
> it's not clear where this comes from, and it's also unclear why both
> types of code loading would have the same timeout when the hardware is
> so fundamentally different.


I can re-check but most often than not, I'm basing these on proven, 
working, close-source equivalent.

>> +int avs_ipc_load_library(struct avs_dev *adev, u32 dma_id, u32 lib_id)
>> +{
>> +	union avs_global_msg msg = AVS_GLOBAL_REQUEST(LOAD_LIBRARY);
>> +	struct avs_ipc_msg request = {0};
> 
> I've asked this before and I don't recall by this case requires an
> initialization to zero?


Fields 'data' and 'size' are also part of struct avs_ipc_msg. We zero 
them out here as there is no payload to be sent for LOAD_LIBRARY IPC.

>> +	int ret;
>> +
>> +	msg.load_lib.dma_id = dma_id;
>> +	msg.load_lib.lib_id = lib_id;
>> +	request.header = msg.val;
>> +
>> +	ret = avs_dsp_send_msg_timeout(adev, &request, NULL, AVS_CL_TIMEOUT_MS);
>> +	if (ret)
>> +		avs_ipc_err(adev, &request, "load library", ret);
>> +
>> +	return ret;
> 


More information about the Alsa-devel mailing list