All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rojewski, Cezary" <cezary.rojewski@intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "pierre-louis.bossart@linux.intel.com"
	<pierre-louis.bossart@linux.intel.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"Kaczmarski, Filip" <filip.kaczmarski@intel.com>,
	"N, Harshapriya" <harshapriya.n@intel.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"Barlik, Marcin" <marcin.barlik@intel.com>,
	"zwisler@google.com" <zwisler@google.com>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"tiwai@suse.com" <tiwai@suse.com>,
	"Proborszcz, Filip" <filip.proborszcz@intel.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"amadeuszx.slawinski@linux.intel.com"
	<amadeuszx.slawinski@linux.intel.com>,
	"Wasko, Michal" <michal.wasko@intel.com>,
	"cujomalainey@chromium.org" <cujomalainey@chromium.org>,
	"Hejmowski, Krzysztof" <krzysztof.hejmowski@intel.com>,
	"ppapierkowski@habana.ai" <ppapierkowski@habana.ai>,
	"Gopal,  Vamshi Krishna" <vamshi.krishna.gopal@intel.com>
Subject: RE: [PATCH v8 02/14] ASoC: Intel: catpt: Implement IPC protocol
Date: Wed, 23 Sep 2020 19:33:23 +0000	[thread overview]
Message-ID: <e6f4354189ac4ed8bf453d22513fa9b1@intel.com> (raw)
In-Reply-To: <39bfea09d0a54c5dae3930408e45b10d@intel.com>

On 2020-09-23 9:24 PM, Rojewski, Cezary wrote:
> On 2020-09-23 3:17 PM, Andy Shevchenko wrote:
>> On Wed, Sep 23, 2020 at 02:24:56PM +0200, Cezary Rojewski wrote:
>>> Implement IRQ handlers for immediate and delayed replies and
>>> notifications. Communication is synchronous and allows for serialization
>>> of maximum one message at a time.
>>>

...

>>> +		if (!ret && reply->data && reply->size)
>>
>>> +			memcpy(reply->data, ipc->rx.data, ipc->rx.size);
>>
>> This I didn't get. You copy data by using source size?!
>>
>>> +	}
>>> +
>>> +	return ret;
>>
>> I guess the above piece may be refactored, but I don't know how until it is
>> clear why it's written like this.
>>
>> ...
>>
> 
> Well, ipc->rx.size equals reply->size as long as IPC procedure is in
> progress and reply != NULL. So either ipc->rx.size or reply->size
> suffices.
> 
> IPC protocol is quite simple here (albeit cAVS arguably is even simpler):
> 
> OUTBOX <channel: request - reply model>
> TX: copy request header to appropriate register, copy payload to outbox
> <IRQ>
> RX: copy reply header, copy returned payload only in successful case
> 

Forgotten to mention: yes OUTBOX's TX == OUTBOX's RX (HOST owns the
space during the request phase and yields the ownership to DSP once
IPCC_BUSY bit is set).

No ownership juggling in INBOX case.

Czarek


  reply	other threads:[~2020-09-23 19:34 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23 12:24 [PATCH v8 00/14] ASoC: Intel: Catpt - Lynx and Wildcat point Cezary Rojewski
2020-09-23 12:24 ` [PATCH v8 01/14] ASoC: Intel: Add catpt base members Cezary Rojewski
2020-09-23 13:18   ` Andy Shevchenko
2020-09-23 12:24 ` [PATCH v8 02/14] ASoC: Intel: catpt: Implement IPC protocol Cezary Rojewski
2020-09-23 13:17   ` Andy Shevchenko
2020-09-23 19:24     ` Rojewski, Cezary
2020-09-23 19:33       ` Rojewski, Cezary [this message]
2020-09-23 12:24 ` [PATCH v8 03/14] ASoC: Intel: catpt: Add IPC message handlers Cezary Rojewski
2020-09-23 13:25   ` Andy Shevchenko
2020-09-23 12:24 ` [PATCH v8 04/14] ASoC: Intel: catpt: Define DSP operations Cezary Rojewski
2020-09-23 13:26   ` Andy Shevchenko
2020-09-23 12:24 ` [PATCH v8 05/14] ASoC: Intel: catpt: Firmware loading and context restore Cezary Rojewski
2020-09-23 13:29   ` Andy Shevchenko
2020-09-23 12:25 ` [PATCH v8 06/14] ASoC: Intel: catpt: PCM operations Cezary Rojewski
2020-09-23 13:54   ` Andy Shevchenko
2020-09-23 14:53     ` Mark Brown
2020-09-23 18:23     ` Rojewski, Cezary
2020-09-24 14:22       ` Andy Shevchenko
2020-09-26  8:52         ` Rojewski, Cezary
2020-09-23 12:25 ` [PATCH v8 07/14] ASoC: Intel: catpt: Device driver lifecycle Cezary Rojewski
2020-09-23 13:31   ` Andy Shevchenko
2020-09-23 12:25 ` [PATCH v8 08/14] ASoC: Intel: catpt: Event tracing Cezary Rojewski
2020-09-23 13:29   ` Andy Shevchenko
2020-09-23 12:25 ` [PATCH v8 09/14] ASoC: Intel: catpt: Simple sysfs attributes Cezary Rojewski
2020-09-23 13:34   ` Andy Shevchenko
2020-09-23 18:31     ` Rojewski, Cezary
2020-09-24 14:24       ` Andy Shevchenko
2020-09-23 17:17   ` Greg KH
2020-09-23 12:25 ` [PATCH v8 10/14] ASoC: Intel: haswell: Remove haswell-solution specific code Cezary Rojewski
2020-09-23 12:25 ` [PATCH v8 11/14] ASoC: Intel: broadwell: " Cezary Rojewski
2020-09-23 12:25 ` [PATCH v8 12/14] ASoC: Intel: bdw-5650: " Cezary Rojewski
2020-09-23 12:25 ` [PATCH v8 13/14] ASoC: Intel: bdw-5677: " Cezary Rojewski
2020-09-23 12:25 ` [PATCH v8 14/14] ASoC: Intel: Select catpt and deprecate haswell Cezary Rojewski

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=e6f4354189ac4ed8bf453d22513fa9b1@intel.com \
    --to=cezary.rojewski@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=cujomalainey@chromium.org \
    --cc=filip.kaczmarski@intel.com \
    --cc=filip.proborszcz@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=harshapriya.n@intel.com \
    --cc=krzysztof.hejmowski@intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=marcin.barlik@intel.com \
    --cc=michal.wasko@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ppapierkowski@habana.ai \
    --cc=tiwai@suse.com \
    --cc=vamshi.krishna.gopal@intel.com \
    --cc=zwisler@google.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 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.