From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>, vkoul@kernel.org
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
Sanyog Kale <sanyog.r.kale@intel.com>
Subject: Re: [alsa-devel] [PATCH v2] soundwire: stream: fix bad unlock balance
Date: Thu, 6 Jun 2019 09:28:25 -0500 [thread overview]
Message-ID: <9427a73a-e09a-4a9c-7690-271d2e2e1024@linux.intel.com> (raw)
In-Reply-To: <20190606112222.16502-1-srinivas.kandagatla@linaro.org>
On 6/6/19 6:22 AM, Srinivas Kandagatla wrote:
> multi bank switching code takes lock on condition but releases without
> any check resulting in below warning.
> This patch fixes this.
Question to make sure we are talking about the same thing: multi-link
bank switching is a capability beyond the scope of the SoundWire spec
which requires hardware support to synchronize links and as Sanyog
hinted at in a previous email follow a different flow for bank switches.
You would not use the multi-link mode if you have different links that
can operate independently and have no synchronization requirement. You
would conversely use the multi-link mode if you have two devices on the
same type on different links and want audio to be rendered at the same time.
Can you clarify if indeed you were using the full-blown multi-link mode
with hardware synchronization or a regular single-link operation? I am
not asking for details of your test hardware, just trying to reconstruct
the program flow leading to this problem.
It could also be that your commit message was meant to say:
"the msg lock is taken for multi-link cases only but released
unconditionally, leading to an unlock balance warning for single-link
usages"?
Thanks!
>
> =====================================
> WARNING: bad unlock balance detected!
> 5.1.0-16506-gc1c383a6f0a2-dirty #1523 Tainted: G W
> -------------------------------------
> aplay/2954 is trying to release lock (&bus->msg_lock) at:
> do_bank_switch+0x21c/0x480
> but there are no more locks to release!
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
> drivers/soundwire/stream.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c
> index ce9cb7fa4724..73c52cd4fec8 100644
> --- a/drivers/soundwire/stream.c
> +++ b/drivers/soundwire/stream.c
> @@ -814,7 +814,8 @@ static int do_bank_switch(struct sdw_stream_runtime *stream)
> goto error;
> }
>
> - mutex_unlock(&bus->msg_lock);
> + if (bus->multi_link)
> + mutex_unlock(&bus->msg_lock);
> }
>
> return ret;
>
next prev parent reply other threads:[~2019-06-06 14:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-06 11:22 [PATCH v2] soundwire: stream: fix bad unlock balance Srinivas Kandagatla
2019-06-06 14:28 ` Pierre-Louis Bossart [this message]
2019-06-06 14:58 ` [alsa-devel] " Srinivas Kandagatla
2019-06-06 15:36 ` Pierre-Louis Bossart
2019-06-06 17:07 ` Sanyog Kale
2019-06-06 17:18 ` 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=9427a73a-e09a-4a9c-7690-271d2e2e1024@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sanyog.r.kale@intel.com \
--cc=srinivas.kandagatla@linaro.org \
--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