From: Stephen Boyd <sboyd@kernel.org>
To: Naresh Kamboju <naresh.kamboju@linaro.org>,
linux-clk@vger.kernel.org,
open list <linux-kernel@vger.kernel.org>,
Jeffy Chen <jeffy.chen@rock-chips.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
lkft-triage@lists.linaro.org,
Anders Roxell <anders.roxell@linaro.org>,
mturquette@baylibre.com,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Basil Eljuse <Basil.Eljuse@arm.com>
Subject: Re: WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:4156 __clk_put+0xfc/0x130
Date: Mon, 16 Mar 2020 11:12:52 -0700 [thread overview]
Message-ID: <158438237211.88485.8872594504996170580@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <CA+G9fYsTV66+PYY6LqHdjLx1L3i23ubDuWYg0ABoWuLQZTyL+g@mail.gmail.com>
Quoting Naresh Kamboju (2020-03-16 02:05:24)
> The following kernel warning noticed on linux-next on arm64 juno-r2 device.
>
> Linux version 5.6.0-rc5-next-20200316 (TuxBuild@ccdbe23f0d06) (gcc
> version 9.2.1 20191130 (Debian 9.2.1-21)) #1 SMP PREEMPT Mon Mar 16
> 07:40:45 UTC 2020
>
> [ 0.002822] ------------[ cut here ]------------
> [ 0.002840] WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:4156
> __clk_put+0xfc/0x130
> [ 0.002846] Modules linked in:
> [ 0.002859] CPU: 0 PID: 1 Comm: swapper/0 Not tainted
> 5.6.0-rc5-next-20200316 #1
> [ 0.002865] Hardware name: ARM Juno development board (r2) (DT)
> [ 0.002873] pstate: 20000005 (nzCv daif -PAN -UAO)
> [ 0.002882] pc : __clk_put+0xfc/0x130
> [ 0.002891] lr : clk_put+0xc/0x18
Looks like the code is wrong. It calls of_clk_get() and then
unconditionally calls clk_put() on whatever is returned, including an
error pointer which we warn about.
WARN_ON_ONCE(IS_ERR(clk))
in __clk_put().
> [ 0.002896] sp : ffff80001003bba0
> [ 0.002902] x29: ffff80001003bba0 x28: 0000000000000000
> [ 0.002911] x27: 0000000000000000 x26: ffff800011c56000
> [ 0.002919] x25: ffff800011c56490 x24: 0000000000000001
> [ 0.002928] x23: ffff00097effdae8 x22: 0000000000000001
> [ 0.002936] x21: ffff000975cc8000 x20: fffffffffffffdfb
> [ 0.002945] x19: fffffffffffffdfb x18: 0000000000000001
> [ 0.002953] x17: 00000000e80423fd x16: 00000000e66966f2
> [ 0.002961] x15: ffffffffffffffff x14: ffffffffff000000
> [ 0.002970] x13: ffffffffffffffff x12: 0000000000000018
> [ 0.002978] x11: 0000000000000028 x10: 0101010101010101
> [ 0.002987] x9 : ffffffffffffffff x8 : 7f7f7f7f7f7f7f7f
> [ 0.002995] x7 : 6b61ff726b6b6462 x6 : 000000000080636c
> [ 0.003003] x5 : ffff00097eff3d30 x4 : 0000000000000000
> [ 0.003011] x3 : 0000000000000001 x2 : 0000000000000001
> [ 0.003019] x1 : 1989cb6049749c00 x0 : fffffffffffffdfb
> [ 0.003028] Call trace:
> [ 0.003037] __clk_put+0xfc/0x130
> [ 0.003045] clk_put+0xc/0x18
> [ 0.003057] topology_parse_cpu_capacity+0x100/0x180
Looks like Greg picked up this patch[1] as commit b8fe128dad8f
("arch_topology: Adjust initial CPU capacities with current freq") from
the list. Not sure it's correct though and I haven't looked in any more
detail. At least, not calling clk_put() unless it is a valid pointer
will work to quiet this warning.
[1] https://lore.kernel.org/r/20200113034815.25924-1-jeffy.chen@rock-chips.com
next prev parent reply other threads:[~2020-03-16 18:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-16 9:05 WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:4156 __clk_put+0xfc/0x130 Naresh Kamboju
2020-03-16 18:12 ` Stephen Boyd [this message]
2020-03-17 0:18 ` JeffyChen
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=158438237211.88485.8872594504996170580@swboyd.mtv.corp.google.com \
--to=sboyd@kernel.org \
--cc=Basil.Eljuse@arm.com \
--cc=anders.roxell@linaro.org \
--cc=arnd@arndb.de \
--cc=daniel.lezcano@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=jeffy.chen@rock-chips.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkft-triage@lists.linaro.org \
--cc=mturquette@baylibre.com \
--cc=naresh.kamboju@linaro.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).