From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
To: lgirdwood@gmail.com, broonie@kernel.org,
pierre-louis.bossart@linux.intel.com,
yung-chuan.liao@linux.intel.com, rander.wang@intel.com
Cc: alsa-devel@alsa-project.org, daniel.baluta@nxp.com,
ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com
Subject: [PATCH 3/8] ASoC: SOF: sof-client-probes: Query the maximum IPC payload size
Date: Fri, 6 May 2022 16:26:42 +0300 [thread overview]
Message-ID: <20220506132647.18690-4-peter.ujfalusi@linux.intel.com> (raw)
In-Reply-To: <20220506132647.18690-1-peter.ujfalusi@linux.intel.com>
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.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
sound/soc/sof/sof-client-probes.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/soc/sof/sof-client-probes.c b/sound/soc/sof/sof-client-probes.c
index c4c6e03c8133..34e6bd356e71 100644
--- a/sound/soc/sof/sof-client-probes.c
+++ b/sound/soc/sof/sof-client-probes.c
@@ -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,
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 *reply;
size_t bytes;
@@ -140,13 +141,13 @@ static int sof_probes_info(struct sof_client_dev *cdev, unsigned int cmd,
*params = NULL;
*num_params = 0;
- reply = kzalloc(SOF_IPC_MSG_MAX_SIZE, GFP_KERNEL);
+ reply = kzalloc(max_msg_size, GFP_KERNEL);
if (!reply)
return -ENOMEM;
msg.rhdr.hdr.size = sizeof(msg);
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)
goto exit;
--
2.36.0
next prev parent reply other threads:[~2022-05-06 13:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-06 13:26 [PATCH 0/8] ASoC: SOF: sof-client: Update for different IPC versions Peter Ujfalusi
2022-05-06 13:26 ` [PATCH 1/8] ASoC: SOF: sof-client: Add API to get the maximum IPC payload size Peter Ujfalusi
2022-05-06 13:26 ` [PATCH 2/8] ASoC: SOF: ipc-msg-injector: Query " Peter Ujfalusi
2022-05-06 13:26 ` Peter Ujfalusi [this message]
2022-05-06 13:26 ` [PATCH 4/8] ASoC: SOF: sof-client: Add API to get the ipc_type Peter Ujfalusi
2022-05-06 13:26 ` [PATCH 5/8] ASoC: SOF: sof-client: Add support IPC4 message sending Peter Ujfalusi
2022-05-06 13:26 ` [PATCH 6/8] ASoC: SOF: ipc-msg-injector: Separate the " Peter Ujfalusi
2022-05-06 13:26 ` [PATCH 7/8] ASoC: SOF: ipc-msg-injector: Add support for IPC4 messages Peter Ujfalusi
2022-05-06 13:26 ` [PATCH 8/8] ASoC: SOF: sof-client: IPC flood test can only work with SOF_IPC Peter Ujfalusi
2022-05-09 21:13 ` [PATCH 0/8] ASoC: SOF: sof-client: Update for different IPC versions Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220506132647.18690-4-peter.ujfalusi@linux.intel.com \
--to=peter.ujfalusi@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=daniel.baluta@nxp.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=lgirdwood@gmail.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=rander.wang@intel.com \
--cc=ranjani.sridharan@linux.intel.com \
--cc=yung-chuan.liao@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox