From: Stephen Boyd <sboyd@codeaurora.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
linux-clk@vger.kernel.org
Subject: Re: warnings with clk_disable_unprepare()
Date: Thu, 8 Dec 2016 13:18:31 -0800 [thread overview]
Message-ID: <20161208211831.GL5423@codeaurora.org> (raw)
In-Reply-To: <d755ee65-937f-1581-ac74-347b9e4c8d51@linux.intel.com>
On 12/05, Pierre-Louis Bossart wrote:
> Hi,
> In the modified cht-bsw_rt5645 machine driver for Asus X205TA and
> T100HA, I disable the audio mclk with a call to
> clk_disable_unprepare() when I see a SND_SOC_DAPM_EVENT_OFF event in
> the platform_clock_control hook.
>
> For some reason I seem to get multiple SND_SOC_DAPM_EVENT_OFF events
> and the clock framework complains with dmesg warnings that the
> refcount is already zero (which has no functional side effect).
>
> WARNING: CPU: 0 PID: 2002 at drivers/clk/clk.c:476 clk_unprepare+0x1a/0x21
>
> WARNING: CPU: 2 PID: 2095 at drivers/clk/clk.c:594
> clk_core_disable_lock+0x12/0x1b
>
> I could fix this in three different ways:
> - remove multiple SND_SOC_DAPM_EVENT_OFF events (not sure what the
> root cause is, maybe issues with jack detection?)
It would be good to know what the root cause is here before
thinking about doing anything else.
> - call a clk_is_enabled() or clk_refcount() function before calling
> clk_disable_unprepare() (but they don't seem to exist in
> include/linux/clk.h)
> - count the references myself (which does exactly the same as what
> the clk framework already does so it's not terribly elegant)
>
Both of these sound like hacks around the problem of unbalanced
off event calls.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
prev parent reply other threads:[~2016-12-08 21:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-06 0:02 warnings with clk_disable_unprepare() Pierre-Louis Bossart
2016-12-08 21:18 ` Stephen Boyd [this message]
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=20161208211831.GL5423@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=alsa-devel@alsa-project.org \
--cc=linux-clk@vger.kernel.org \
--cc=pierre-louis.bossart@linux.intel.com \
/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.