From: Keyon Jie <yang.jie@linux.intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
Mark Brown <broonie@kernel.org>
Cc: Daniel Baluta <daniel.baluta@gmail.com>,
andriy.shevchenko@intel.com, tiwai@suse.de,
alsa-devel@alsa-project.org, liam.r.girdwood@linux.intel.com,
vkoul@kernel.org, sound-open-firmware@alsa-project.org,
Alan Cox <alan@linux.intel.com>
Subject: Re: [Sound-open-firmware] [PATCH v3 04/14] ASoC: SOF: Add support for IPC IO between DSP and Host
Date: Wed, 23 Jan 2019 13:51:28 +0800 [thread overview]
Message-ID: <893450dc-0c8f-ee99-6637-0dc1336f54e5@linux.intel.com> (raw)
In-Reply-To: <c4555b61-249c-7c7e-65ed-426e4be32309@linux.intel.com>
On 2019/1/23 上午5:05, Pierre-Louis Bossart wrote:
>
> On 1/22/19 1:04 PM, Mark Brown wrote:
>> On Thu, Jan 10, 2019 at 02:11:32PM -0600, Pierre-Louis Bossart wrote:
>>
>>>>> + /* attach any data */
>>>>> + if (msg_bytes)
>>>>> + memcpy(msg->msg_data, msg_data, msg_bytes);
>>>> How big do these messages get? Do we need to hold the lock while we
>>>> memcpy()?
>>> Messages can be as big as the mailbox, which is hardware dependent.
>>> It could
>>> be from a few bytes to a larger e.g. 4k page or more, and indeed we
>>> need to
>>> keep the lock.
>> Is this copying into an actual mailbox or into some data structure in
>> memory? It looked like it's copying into a buffer for sending rather
>> than the mailbox.
> I realize between your feedback and Daniel's that we have a terminology
> issue. On the Intel side we don't have a dedicated hardware mailbox
> unit, it's only doorbell registers and shared memory windows.
>>
>>>>> + /* schedule the message if not busy */
>>>>> + if (snd_sof_dsp_is_ready(sdev))
>>>>> + schedule_work(&ipc->tx_kwork);
>>>> If the DSP is idle is there a reason this has to happen in another
>>>> thread?
>>> we will rename this as snd_sof_dsp_is_ipc_ready() to avoid any confusion
>>> with the DSP state. We only care about IPC registers/doorbells at this
>>> point, not the fact that the DSP is in its idle loop.
>> You're missing the point - why can't we just immediately send the
>> message to the DSP from here, what's the benefit of scheduling some work
>> to do that?
>
> I realize this might be Intel-specific and will likely have to evolve.
>
> Keyon/Liam, this is your code, can you comment on Mark's comments (here)
Hi Mark, I think you are right, we can actually call the message sending
immediately here as we already hold the lock which can avoid race condition.
We scheduled another thread to do the sending task, aimed to make sure
those messages(required to be sent from different thread) can be sent in
sequence one by one(with the FIFO list), but that doesn't means we have
to do it in another thread, let's change it.
>
>
>>
>>>>> + spin_unlock_irqrestore(&sdev->ipc_lock, flags);
>>>> The thread is also going to take an irq spinlock after all.
>>> didn't get this point, sorry.
>> One reason to bounce to another thread would be to do something that you
>> can't do in this context like take a lock in a place you can't take
>> locks but here we're taking a lock that needs thread context already.
>
> Liam/Keyon comment needed here as well.
>
> I think there are multiple questions that should be better answered to
>
> 1. why do we schedule a thread when the DSP is not busy
As explain above, I think it's not necessary, let's change it.
>
> 2. what happens if it is?
>
> 3. can we avoid freeing the lock to take it again when we schedule?
Then those #2 #3 issues not existed?
Thanks,
~Keyon
>
> _______________________________________________
> Sound-open-firmware mailing list
> Sound-open-firmware@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2019-01-23 5:51 UTC|newest]
Thread overview: 95+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-11 21:23 [PATCH v3 00/14] Sound Open Firmware (SOF) core Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 01/14] ASoC: SOF: Add Sound Open Firmware driver core Pierre-Louis Bossart
2018-12-11 22:20 ` Andy Shevchenko
2018-12-11 23:20 ` Pierre-Louis Bossart
2018-12-12 7:51 ` Takashi Iwai
2018-12-12 14:53 ` Pierre-Louis Bossart
2018-12-12 20:42 ` Daniel Baluta
2018-12-12 22:35 ` Pierre-Louis Bossart
2019-01-29 16:49 ` Daniel Baluta
2019-01-30 16:12 ` Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 02/14] ASoC: SOF: Add Sound Open Firmware KControl support Pierre-Louis Bossart
2018-12-11 22:23 ` Andy Shevchenko
2018-12-11 22:48 ` Pierre-Louis Bossart
2018-12-11 23:25 ` Andy Shevchenko
2018-12-12 20:18 ` Pierre-Louis Bossart
2018-12-12 7:35 ` Takashi Iwai
2018-12-12 15:01 ` Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 03/14] ASoC: SOF: Add driver debug support Pierre-Louis Bossart
2018-12-11 22:32 ` Andy Shevchenko
2018-12-11 23:29 ` Pierre-Louis Bossart
2019-01-09 19:40 ` Mark Brown
2019-01-10 20:47 ` Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 04/14] ASoC: SOF: Add support for IPC IO between DSP and Host Pierre-Louis Bossart
2018-12-11 22:57 ` Andy Shevchenko
2018-12-11 23:38 ` Pierre-Louis Bossart
2018-12-12 8:17 ` Takashi Iwai
2018-12-12 15:19 ` Pierre-Louis Bossart
2018-12-12 15:34 ` Takashi Iwai
2018-12-13 5:24 ` Keyon Jie
2018-12-13 7:48 ` Takashi Iwai
2018-12-13 9:13 ` Keyon Jie
2018-12-13 8:06 ` Keyon Jie
2018-12-13 8:59 ` rander.wang
2019-01-09 20:37 ` Mark Brown
2019-01-10 20:11 ` Pierre-Louis Bossart
2019-01-22 19:04 ` Mark Brown
2019-01-22 21:05 ` Pierre-Louis Bossart
2019-01-22 21:13 ` Mark Brown
2019-01-23 5:51 ` Keyon Jie [this message]
2019-01-14 15:10 ` Daniel Baluta
2019-01-14 17:39 ` Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 05/14] ASoC: SOF: Add PCM operations support Pierre-Louis Bossart
2018-12-12 8:04 ` Takashi Iwai
2018-12-12 13:12 ` Andy Shevchenko
2018-12-12 15:29 ` [Sound-open-firmware] " Pierre-Louis Bossart
2018-12-12 15:43 ` Takashi Iwai
2018-12-12 16:10 ` Pierre-Louis Bossart
2018-12-12 22:09 ` Daniel Baluta
2018-12-11 21:23 ` [PATCH v3 06/14] ASoC: SOF: Add support for loading topologies Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 07/14] ASoC: SOF: Add DSP firmware logger support Pierre-Louis Bossart
2018-12-11 23:21 ` Andy Shevchenko
2018-12-11 23:43 ` Pierre-Louis Bossart
2018-12-12 6:44 ` Takashi Iwai
2018-12-12 11:11 ` Takashi Iwai
2018-12-12 16:04 ` [Sound-open-firmware] " Pierre-Louis Bossart
2018-12-12 16:12 ` Takashi Iwai
2018-12-12 17:01 ` Pierre-Louis Bossart
2019-01-09 20:44 ` Mark Brown
2019-01-09 21:39 ` Pierre-Louis Bossart
2019-01-22 18:57 ` Mark Brown
2019-01-22 20:33 ` Pierre-Louis Bossart
2019-01-22 20:41 ` Mark Brown
2019-01-22 20:52 ` Pierre-Louis Bossart
2019-01-22 21:08 ` Mark Brown
2019-01-22 21:13 ` Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 08/14] ASoC: SOF: Add DSP HW abstraction operations Pierre-Louis Bossart
2018-12-11 23:16 ` Andy Shevchenko
2018-12-11 23:45 ` Pierre-Louis Bossart
2019-01-09 20:51 ` Mark Brown
2019-01-09 21:37 ` Pierre-Louis Bossart
2019-01-22 18:56 ` Mark Brown
2018-12-11 21:23 ` [PATCH v3 09/14] ASoC: SOF: Add firmware loader support Pierre-Louis Bossart
2018-12-11 22:38 ` Andy Shevchenko
2018-12-11 23:54 ` Pierre-Louis Bossart
2019-01-09 20:55 ` Mark Brown
2018-12-12 11:23 ` Takashi Iwai
2018-12-12 16:06 ` [Sound-open-firmware] " Pierre-Louis Bossart
2019-01-09 21:02 ` Mark Brown
2019-01-09 21:24 ` Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 10/14] ASoC: SOF: Add userspace ABI support Pierre-Louis Bossart
2018-12-21 11:10 ` Daniel Baluta
2018-12-21 14:59 ` [Sound-open-firmware] " Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 11/14] ASoC: SOF: Add PM support Pierre-Louis Bossart
2018-12-12 11:32 ` Takashi Iwai
2018-12-12 16:08 ` Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 12/14] ASoC: SOF: Add Nocodec machine driver support Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 13/14] ASoC: SOF: Add xtensa support Pierre-Louis Bossart
2018-12-11 23:08 ` Andy Shevchenko
2018-12-12 0:00 ` Pierre-Louis Bossart
[not found] ` <93aff9af-c693-c951-4821-e9e334133ed0@linux.intel.com>
2018-12-13 9:58 ` [Sound-open-firmware] " rander.wang
2018-12-17 13:45 ` Takashi Iwai
2018-12-17 14:24 ` Mark Brown
2018-12-11 21:23 ` [PATCH v3 14/14] ASoC: SOF: Add utils Pierre-Louis Bossart
2018-12-11 23:06 ` Andy Shevchenko
2018-12-12 0:06 ` 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=893450dc-0c8f-ee99-6637-0dc1336f54e5@linux.intel.com \
--to=yang.jie@linux.intel.com \
--cc=alan@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=andriy.shevchenko@intel.com \
--cc=broonie@kernel.org \
--cc=daniel.baluta@gmail.com \
--cc=liam.r.girdwood@linux.intel.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=sound-open-firmware@alsa-project.org \
--cc=tiwai@suse.de \
--cc=vkoul@kernel.org \
/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