From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Cezary Rojewski <cezary.rojewski@intel.com>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org, broonie@kernel.org,
Daniel Baluta <daniel.baluta@nxp.com>
Subject: Re: [PATCH 2/3] ASoC: SOF: imx: Add i.MX8 HW support
Date: Mon, 19 Aug 2019 10:21:29 -0500 [thread overview]
Message-ID: <4fe0c027-9c6c-1e76-5fb0-7325fbab48a2@linux.intel.com> (raw)
In-Reply-To: <c8c78674-7af8-4577-9e18-da85c064b345@intel.com>
On 8/17/19 10:21 AM, Cezary Rojewski wrote:
> On 2019-08-15 17:44, Pierre-Louis Bossart wrote:
>> From: Daniel Baluta <daniel.baluta@nxp.com>
>>
>> Add support for the audio DSP hardware found on NXP i.MX8 platform.
>>
>> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
>> Signed-off-by: Pierre-Louis Bossart
>> <pierre-louis.bossart@linux.intel.com>
>> +static void imx8_get_reply(struct snd_sof_dev *sdev)
>> +{
>> + struct snd_sof_ipc_msg *msg = sdev->msg;
>> + struct sof_ipc_reply reply;
>> + int ret = 0;
>> +
>> + if (!msg) {
>> + dev_warn(sdev->dev, "unexpected ipc interrupt\n");
>> + return;
>> + }
>> +
>> + /* get reply */
>> + sof_mailbox_read(sdev, sdev->host_box.offset, &reply,
>> sizeof(reply));
>> +
>> + if (reply.error < 0) {
>> + memcpy(msg->reply_data, &reply, sizeof(reply));
>> + ret = reply.error;
>> + } else {
>> + /* reply has correct size? */
>> + if (reply.hdr.size != msg->reply_size) {
>> + dev_err(sdev->dev, "error: reply expected %zu got %u
>> bytes\n",
>> + msg->reply_size, reply.hdr.size);
>> + ret = -EINVAL;
>> + }
>> +
>> + /* read the message */
>> + if (msg->reply_size > 0)
>> + sof_mailbox_read(sdev, sdev->host_box.offset,
>> + msg->reply_data, msg->reply_size);
>> + }
>> +
>> + msg->reply_error = ret;
>> +}
>
> Assuming reply.hdr.size is coming from HW IPC regs, msg object is
> representing application side - SW, kernel. If so, is msg->reply_size
> value an estimated size (which can be overestimated since exact size may
> be unknown by the host) -or- the exact size of incoming IPC reply?
>
> The estimated-case is usually permissive as long as assumed size is >=
> reply.hdr.size - dev_err needed. In the exact-case, it should be viewed
> as a requirement. If such "requirement" fails, is it valid to read
> mailbox regardless? Is this to extract some error-debug payload sent by FW?
>
> Just curious, please feel free to correct me here, Pierre.
I don't quite understand the question. There is no use of HW IPC
registers (as done in SKL) since this is not portable across hardware.
There *may* be information sent over IPC registers but that would have
to be done in platform-specific ways - as will be done for Intel to e.g.
avoid using memory windows that may not be powered.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2019-08-19 20:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-15 15:44 [PATCH 0/3] ASoC: SOF: initial support for i.MX8 Pierre-Louis Bossart
2019-08-15 15:44 ` [PATCH 1/3] ASoC: SOF: Add OF DSP device support Pierre-Louis Bossart
2019-08-15 16:49 ` Mark Brown
2019-08-16 8:43 ` Daniel Baluta
2019-08-19 13:46 ` Shawn Guo
2019-08-19 19:24 ` Mark Brown
2019-08-19 19:32 ` Daniel Baluta
2019-08-19 20:23 ` Mark Brown
2019-08-15 15:44 ` [PATCH 2/3] ASoC: SOF: imx: Add i.MX8 HW support Pierre-Louis Bossart
2019-08-17 15:21 ` Cezary Rojewski
2019-08-19 6:44 ` Daniel Baluta
2019-08-19 15:21 ` Pierre-Louis Bossart [this message]
2019-08-19 21:16 ` Cezary Rojewski
2019-08-15 15:45 ` [PATCH 3/3] ASoC: SOF: topology: Add dummy support for i.MX8 DAIs Pierre-Louis Bossart
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=4fe0c027-9c6c-1e76-5fb0-7325fbab48a2@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=cezary.rojewski@intel.com \
--cc=daniel.baluta@nxp.com \
--cc=tiwai@suse.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.