From: Mark Brown <broonie@kernel.org>
To: Vinod Koul <vinod.koul@intel.com>
Cc: liam.r.girdwood@linux.intel.com, tiwai@suse.de,
alsa-devel@alsa-project.org,
"Subhransu S. Prusty" <subhransu.s.prusty@intel.com>,
patches.audio@intel.com
Subject: Re: [RFC 2/9] ASoC: hda: Add IPC library for SKL platform
Date: Mon, 20 Apr 2015 22:56:39 +0100 [thread overview]
Message-ID: <20150420215639.GY14892@sirena.org.uk> (raw)
In-Reply-To: <1429276567-29007-3-git-send-email-vinod.koul@intel.com>
[-- Attachment #1.1: Type: text/plain, Size: 2338 bytes --]
On Fri, Apr 17, 2015 at 06:46:00PM +0530, Vinod Koul wrote:
> +
> +/* IPC data */
> +struct ssth_ipc {
> + struct device *dev;
> + struct ssth_lib *dsp;
> +
> +/* IPC messaging */
> + struct list_head tx_list;
Lots of odd indentation of comments in this code (well, several examples
I noticed so far anyway).
> + if (ret == 0)
> + ret = -ETIMEDOUT;
> + else {
> + /* copy the data returned from DSP */
Coding style - { } on both sides of the if (and the comments again).
> + if (msg->rx_size) {
> + if (rx_data)
> + memcpy(rx_data, msg->rx_data, msg->rx_size);
> + else
> + dev_err(ipc->dev, "error: no output buffer");
> + }
> + ret = msg->errno;
> + }
> +
> + ssth_ipc_msg_put_empty(ipc, msg);
> +
> + spin_unlock_irqrestore(&ipc->ipc_lock, irq_flags);
Can we pop the message off the list, release the lock and then copy?
That way we can avoid having interrupts disabled while we do the
memcpy(). In general there seems to be a lot of interrupts disabled
copying going on (which is there for some of the other drivers too)
which might be avoidable.
> +static void ssth_ipc_reply_remove(struct ssth_ipc *ipc, struct ssth_ipc_message *msg)
> +{
> + unsigned long irq_flags;
> +
> + spin_lock_irqsave(&ipc->ipc_lock, irq_flags);
> + if (list_empty(&ipc->rx_list)) {
> + dev_dbg(ipc->dev, "empty rx list");
> + goto out;
> + }
> + list_del(&msg->list);
> +
> +out:
> + spin_unlock_irqrestore(&ipc->ipc_lock, irq_flags);
> +}
Are we expecting to not find the message/
> + if (IPC_GLB_NOTIFI_MSG_TYPE(header.primary)) {
> + switch (IPC_GLB_NOTIFI_TYPE(header.primary)) {
> + case IPC_GLB_NOTIFCATION_GLITCH:
> + break;
> + case IPC_GLB_NOTIFCATION_OVERRUN:
> + break;
> + case IPC_GLB_NOTIFCATION_UNDERRUN:
> + dev_dbg(ipc->dev, "FW UNDERRUN\n");
> + break;
> + case IPC_GLB_NOTIFCATION_END_STREAM:
> + break;
> + case IPC_GLB_NOTIFCATION_PHRASE_DETECTED:
> + break;
> + case IPC_GLB_NOTIFCATION_RESOURCE_EVENT:
> + dev_dbg(ipc->dev, "MCPS Budget Violation\n");
> + break;
> + case IPC_GLB_NOTIFCATION_LOG_BUFFER_STATUS:
> + break;
> + case IPC_GLB_NOTIFCATION_TIMESTAMP_CAPTURED:
> + break;
> + case IPC_GLB_NOTIFCATION_FW_READY:
> + ipc->boot_complete = true;
> + wake_up(&ipc->boot_wait);
> + break;
More prints perhaps? _PHRASE_DETECTED looks interesting, as does
_OVERRUN.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2015-04-20 21:56 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-17 13:15 [RFC 0/9] Add SKL ipc handling code Vinod Koul
2015-04-17 13:15 ` [RFC 1/9] ASoC: hda: Add helper to read/write to dsp mmio space Vinod Koul
2015-04-20 21:46 ` Mark Brown
2015-04-22 3:50 ` Vinod Koul
2015-04-24 17:33 ` Mark Brown
2015-04-26 14:34 ` Vinod Koul
2015-04-27 21:02 ` Mark Brown
2015-04-29 11:03 ` Vinod Koul
2015-04-17 13:16 ` [RFC 2/9] ASoC: hda: Add IPC library for SKL platform Vinod Koul
2015-04-20 21:56 ` Mark Brown [this message]
2015-04-22 3:54 ` Vinod Koul
2015-04-24 17:34 ` Mark Brown
2015-04-26 14:36 ` Vinod Koul
2015-04-17 13:16 ` [RFC 3/9] ASoC: hda: Add config option for SKL ipc library Vinod Koul
2015-04-17 13:16 ` [RFC 4/9] ASoC: hda: Add DSP init and boot up functionality Vinod Koul
2015-04-24 17:11 ` Mark Brown
2015-04-26 14:21 ` Vinod Koul
2015-04-17 13:16 ` [RFC 5/9] ASoC: hda: Add dsp loader ops Vinod Koul
2015-04-17 13:16 ` [RFC 6/9] ASoC: hda: Add Code Loader DMA support Vinod Koul
2015-04-24 17:18 ` Mark Brown
2015-04-26 14:28 ` Vinod Koul
2015-04-27 14:17 ` Mark Brown
2015-04-29 11:08 ` Vinod Koul
2015-04-17 13:16 ` [RFC 7/9] ASoC: hda: Add DSP library functions for SKL platform Vinod Koul
2015-04-17 13:16 ` [RFC 8/9] ASoC: hda: Add for CL DMA interrupt handling Vinod Koul
2015-04-24 17:30 ` Mark Brown
2015-04-26 14:28 ` Vinod Koul
2015-04-17 13:16 ` [RFC 9/9] ASoC: hda: Export API to change DSP power state Vinod Koul
2015-04-24 17:33 ` Mark Brown
2015-04-20 21:44 ` [RFC 0/9] Add SKL ipc handling code Mark Brown
2015-04-22 4:00 ` Vinod Koul
2015-04-22 11:19 ` Liam Girdwood
2015-04-22 15:53 ` Vinod Koul
2015-04-22 19:06 ` 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=20150420215639.GY14892@sirena.org.uk \
--to=broonie@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=liam.r.girdwood@linux.intel.com \
--cc=patches.audio@intel.com \
--cc=subhransu.s.prusty@intel.com \
--cc=tiwai@suse.de \
--cc=vinod.koul@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