All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: ALSA <alsa-devel@alsa-project.org>,
	Charles Keepax <ckeepax@opensource.cirrus.com>,
	Takashi <tiwai@suse.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	plai@codeaurora.org, LKML <linux-kernel@vger.kernel.org>,
	Sagar Dharia <sdharia@codeaurora.org>,
	patches.audio@intel.com, Mark <broonie@kernel.org>,
	srinivas.kandagatla@linaro.org,
	Sudheer Papothi <spapothi@codeaurora.org>,
	alan@linux.intel.com
Subject: Re: [alsa-devel] [PATCH v4 06/15] soundwire: Add IO transfer
Date: Wed, 6 Dec 2017 20:14:02 +0530	[thread overview]
Message-ID: <20171206144402.GT32417@localhost> (raw)
In-Reply-To: <8c38baee-45f8-682e-f781-c35e26c26d9f@linux.intel.com>

On Wed, Dec 06, 2017 at 07:32:43AM -0600, Pierre-Louis Bossart wrote:
> On 12/5/17 11:58 PM, Vinod Koul wrote:
> >On Tue, Dec 05, 2017 at 08:48:03AM -0600, Pierre-Louis Bossart wrote:
> >>On 12/5/17 7:43 AM, Pierre-Louis Bossart wrote:
> >>>On 12/5/17 12:31 AM, Vinod Koul wrote:
> >>>>On Sun, Dec 03, 2017 at 09:01:41PM -0600, Pierre-Louis Bossart wrote:
> >
> >>>>>>>>+static inline int do_transfer(struct sdw_bus *bus, struct
> >>>>>>>>sdw_msg *msg)
> >>>>>>>>+{
> >>>>>>>>+    int retry = bus->prop.err_threshold;
> >>>>>>>>+    enum sdw_command_response resp;
> >>>>>>>>+    int ret = 0, i;
> >>>>>>>>+
> >>>>>>>>+    for (i = 0; i <= retry; i++) {
> >>>>>>>>+        resp = bus->ops->xfer_msg(bus, msg);
> >>>>>>>>+        ret = find_response_code(resp);
> >>>>>>>>+
> >>>>>>>>+        /* if cmd is ok or ignored return */
> >>>>>>>>+        if (ret == 0 || ret == -ENODATA)
> >>>>>>>
> >>>>>>>Can you document why you don't retry on a CMD_IGNORED? I know
> >>>>>>>there was a
> >>>>>>>reason, I just can't remember it.
> >>>>>>
> >>>>>>CMD_IGNORED can be okay on broadcast. User of this API can retry all
> >>>>>>they
> >>>>>>want!
> >>>>>
> >>>>>So you retry if this is a CMD_FAILED but let higher levels retry for
> >>>>>CMD_IGNORED, sorry I don't see the logic.
> >>>>
> >>>>Yes that is right.
> >>>>
> >>>>If I am doing a broadcast read, lets say for Device Id registers, why in
> >>>>the
> >>>>world would I want to retry? CMD_IGNORED is a valid response and
> >>>>required to
> >>>>stop enumeration cycle in that case.
> >
> >Above is the clarfication
> >
> >>>>But if I am not expecting a CMD_IGNORED response, I can very well go
> >>>>ahead
> >>>>and retry from caller. The context is with caller and they can choose to
> >>>>do
> >>>>appropriate handling.
> >>>>
> >>>>And I have clarified this couple of times to you already, not sure how
> >>>>many
> >>>>more times I would have to do that.
> >>>
> >>>Until you clarify what you are doing.
> >
> >Let me try again, I think u missed that part of my reply above
> >
> >If I am doing a broadcast read, lets say for Device Id registers,
> >why in the world would I want to retry? CMD_IGNORED is a valid response
> >and required to stop enumeration cycle in that case.
> >
> >>>There is ONE case where IGNORED is a valid answer (reading the Prepare not
> >>>finished bits), and it should not only be documented but analyzed in more
> >>>details.
> >>I meant Read SCP_DevID registers from Device0... prepare bits should never
> >>return a CMD_IGNORED
> >
> >Precisely as I pointed out above.
> >
> >>>For a write an IGNORED is never OK.
> >
> >Agreed, but then transfer does both read and write. Write call can treat it
> >as error and read call leaves it upto caller.
> >
> >Does that sound okay for you?
> 
> Not really.
> You have one case where it's ok and all others are not ok, to me this sounds
> like you should avoid the retry at the lowest level rather than pushing this
> to the caller
> And now that I think of it, the definitions for the DisCo spec were really
> meant for hardware-based retries available in some master IPs. If this is
> enabled, then the loops in software are not really needed at all. Can you
> please check this point?

Sure I will check that

-- 
~Vinod

  reply	other threads:[~2017-12-06 14:40 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01  9:56 [PATCH v4 00/15] soundwire: Add a new SoundWire subsystem Vinod Koul
2017-12-01  9:56 ` [PATCH v4 01/15] Documentation: Add SoundWire summary Vinod Koul
2017-12-01  9:56 ` [PATCH v4 02/15] soundwire: Add SoundWire bus type Vinod Koul
2017-12-01  9:56   ` Vinod Koul
2017-12-01  9:56 ` [PATCH v4 03/15] soundwire: Add Master registration Vinod Koul
2017-12-01 22:10   ` [alsa-devel] " Pierre-Louis Bossart
2017-12-03 16:41     ` Vinod Koul
2017-12-04  2:44       ` Pierre-Louis Bossart
2017-12-04  2:59         ` Vinod Koul
2017-12-01  9:56 ` [PATCH v4 04/15] soundwire: Add MIPI DisCo property helpers Vinod Koul
2017-12-01  9:56   ` Vinod Koul
2017-12-01 22:49   ` [alsa-devel] " Pierre-Louis Bossart
2017-12-03 16:52     ` Vinod Koul
2017-12-03 16:52       ` Vinod Koul
2017-12-04  2:50       ` [alsa-devel] " Pierre-Louis Bossart
2017-12-04  2:50         ` Pierre-Louis Bossart
2017-12-01  9:56 ` [PATCH v4 05/15] soundwire: Add SoundWire MIPI defined registers Vinod Koul
2017-12-01  9:56   ` Vinod Koul
2017-12-01  9:56 ` [PATCH v4 06/15] soundwire: Add IO transfer Vinod Koul
2017-12-01 23:27   ` [alsa-devel] " Pierre-Louis Bossart
2017-12-03 17:04     ` Vinod Koul
2017-12-03 17:04       ` Vinod Koul
2017-12-04  3:01       ` [alsa-devel] " Pierre-Louis Bossart
2017-12-05  6:31         ` Vinod Koul
2017-12-05 13:43           ` Pierre-Louis Bossart
2017-12-05 14:48             ` Pierre-Louis Bossart
2017-12-05 14:48               ` Pierre-Louis Bossart
2017-12-06  5:58               ` [alsa-devel] " Vinod Koul
2017-12-06 13:32                 ` Pierre-Louis Bossart
2017-12-06 13:32                   ` Pierre-Louis Bossart
2017-12-06 14:44                   ` Vinod Koul [this message]
2017-12-01  9:56 ` [PATCH v4 07/15] regmap: Add SoundWire bus support Vinod Koul
2017-12-01  9:56   ` Vinod Koul
2017-12-01  9:56 ` [PATCH v4 08/15] soundwire: Add Slave status handling helpers Vinod Koul
2017-12-01 23:36   ` [alsa-devel] " Pierre-Louis Bossart
2017-12-03 17:08     ` Vinod Koul
2017-12-04  3:07       ` Pierre-Louis Bossart
2017-12-04  3:07         ` Pierre-Louis Bossart
2017-12-04  3:13         ` [alsa-devel] " Vinod Koul
2017-12-04  3:13           ` Vinod Koul
2017-12-01  9:56 ` [PATCH v4 09/15] soundwire: Add slave status handling Vinod Koul
2017-12-01 23:52   ` [alsa-devel] " Pierre-Louis Bossart
2017-12-03 17:11     ` Vinod Koul
2017-12-03 17:11       ` Vinod Koul
2017-12-04  3:11       ` [alsa-devel] " Pierre-Louis Bossart
2017-12-04  3:21         ` Vinod Koul
2017-12-04  3:21           ` Vinod Koul
2017-12-04  3:52           ` [alsa-devel] " Pierre-Louis Bossart
2017-12-04  3:52             ` Pierre-Louis Bossart
2017-12-06  9:44             ` [alsa-devel] " Vinod Koul
2017-12-06  9:44               ` Vinod Koul
2017-12-01  9:56 ` [PATCH v4 10/15] soundwire: Add sysfs for SoundWire DisCo properties Vinod Koul
2017-12-01  9:56 ` [PATCH v4 11/15] soundwire: cdns: Add cadence library Vinod Koul
2017-12-01  9:56   ` Vinod Koul
2017-12-01  9:56 ` [PATCH v4 12/15] soundwire: cdns: Add sdw_master_ops and IO transfer support Vinod Koul
2017-12-02  0:02   ` [alsa-devel] " Pierre-Louis Bossart
2017-12-02  0:02     ` Pierre-Louis Bossart
2017-12-03 17:10     ` [alsa-devel] " Vinod Koul
2017-12-03 17:10       ` Vinod Koul
2017-12-01  9:56 ` [PATCH v4 13/15] soundwire: intel: Add Intel Master driver Vinod Koul
2017-12-01  9:56 ` [PATCH v4 14/15] soundwire: intel: Add Intel init module Vinod Koul
2017-12-01  9:56 ` [PATCH v4 15/15] MAINTAINERS: Add SoundWire entry Vinod Koul
2017-12-02  0:24 ` [alsa-devel] [PATCH v4 00/15] soundwire: Add a new SoundWire subsystem Pierre-Louis Bossart
2017-12-02  0:24   ` Pierre-Louis Bossart
2017-12-03 17:12   ` [alsa-devel] " Vinod Koul
2017-12-03 17:12     ` Vinod Koul

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=20171206144402.GT32417@localhost \
    --to=vinod.koul@intel.com \
    --cc=alan@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches.audio@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=plai@codeaurora.org \
    --cc=sdharia@codeaurora.org \
    --cc=spapothi@codeaurora.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.de \
    /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.