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>,
	tiwai@suse.de, Greg KH <gregkh@linuxfoundation.org>,
	liam.r.girdwood@linux.intel.com, patches.audio@intel.com,
	broonie@kernel.org, Sanyog Kale <sanyog.r.kale@intel.com>
Subject: Re: [PATCH 01/13] soundwire: Add more documentation
Date: Fri, 30 Mar 2018 12:08:15 +0530	[thread overview]
Message-ID: <20180330063815.GO15443@localhost> (raw)
In-Reply-To: <639b2f0b-eea8-9c68-e9e9-a29238450d5d@linux.intel.com>

Just a note, it helps to trim the context. Pls do so in replies.

On Thu, Mar 29, 2018 at 08:47:28PM -0500, Pierre-Louis Bossart wrote:
> On 3/28/18 4:38 AM, Vinod Koul wrote:

> >+SoundWire stream states
> >+-----------------------
> >+
> >+Below shows the SoundWire stream states and state transition diagram. ::
> >+
> >+	+---------+     +----------+     +----------+     +----------+
> >+	|  ALLOC  +---->|  CONFIG  +---->| PREPARE  +---->|  ENABLE  |
> >+	|  STATE  |     |  STATE   |     |  STATE   |     |  STATE   |
> >+	+---------+     +----------+     +----------+     +----+-----+
> >+	                                                       ^
> >+	                                                       |
> >+	                                                       |
> >+	                                                       v
> >+	         +----------+           +-----------+     +----+-----+
> >+	         |  RELEASE |<----------+ DEPREPARE |<----+  DISABLE |
> >+	         |   STATE  |           |  STATE    |     |  STATE   |
> >+	         +----------+           +-----------+     +----------+
> >+
> >+NOTE: All stream transitions in MIPI Spec are NOT supported by software.
> 
> specifically that there are not transitions between prepare and deprepare.

Okay we can add that.

> While I am at it, didn't I provide feedback that the documentation and code
> confuse states and transitions between the states?

> Also there is a
> connection between released and allocated, this state machine isn't really
> working or representative of what the code does initially.

When we allocate sdw_stream_runtime, the initial state of the stream
would be garbage/NULL. It is initialized to ALLOC at that time.

        stream = kzalloc(sizeof(*stream), GFP_KERNEL);
        if (!stream)
                return NULL;

        stream->name = stream_name;
        stream->state = SDW_STREAM_ALLOC;

One can argue that we use kzalloc so we are in RELEASE, but I think that is
bike shedding. The lifetime of stream starts with ALLOC and ends at RELEASE
and we freeup the data structure. So I don't think there is a relation
between ALLOC and RELEASE. Any attempt to make such a relation would confuse
folks!

> See my feedback dated February 26 on the previous version.
> 
> "the name of the states are equivalent to an action. It would be more
> consistent to e.g. have an ENABLED state reached after an
> sdw_stream_enable() function.
> 
> same with sdw_stream_prepared leading to the PREPARED state. I think it's
> how most standards or state machine designs are defined (and how English
> grammar works as well)." ALSA also uses OPEN, PREPARED, PAUSED, see asound.h

Hmmm after immersing in bunch of English literature we finally figured
that wrapped logic here that out stream states shall be named as not action.
Well that could have possibly be communicated in plain speak too :D

No worries, will change the state names aptly.

-- 
~Vinod

  reply	other threads:[~2018-03-30  6:34 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28  9:38 [PATCH 00/13] soundwire: Add stream support Vinod Koul
2018-03-28  9:38 ` [PATCH 01/13] soundwire: Add more documentation Vinod Koul
2018-03-30  1:47   ` Pierre-Louis Bossart
2018-03-30  6:38     ` Vinod Koul [this message]
2018-03-28  9:38 ` [PATCH 02/13] soundwire: Add support for SoundWire stream management Vinod Koul
2018-03-30  1:57   ` Pierre-Louis Bossart
2018-03-30  6:42     ` Vinod Koul
2018-03-30  6:44       ` Vinod Koul
2018-03-28  9:38 ` [PATCH 03/13] soundwire: Add support for port management Vinod Koul
2018-03-28  9:38 ` [PATCH 04/13] soundwire: Add Master and Slave port programming Vinod Koul
2018-03-28  9:38 ` [PATCH 05/13] soundwire: Add helpers for ports operations Vinod Koul
2018-03-28  9:38 ` [PATCH 06/13] soundwire: Add bank switch routine Vinod Koul
2018-03-28  9:38 ` [PATCH 07/13] soundwire: Add stream configuration APIs Vinod Koul
2018-03-28  9:38 ` [PATCH 08/13] ASoC: Add SoundWire stream programming interface Vinod Koul
2018-03-30  3:05   ` Takashi Sakamoto
2018-03-30  6:03     ` Greg KH
2018-04-02  6:26       ` Takashi Sakamoto
2018-04-03 12:03         ` Takashi Iwai
2018-04-05  5:03           ` Takashi Sakamoto
2018-04-05  6:38             ` Vinod Koul
2018-03-28  9:38 ` [PATCH 09/13] soundwire: Remove cdns_master_ops Vinod Koul
2018-03-28  9:38 ` [PATCH 10/13] soundwire: cdns: Add port routines Vinod Koul
2018-03-28  9:38 ` [PATCH 11/13] soundwire: cdns: Add stream routines Vinod Koul
2018-03-28  9:38 ` [PATCH 12/13] soundwire: intel: Add stream initialization Vinod Koul
2018-03-28  9:38 ` [PATCH 13/13] soundwire: intel: Add audio DAI ops 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=20180330063815.GO15443@localhost \
    --to=vinod.koul@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=patches.audio@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=sanyog.r.kale@intel.com \
    --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.