linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Naresh Kamboju <naresh.kamboju@linaro.org>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: David Collins <collinsd@codeaurora.org>,
	Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	Linux Samsung SOC <linux-samsung-soc@vger.kernel.org>,
	lkft-triage@lists.linaro.org
Subject: Re: [PATCH] regulator: core: avoid regulator_resolve_supply() race condition
Date: Mon, 18 Jan 2021 17:11:05 +0530	[thread overview]
Message-ID: <CA+G9fYunK_2h3-pHtZT_+56Xf8b=M-8Q9GnTsCJ3KxVaJULorA@mail.gmail.com> (raw)
In-Reply-To: <e512ee85-7fa6-e5fe-eb30-f088bb83cf23@samsung.com>

Hi,

On Wed, 13 Jan 2021 at 03:21, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
>
> Hi,
>

<trim>

>
> This patch landed in linux next-20210112 as commit eaa7995c529b
> ("regulator: core: avoid regulator_resolve_supply() race condition"). I
> found that it triggers a following lockdep warning during the DWC3
> driver registration on some Exynos based boards (this log is from
> Samsung Exynos5420-based Peach-Pit board):
>
> ======================================================
> WARNING: possible circular locking dependency detected
> 5.11.0-rc1-00008-geaa7995c529b #10095 Not tainted
> ------------------------------------------------------
> swapper/0/1 is trying to acquire lock:
> c12e1b80 (regulator_list_mutex){+.+.}-{3:3}, at:
> regulator_lock_dependent+0x4c/0x2b0
>
> but task is already holding lock:
> df7190c0 (regulator_ww_class_mutex){+.+.}-{3:3}, at:
> regulator_resolve_supply+0x44/0x318

LKFT testing also found this lockdep warning on
arm64 - hi6220-hikey while booting.

[    0.635532] WARNING: possible recursive locking detected
[    0.635558] 5.11.0-rc3-next-20210118 #1 Not tainted
[    0.635585] --------------------------------------------
[    0.635611] swapper/0/1 is trying to acquire lock:
[    0.635636] ffff000000a13158
(regulator_ww_class_mutex){+.+.}-{3:3}, at:
regulator_lock_recursive+0x9c/0x1e8
[    0.635721]
[    0.635721] but task is already holding lock:
[    0.635749] ffff000000a13958
(regulator_ww_class_mutex){+.+.}-{3:3}, at:
regulator_resolve_supply+0x70/0x2f0
[    0.635817]
[    0.635817] other info that might help us debug this:
[    0.635847]  Possible unsafe locking scenario:
[    0.635847]
[    0.635875]        CPU0
[    0.635892]        ----
[    0.635909]   lock(regulator_ww_class_mutex);
[    0.635942]   lock(regulator_ww_class_mutex);
[    0.635974]
[    0.635974]  *** DEADLOCK ***
[    0.635974]
[    0.636002]  May be due to missing lock nesting notation
[    0.636002]
[    0.636033] 4 locks held by swapper/0/1:
[    0.636057]  #0: ffff000000a02988 (&dev->mutex){....}-{3:3}, at:
__device_driver_lock+0x38/0x70
[    0.636131]  #1: ffff000000a13958
(regulator_ww_class_mutex){+.+.}-{3:3}, at:
regulator_resolve_supply+0x70/0x2f0
[    0.636205]  #2: ffff800012b102c0
(regulator_list_mutex){+.+.}-{3:3}, at:
regulator_lock_dependent+0x5c/0x290
[    0.636280]  #3: ffff8000137e3918
(regulator_ww_class_acquire){+.+.}-{0:0}, at:
regulator_enable+0x40/0xe0
[    0.636352]
[    0.636352] stack backtrace:
[    0.636378] CPU: 0 PID: 1 Comm: swapper/0 Not tainted
5.11.0-rc3-next-20210118 #1
[    0.636415] Hardware name: HiKey Development Board (DT)
[    0.636443] Call trace:
[    0.636460]  dump_backtrace+0x0/0x1f0
[    0.636490]  show_stack+0x2c/0x80
[    0.636516]  dump_stack+0xf8/0x160
[    0.636543]  __lock_acquire+0xa3c/0x1718
[    0.636571]  lock_acquire+0x3d8/0x4f0
[    0.636596]  __ww_mutex_lock.constprop.14+0xbc/0xf68
[    0.636628]  ww_mutex_lock+0x6c/0x3e8
[    0.636653]  regulator_lock_recursive+0x9c/0x1e8
[    0.636683]  regulator_lock_dependent+0x198/0x290
[    0.636713]  regulator_enable+0x40/0xe0
[    0.636739]  regulator_resolve_supply+0x1e8/0x2f0
[    0.636767]  regulator_register_resolve_supply+0x24/0x80
[    0.636797]  class_for_each_device+0x78/0xf8
[    0.636825]  regulator_register+0x840/0xbb0
[    0.636851]  devm_regulator_register+0x50/0xa8
[    0.636879]  reg_fixed_voltage_probe+0x224/0x410
[    0.636908]  platform_probe+0x6c/0xd8
[    0.636932]  really_probe+0x2b8/0x520
[    0.636960]  driver_probe_device+0xf4/0x168
[    0.636988]  device_driver_attach+0x74/0x98
[    0.637014]  __driver_attach+0xc4/0x178
[    0.637039]  bus_for_each_dev+0x84/0xd8
[    0.637066]  driver_attach+0x30/0x40
[    0.637092]  bus_add_driver+0x170/0x258
[    0.637119]  driver_register+0x64/0x118
[    0.637144]  __platform_driver_register+0x34/0x40
[    0.637172]  regulator_fixed_voltage_init+0x20/0x28
[    0.637205]  do_one_initcall+0x94/0x4a0
[    0.637231]  kernel_init_freeable+0x2f0/0x344
[    0.637261]  kernel_init+0x18/0x120

Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>

Full boot log here:
https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20210118/testrun/3771538/suite/linux-log-parser/test/check-kernel-warning-2159912/log

metadata:
  git branch: master
  git repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
  git describe: next-20210112
  kernel-config:
http://snapshots.linaro.org/openembedded/lkft/lkft/sumo/hikey/lkft/linux-next/935/config


-- 
Linaro LKFT
https://lkft.linaro.org

  reply	other threads:[~2021-01-18 18:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08  1:16 [PATCH] regulator: core: avoid regulator_resolve_supply() race condition David Collins
2021-01-11 16:28 ` Mark Brown
     [not found] ` <CGME20210112213419eucas1p24231e4d0ac11c31184f2f8f3f20cbd9d@eucas1p2.samsung.com>
2021-01-12 21:34   ` Marek Szyprowski
2021-01-18 11:41     ` Naresh Kamboju [this message]
2021-01-18 20:49     ` Mark Brown
2021-01-21  9:41       ` Marek Szyprowski
2021-01-21 15:44         ` Mark Brown
2021-01-21 20:30           ` Marek Szyprowski
2021-01-23  1:54             ` David Collins
2021-03-01 19:59 ` patchwork-bot+linux-arm-msm

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='CA+G9fYunK_2h3-pHtZT_+56Xf8b=M-8Q9GnTsCJ3KxVaJULorA@mail.gmail.com' \
    --to=naresh.kamboju@linaro.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=broonie@kernel.org \
    --cc=collinsd@codeaurora.org \
    --cc=krzk@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=lkft-triage@lists.linaro.org \
    --cc=m.szyprowski@samsung.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 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).