linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jerome Brunet <jbrunet@baylibre.com>
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	patchwork-bot+notify@kernel.org
Subject: Re: [PATCH v2 2/4] ASoC: hdmi-codec: remove reference to the current substream
Date: Wed, 08 May 2019 10:08:44 +0200	[thread overview]
Message-ID: <fd633a5597703f557d75e43c14213699efe295f0.camel@baylibre.com> (raw)
In-Reply-To: <20190508070058.GQ14916@sirena.org.uk>

On Wed, 2019-05-08 at 16:00 +0900, Mark Brown wrote:
> On Mon, May 06, 2019 at 11:58:13AM +0200, Jerome Brunet wrote:
> 
> > Remove current_substream pointer and replace the exclusive locking
> > mechanism with a simple variable and some atomic operations.
> 
> The advantage of mutexes is that they are very simple and clear to
> reason about.  It is therefore unclear that this conversion to use
> atomic variables is an improvement, they're generally more complex 
> to reason about and fragile.

The point of this patch is not to remove the mutex in favor of atomic
operations

The point was to remove the current_substream pointer in favor of a
simple 'busy' flag. After that, I ended up with a mutex protecting
a flag and it seemed a bit overkill to me. Atomic op seemed like a
good fit for this but I don't really care about that particular
point.

I can put back mutex to protect the flag if you prefer.

Another solution would be to use the mutex as the 'busy' flag.
Get the ownership of the hdmi using try_lock() in startup() and
release it in shutdown()

Would you have a preference Mark ? 



  reply	other threads:[~2019-05-08  8:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-06  9:58 [PATCH v2 0/4] ASoC: hdmi-codec: fixes and improvements Jerome Brunet
2019-05-06  9:58 ` [PATCH v2 1/4] ASoC: hdmi-codec: remove function name debug traces Jerome Brunet
2019-05-08  6:50   ` Mark Brown
2019-05-08  8:08     ` Jerome Brunet
2019-05-08  9:01   ` Applied "ASoC: hdmi-codec: remove function name debug traces" to the asoc tree Mark Brown
2019-05-06  9:58 ` [PATCH v2 2/4] ASoC: hdmi-codec: remove reference to the current substream Jerome Brunet
2019-05-08  7:00   ` Mark Brown
2019-05-08  8:08     ` Jerome Brunet [this message]
2019-05-08  8:57       ` Mark Brown
2019-05-09  8:11         ` Jerome Brunet
2019-05-12  8:27           ` Mark Brown
2019-05-08  9:01   ` Applied "ASoC: hdmi-codec: remove reference to the current substream" to the asoc tree Mark Brown
2019-05-06  9:58 ` [PATCH v2 3/4] ASoC: hdmi-codec: remove reference to the dai drivers in the private data Jerome Brunet
2019-05-08  9:01   ` Applied "ASoC: hdmi-codec: remove reference to the dai drivers in the private data" to the asoc tree Mark Brown
2019-05-06  9:58 ` [PATCH v2 4/4] ASoC: hdmi-codec: remove ops dependency on the dai id Jerome Brunet
2019-05-08  9:01   ` Applied "ASoC: hdmi-codec: remove ops dependency on the dai id" to the asoc tree Mark Brown

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=fd633a5597703f557d75e43c14213699efe295f0.camel@baylibre.com \
    --to=jbrunet@baylibre.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patchwork-bot+notify@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).