[PATCH v3 11/17] ASoC: Intel: avs: Firmware resources management utilities
Cezary Rojewski
cezary.rojewski at intel.com
Mon Mar 7 18:13:06 CET 2022
On 2022-03-07 5:46 PM, Ranjani Sridharan wrote:
>>>> + * @modres_mutex: For synchronizing any @mods_info updates
>>> Is this mutex really necessary? Can you please elaborate under what
>>> circumstances your will have parallel module updates?
>>
>>
>>
>>
>> Yes, we believe modres_mutex is necessary. All information regarding
>>
>> modules exposed by the firmware are stored within ->mods_info cache.
>>
>>
>>
>> That's just a snapshot though. When a new library gets loaded, new
>>
>> modules may be available for use and so the driver updates the
>>
>> ->mods_info cache to have the latest snapshot. As information found
>>
>> there is used when streaming (e.g.: instantiating modules), we enter
>> a
>>
>> scenario when multiple threads could be reading/updating the
>> ->mods_info
>>
>> at once. To prevent any unwanted behavior, mutex has been added.
> This is the part that's hard to follow without seeing the actual code
> where this new library is loaded. When does a libray get loaded? When
> you start streaming and you realize that the stream requires a module
> that is not built into the base FW? Can this be done during topology
> loading instead?
But that's already done during topology load! If there is no topology
telling the driver: "hey, load this lib for me!", nothing gets loaded
regardless of how your /lib/firmware looks like. Libraries get loaded
during soc-component's (platform component) ->probe(). This is place
where snd_soc_tplg_component_load() is called.
However, if platform has no IMR capability, driver has to re-load
libraries for all platform components of bound sound cards on every
pm_runtime_resume().
Regards,
Czarek
More information about the Alsa-devel
mailing list