[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fd633a5597703f557d75e43c14213699efe295f0.camel@baylibre.com>
Date: Wed, 08 May 2019 10:08:44 +0200
From: Jerome Brunet <jbrunet@...libre.com>
To: Mark Brown <broonie@...nel.org>
Cc: Liam Girdwood <lgirdwood@...il.com>, alsa-devel@...a-project.org,
linux-kernel@...r.kernel.org, patchwork-bot+notify@...nel.org
Subject: Re: [PATCH v2 2/4] ASoC: hdmi-codec: remove reference to the
current substream
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 ?
Powered by blists - more mailing lists