Skip to content
Snippets Groups Projects
Commit 02f3c5d2 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Oleksii Kutuzov
Browse files

UPSTREAM: ASoC: SOF: sof-client-probes: Query the maximum IPC payload size


Instead of using the SOF_IPC_MSG_MAX_SIZE as the maximum payload size for
and IPC message, use the provided API to query it.

Change-Id: I7e9366570428eb2f800e008cfb0051a3623bf518
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220506132647.18690-4-peter.ujfalusi@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 283e2dd9
No related branches found
No related tags found
1 merge request!13[UPSTREAM] Add Audio-related patches from Mediatek's Release 24.0
...@@ -132,6 +132,7 @@ static int sof_probes_deinit(struct sof_client_dev *cdev) ...@@ -132,6 +132,7 @@ static int sof_probes_deinit(struct sof_client_dev *cdev)
static int sof_probes_info(struct sof_client_dev *cdev, unsigned int cmd, static int sof_probes_info(struct sof_client_dev *cdev, unsigned int cmd,
void **params, size_t *num_params) void **params, size_t *num_params)
{ {
size_t max_msg_size = sof_client_get_ipc_max_payload_size(cdev);
struct sof_ipc_probe_info_params msg = {{{0}}}; struct sof_ipc_probe_info_params msg = {{{0}}};
struct sof_ipc_probe_info_params *reply; struct sof_ipc_probe_info_params *reply;
size_t bytes; size_t bytes;
...@@ -140,13 +141,13 @@ static int sof_probes_info(struct sof_client_dev *cdev, unsigned int cmd, ...@@ -140,13 +141,13 @@ static int sof_probes_info(struct sof_client_dev *cdev, unsigned int cmd,
*params = NULL; *params = NULL;
*num_params = 0; *num_params = 0;
reply = kzalloc(SOF_IPC_MSG_MAX_SIZE, GFP_KERNEL); reply = kzalloc(max_msg_size, GFP_KERNEL);
if (!reply) if (!reply)
return -ENOMEM; return -ENOMEM;
msg.rhdr.hdr.size = sizeof(msg); msg.rhdr.hdr.size = sizeof(msg);
msg.rhdr.hdr.cmd = SOF_IPC_GLB_PROBE | cmd; msg.rhdr.hdr.cmd = SOF_IPC_GLB_PROBE | cmd;
ret = sof_client_ipc_tx_message(cdev, &msg, reply, SOF_IPC_MSG_MAX_SIZE); ret = sof_client_ipc_tx_message(cdev, &msg, reply, max_msg_size);
if (ret < 0 || reply->rhdr.error < 0) if (ret < 0 || reply->rhdr.error < 0)
goto exit; goto exit;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment