ASoC: Intel: avs: Preallocate memory for module configuration
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Fri, 29 Sep 2023 11:24:33 +0000 (13:24 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 29 Sep 2023 12:17:53 +0000 (14:17 +0200)
commit28a21cb26425797910b4d7ab0cad0d377d4a004c
tree43e35a3e5b3d1458fe198d37e3109f70a12568ea
parent7eb878e768fd952739a03bf4bbd021496a818eb9
ASoC: Intel: avs: Preallocate memory for module configuration

In order to instantiate modules on the firmware side, the driver sends
payload with module configuration. In some case size of this information
is not known before hand, so driver allocates temporary memory during
module creation and frees it after use. Optimize the flow a bit, by
preallocating maximum buffer. This removes the time spend on allocating
memory, as well as potential OOM errors during module initialization.

Handlers for modules, where configuration data fits on stack, are left
as is.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20230929112436.787058-4-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/avs/avs.h
sound/soc/intel/avs/core.c
sound/soc/intel/avs/path.c