From: Mark Brown <broonie@kernel.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: linux-sound@vger.kernel.org, alsa-devel@alsa-project.org,
tiwai@suse.de, vinod.koul@intel.com,
Bard liao <yung-chuan.liao@linux.intel.com>,
Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
Peter Ujfalusi <peter.ujfalusi@linux.intel.com>,
Kai Vehmanen <kai.vehmanen@linux.intel.com>,
srinivas.kandagatla@linaro.org,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
vijendar.mukunda@amd.com,
Charles Keepax <ckeepax@opensource.cirrus.com>,
Richard Fitzgerald <rf@opensource.cirrus.com>,
Shuming Fan <shumingf@realtek.com>, Jack Yu <jack.yu@realtek.com>,
Oder Chiou <oder_chiou@realtek.com>
Subject: Re: [RFC PATCH 01/16] Documentation: driver: add SoundWire BRA description
Date: Fri, 8 Dec 2023 21:49:13 +0000 [thread overview]
Message-ID: <ZXOPWRWvrRddOWpT@finisterre.sirena.org.uk> (raw)
In-Reply-To: <5b8e74ad-460f-4e68-a17b-3131d810f29b@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 5044 bytes --]
On Thu, Dec 07, 2023 at 06:56:55PM -0600, Pierre-Louis Bossart wrote:
> >> +The Device Number specified in the Header follows the SoundWire
> >> +definitions, and broadcast and group addressing are
> >> +permitted. However, in reality it is very unlikely that the exact same
> >> +binary data needs to be provided to the two different Peripheral
> >> +devices. The Linux implementation only allows for transfers to a
> >> +single device at a time.
> > For the firmware download case it seems likely that this won't always be
> > the case, but it's definitely a thing that could be done incrementally.
> One example discussed this week on the mailing list is the Cirrus Logic
> case, where the firmware contains information on which speakers a given
> amplifier should be doing, and each firmware is named as AMP-n.
I can imagine a vendor structuring things so they've got separate
firmware and coefficent/configuration images, the firmware images could
be shared.
> I have really not found any practical case where the same data needs to
> be sent to N devices, and I don't have a burning desire to tie the codec
> initialization together with all the asynchronous nature of
> enumeration/probe.
Like I say it does seem like something that could be done incrementally.
> > These don't seem like insurmountable obstacles - they feel more like a
> > copy break kind of situation where we can infer things from the pattern
> > of transactions, and there's always the possibility of adding some calls
> > to give regmap more high level information about the overall state of
> > the device. One of the expected usage patterns with cache only mode is
> > to build up a final register state then let the cache code work out the
> > optimal pattern to actually write that out.
> I did expect some pushback on regmap :-)
> The point is really that the main use for this download is a set of
> write-once memory areas which happen to be mapped as registers. There is
> no real need to declare or access each memory address individually.
Yeah, normally it's just write only stuff but I've seen things like
controls being added in the DSP memory before - the
> In addition in terms of error handling, the expectation is that the set
> of writes are handled in a pass/fail manner. There's no real way to know
> which of the individual writes failed.
That's the case for any block writes.
> > I might be missing something but those requests for redownload sound
> > like things that would occur regardless of the mechanism used to perform
> > the I/O?
> What I meant is that the codec driver would e.g. need to fetch a
> different firmware table and download it. There's no real need to
> maintain a cache on the host side since the entire table will be downloaded.
I mean, if that's the usage pattern surely things would just be marked
volatile anyway? A cache is entirely optional.
> > This feels a lot like it could map onto the regmap async interface, it
> > would need a bit of a rework (mainly that currently they provide
> > ordering guarantees with respect to both each other and sync I/O) but
> > those could be removed with some care) but it's got the "here's a list
> > of I/O, here's another call to ensure it's all actually happened" thing.
> > It sounds very much like how I was thinking of the async API when I was
> > writing it and the initial users.
> > It's this bit that really got me thinking it could fit well into regmap.
> I really don't know anything about this async interface, if you have
> pointers on existing examples I am all ears....I am not aware of any
> Intel platform or codec used on an Intel platform making use of this API.
grep for regmap_.*async - cs_dsp.c is the upstream example in a driver,
or there's the rbtree cache sync code which uses a back door to go into
an async mode. Basically just variants of all the normal regmap I/O
calls with a _complete() call you can use to wait for everything to
happen. The implementation is a bit heavyweight since it was written to
work with fairly slow buses.
> At any rate the low-level behavior is to
> a) allocate and configure all the SoundWire resources
> b) allocate and configure all the DMA resources
> c) trigger DMA and enable SoundWire transfers
> d) wait for the DMA to complete
> The codec API can be modified as needed, as long as there are provisions
> for these 4 steps.
That's not quite how the current API works, but it feels like it's close
enough to the intent and there's literally one user of the actual API.
> >> + (3) A Peripheral driver may want to wait until existing BRA
> >> + transfers complete or deal with BRA as a background task when
> >> + audio transfers stop. In this case, there would be no timeout,
> >> + and the operation may not happen if the platform is suspended.
> > Option 3 would be a jump for regmap.
> Sorry, I don't get what a 'jump' means in this context.
Big change.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2023-12-08 21:49 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-07 22:29 [RFC PATCH 00/16] soundwire/ASoC: speed-up downloads with BTP/BRA protocol Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 01/16] Documentation: driver: add SoundWire BRA description Pierre-Louis Bossart
2023-12-07 23:29 ` Mark Brown
2023-12-08 0:56 ` Pierre-Louis Bossart
2023-12-08 21:49 ` Mark Brown [this message]
2023-12-19 16:50 ` Pierre-Louis Bossart
2023-12-19 16:53 ` Mark Brown
2023-12-19 17:08 ` Pierre-Louis Bossart
2023-12-20 15:16 ` Charles Keepax
2023-12-20 18:26 ` Pierre-Louis Bossart
2023-12-20 18:28 ` Mark Brown
2023-12-21 9:46 ` Charles Keepax
2024-08-20 7:48 ` Pierre-Louis Bossart
2024-08-20 11:53 ` Mark Brown
2024-08-20 14:58 ` Pierre-Louis Bossart
2024-08-20 15:09 ` Mark Brown
2023-12-08 16:27 ` Charles Keepax
2023-12-08 18:45 ` Pierre-Louis Bossart
2023-12-08 18:55 ` Mark Brown
2023-12-18 11:40 ` Vinod Koul
2023-12-18 12:58 ` Pierre-Louis Bossart
2023-12-18 14:29 ` Charles Keepax
2023-12-18 16:33 ` Pierre-Louis Bossart
2023-12-21 14:45 ` Vinod Koul
2023-12-21 14:44 ` Vinod Koul
2023-12-21 14:44 ` Vinod Koul
2023-12-07 22:29 ` [RFC PATCH 02/16] soundwire: cadence: add BTP support for DP0 Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 03/16] soundwire: stream: extend sdw_alloc_stream() to take 'type' parameter Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 04/16] soundwire: extend sdw_stream_type to BPT Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 05/16] soundwire: stream: special-case the bus compute_params() routine Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 06/16] soundwire: stream: reuse existing code for BPT stream Pierre-Louis Bossart
2023-12-12 12:30 ` Charles Keepax
2023-12-18 10:45 ` Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 07/16] soundwire: bus: add API for BPT protocol Pierre-Louis Bossart
2023-12-12 12:19 ` Charles Keepax
2023-12-18 10:38 ` Pierre-Louis Bossart
2023-12-18 11:54 ` Vinod Koul
2023-12-18 13:12 ` Pierre-Louis Bossart
2023-12-18 14:57 ` Charles Keepax
2023-12-18 16:44 ` Pierre-Louis Bossart
2023-12-21 14:49 ` Vinod Koul
2023-12-07 22:29 ` [RFC PATCH 08/16] soundwire: bus: add bpt_stream pointer Pierre-Louis Bossart
2023-12-18 11:55 ` Vinod Koul
2023-12-18 13:20 ` Pierre-Louis Bossart
2023-12-21 14:39 ` Vinod Koul
2023-12-21 17:09 ` Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 09/16] soundwire: crc8: add constant table Pierre-Louis Bossart
2023-12-18 12:01 ` Vinod Koul
2023-12-18 13:26 ` Pierre-Louis Bossart
2023-12-21 14:42 ` Vinod Koul
2023-12-21 17:15 ` Pierre-Louis Bossart
2023-12-21 17:21 ` Vinod Koul
2023-12-07 22:29 ` [RFC PATCH 10/16] soundwire: cadence: add BTP/BRA helpers to format data Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 11/16] soundwire: intel_auxdevice: add indirection for BPT open/close/send_async/wait Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 12/16] ASoC: SOF: Intel: hda-sdw-bpt: add helpers for SoundWire BPT DMA Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 13/16] soundwire: intel: add BPT context definition Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 14/16] soundwire: intel_ace2x: add BPT open/close/send_async/wait Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 15/16] soundwire: debugfs: add interface for BPT/BRA transfers Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 16/16] ASoC: rt711-sdca: add DP0 support Pierre-Louis Bossart
2023-12-07 22:56 ` [RFC PATCH 00/16] soundwire/ASoC: speed-up downloads with BTP/BRA protocol Mark Brown
2023-12-07 23: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=ZXOPWRWvrRddOWpT@finisterre.sirena.org.uk \
--to=broonie@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=jack.yu@realtek.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-sound@vger.kernel.org \
--cc=oder_chiou@realtek.com \
--cc=peter.ujfalusi@linux.intel.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=ranjani.sridharan@linux.intel.com \
--cc=rf@opensource.cirrus.com \
--cc=shumingf@realtek.com \
--cc=srinivas.kandagatla@linaro.org \
--cc=tiwai@suse.de \
--cc=vijendar.mukunda@amd.com \
--cc=vinod.koul@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