From: Shreyas NC <shreyas.nc@intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: patches.audio@intel.com, gregkh@linuxfoundation.org,
alsa-devel@alsa-project.org, vkoul@kernel.org,
sanyog.r.kale@intel.com
Subject: Re: [PATCH v3 5/6] soundwire: Add support for multi link bank switch
Date: Mon, 18 Jun 2018 15:20:16 +0530 [thread overview]
Message-ID: <20180618095015.GO3116@snc-desk> (raw)
In-Reply-To: <fe087024-ce4e-ca11-cf68-6dca583b7cbb@linux.intel.com>
On Thu, Jun 14, 2018 at 01:34:13PM -0500, Pierre-Louis Bossart wrote:
>
> >diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c
> >index 0e8a2eb5..771c963 100644
> >--- a/drivers/soundwire/stream.c
> >+++ b/drivers/soundwire/stream.c
> >@@ -638,6 +638,8 @@ static int sdw_bank_switch(struct sdw_bus *bus)
> > if (!wr_msg)
> > return -ENOMEM;
> >+ bus->defer_msg.msg = wr_msg;
> >+
> > wbuf = kzalloc(sizeof(*wbuf), GFP_KERNEL);
> > if (!wbuf) {
> > ret = -ENOMEM;
> >@@ -658,17 +660,23 @@ static int sdw_bank_switch(struct sdw_bus *bus)
> > SDW_MSG_FLAG_WRITE, wbuf);
> > wr_msg->ssp_sync = true;
> >- ret = sdw_transfer(bus, wr_msg);
> >+ if (bus->multi_link)
> >+ ret = sdw_transfer_defer(bus, wr_msg, &bus->defer_msg);
> >+ else
> >+ ret = sdw_transfer(bus, wr_msg);
> >+
>
> Re-reading this v3, I wonder if there is a small logic flaw here or an
> intended behavior.
>
> the bus->multi_link field is a hardware capability, it provides information
> on whether the hardware can support synchronized bank switches across
> multiple Master interfaces. This is independent of the streams being
> handled, it's a bus property - not a stream one.
>
> However the default/typical case is a stream handled by a single master, so
> when the hardware is capable of handling multiple masters this does not mean
> you should use the deferred transfer, the regular case would work just fine
> for a regular stream. If your SSP rate is faster than the common sync signal
> it might even be beneficial not to use the deferred transfer.
>
> in other words, should the code be written with something like
> if (bus->multi_link && master_rt_count > 1)
> with master_rt_count being determined based on the stream properties.
>
> Or was the intent that you always rely on the deferred mechanism, even if
> the stream is not handled by multiple masters? In that case, do we even need
> the regular bank switch?
After discussing with folks here, I understand that intent was to have an
unified flow for both Multi and Single instance cases. Yes, we can always
use the sdw_transfer_defer() and remove the references to bus->multi_link
possibly. So, I will fix this up and post v4.
Thanks for the catch :)
--Shreyas
--
next prev parent reply other threads:[~2018-06-18 9:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-14 11:31 [PATCH v3 0/6] soundwire: Add multi link support Shreyas NC
2018-06-14 11:31 ` [PATCH v3 1/6] Documentation: soundwire: Add documentation for multi link Shreyas NC
2018-06-14 11:31 ` [PATCH v3 2/6] soundwire: Initialize completion for defer messages Shreyas NC
2018-06-14 11:32 ` [PATCH v3 3/6] soundwire: Add support to lock across bus instances Shreyas NC
2018-06-14 11:32 ` [PATCH v3 4/6] soundwire: Handle multiple master instances in a stream Shreyas NC
2018-06-14 11:32 ` [PATCH v3 5/6] soundwire: Add support for multi link bank switch Shreyas NC
2018-06-14 18:34 ` Pierre-Louis Bossart
2018-06-18 9:50 ` Shreyas NC [this message]
2018-06-18 14:41 ` Vinod
2018-06-14 11:32 ` [PATCH v3 6/6] soundwire: intel: Add pre/post bank switch ops Shreyas NC
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=20180618095015.GO3116@snc-desk \
--to=shreyas.nc@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=gregkh@linuxfoundation.org \
--cc=patches.audio@intel.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=sanyog.r.kale@intel.com \
--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;
as well as URLs for NNTP newsgroup(s).