linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: Anand Moon <linux.amoon@gmail.com>
Cc: "myungjoo.ham@samsung.com" <myungjoo.ham@samsung.com>,
	"Kyungmin Park" <kyungmin.park@samsung.com>,
	"Krzysztof Kozłowski" <k.kozlowski@samsung.com>,
	"Kukjin Kim" <kgene@kernel.org>,
	"Sylwester Nawrocki" <s.nawrocki@samsung.com>,
	"Tomasz Figa" <tomasz.figa@gmail.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Pawel Moll" <pawel.moll@arm.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
	"Kumar Gala" <galak@codeaurora.org>,
	"Russell King" <linux@arm.linux.org.uk>,
	"Markus Reichl" <m.reichl@fivetechno.de>,
	"Tobias Jakobi" <tjakobi@math.uni-bielefeld.de>,
	"inki.dae@samsung.com" <inki.dae@samsung.com>,
	"Linux Kernel" <linux-kernel@vger.kernel.org>,
	"Linux PM list" <linux-pm@vger.kernel.org>,
	"linux-samsung-soc@vger.kernel.org"
	<linux-samsung-soc@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	devicetree <devicetree@vger.kernel.org>
Subject: Re: [PATCH 0/7] PM / devfreq: Add NoCP devfreq-event and support busfreq on exyno5422-odroidxu3
Date: Mon, 11 Apr 2016 11:16:18 +0900	[thread overview]
Message-ID: <570B08F2.50302@samsung.com> (raw)
In-Reply-To: <CAGTfZH2gd5zhr4_JioSXTcpf8Fgu6r_Y9gPOJo-mYGTjAJsFyg@mail.gmail.com>

Hi Anand,

On 2016년 04월 09일 03:24, Chanwoo Choi wrote:
> Hi Anand,
> 
> On Sat, Apr 9, 2016 at 3:11 AM, Anand Moon <linux.amoon@gmail.com> wrote:
>> Hi Chanwoo,
>>

[snip]

>>>
>>
>> I am observing following deadlock. Both on Odroid U3 and Odroid XU4.
> 
> Thanks for your test. I'll test it again and fix it.

This possible recursive locking is fixed with following diff:

Thanks for your report. I'll fix it on next patchset[1] (v9).
[1] https://lkml.org/lkml/2016/4/8/14


diff --git a/drivers/devfreq/governor_passive.c b/drivers/devfreq/governor_passive.c
index 28a9ae32d330..a4b0b02ee797 100644
--- a/drivers/devfreq/governor_passive.c
+++ b/drivers/devfreq/governor_passive.c
@@ -102,7 +102,7 @@ static int update_devfreq_passive(struct devfreq *devfreq, unsigned long freq)
        if (!devfreq->governor)
                return -EINVAL;
 
-       mutex_lock(&devfreq->lock);
+       mutex_lock_nested(&devfreq->lock, SINGLE_DEPTH_NESTING);
 
        ret = devfreq->governor->get_target_freq(devfreq, &freq);
        if (ret < 0)

Best Regards,
Chanwoo Choi

> 
>>
>> [    7.718372] [ INFO: possible recursive locking detected ]
>> [    7.723747] 4.6.0-rc2-xu4ml #4 Not tainted
>> [    7.727817] ---------------------------------------------
>> [    7.733190] kworker/u16:1/136 is trying to acquire lock:
>> [    7.738476]  (&devfreq->lock){+.+.+.}, at: [<c05be41c>]
>> update_devfreq_passive+0x2c/0x88
>> [    7.746534]
>> [    7.746534] but task is already holding lock:
>> [    7.752339]  (&devfreq->lock){+.+.+.}, at: [<c05bd838>]
>> devfreq_monitor+0x1c/0x78
>> [    7.759791]
>> [    7.759791] other info that might help us debug this:
>> [    7.766291]  Possible unsafe locking scenario:
>> [    7.766291]
>> [    7.766307] usb 5-1: new high-speed USB device number 2 using xhci-hcd
>> [    7.778682]        CPU0
>> [    7.781107]        ----
>> [    7.783533]   lock(&devfreq->lock);
>> [    7.786999]   lock(&devfreq->lock);
>> [    7.790467]
>> [    7.790467]  *** DEADLOCK ***
>> [    7.790467]
>> [    7.796359]  May be due to missing lock nesting notation
>> [    7.796359]
>> [    7.803120] 4 locks held by kworker/u16:1/136:
>> [    7.807537]  #0:  ("%s"("devfreq_wq")){.+.+..}, at: [<c013b41c>]
>> process_one_work+0x13c/0x454
>> [    7.816029]  #1:  ((&(&devfreq->work)->work)){+.+...}, at:
>> [<c013b41c>] process_one_work+0x13c/0x454
>> [    7.825128]  #2:  (&devfreq->lock){+.+.+.}, at: [<c05bd838>]
>> devfreq_monitor+0x1c/0x78
>> [    7.833013]  #3:  (&nh->srcu){......}, at: [<c014309c>]
>> __srcu_notifier_call_chain+0x54/0xe0
>> [    7.841419]
>> [    7.841419] stack backtrace:
>> [    7.845758] CPU: 1 PID: 136 Comm: kworker/u16:1 Not tainted
>> 4.6.0-rc2-xu4ml #4
>> [    7.852946] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
>> [    7.859017] Workqueue: devfreq_wq devfreq_monitor
>> [    7.863717] [<c010eb48>] (unwind_backtrace) from [<c010b884>]
>> (show_stack+0x10/0x14)
>> [    7.871417] [<c010b884>] (show_stack) from [<c037715c>]
>> (dump_stack+0xa4/0xd0)
>> [    7.878613] [<c037715c>] (dump_stack) from [<c017112c>]
>> (__lock_acquire+0x1ce8/0x207c)
>> [    7.886492] [<c017112c>] (__lock_acquire) from [<c0172010>]
>> (lock_acquire+0x90/0xd4)
>> [    7.892726] usb 5-1: New USB device found, idVendor=0bda, idProduct=8153
>> [    7.892737] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=6
>> [    7.892745] usb 5-1: Product: USB 10/100/1000 LAN
>> [    7.892753] usb 5-1: Manufacturer: Realtek
>> [    7.892761] usb 5-1: SerialNumber: 000001000000
>> [    7.921248] [<c0172010>] (lock_acquire) from [<c075d298>]
>> (mutex_lock_nested+0x78/0x4ec)
>> [    7.929301] [<c075d298>] (mutex_lock_nested) from [<c05be41c>]
>> (update_devfreq_passive+0x2c/0x88)
>> [    7.938138] [<c05be41c>] (update_devfreq_passive) from [<c05be4c0>]
>> (devfreq_passive_notifier_call+0x48/0x50)
>> [    7.948016] [<c05be4c0>] (devfreq_passive_notifier_call) from
>> [<c0142d84>] (notifier_call_chain+0x54/0xa4)
>> [    7.957633] [<c0142d84>] (notifier_call_chain) from [<c01430e0>]
>> (__srcu_notifier_call_chain+0x98/0xe0)
>> [    7.966991] [<c01430e0>] (__srcu_notifier_call_chain) from
>> [<c0143140>] (srcu_notifier_call_chain+0x18/0x20)
>> [    7.976783] [<c0143140>] (srcu_notifier_call_chain) from
>> [<c05bd774>] (update_devfreq+0xe4/0x18c)
>> [    7.985622] [<c05bd774>] (update_devfreq) from [<c05bd840>]
>> (devfreq_monitor+0x24/0x78)
>> [    7.993595] [<c05bd840>] (devfreq_monitor) from [<c013b48c>]
>> (process_one_work+0x1ac/0x454)
>> [    8.001913] [<c013b48c>] (process_one_work) from [<c013b784>]
>> (worker_thread+0x50/0x508)
>> [    8.009976] [<c013b784>] (worker_thread) from [<c0141cf4>]
>> (kthread+0xf8/0x110)
>> [    8.017254] [<c0141cf4>] (kthread) from [<c0107750>]
>> (ret_from_fork+0x14/0x24)
>>
>> Best Regards
>> -Anand Moon
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

  reply	other threads:[~2016-04-11  2:16 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-08  5:00 [PATCH 0/7] PM / devfreq: Add NoCP devfreq-event and support busfreq on exyno5422-odroidxu3 Chanwoo Choi
2016-04-08  5:00 ` [PATCH 1/7] PM / devfreq: event: Add new Exynos NoC probe driver Chanwoo Choi
2016-04-12  8:07   ` Krzysztof Kozlowski
2016-04-15  5:13     ` Chanwoo Choi
2016-04-08  5:00 ` [PATCH 2/7] PM / devfreq: exynos: Add the detailed correlation for Exynos5422 bus Chanwoo Choi
2016-04-11 15:45   ` Rob Herring
2016-04-15  6:08     ` Chanwoo Choi
2016-04-08  5:00 ` [PATCH 3/7] ARM: dts: Add NoC Probe dt node for Exynos542x SoC Chanwoo Choi
2016-04-12  8:14   ` Krzysztof Kozlowski
2016-04-14  5:48     ` Chanwoo Choi
2016-04-08  5:00 ` [PATCH 4/7] dt-bindings: clock: Add the clock id for ACLK clock of " Chanwoo Choi
2016-04-12 11:29   ` Krzysztof Kozlowski
2016-04-08  5:00 ` [PATCH 5/7] clk: samsung: exynos542x: Add the clock id for ACLK Chanwoo Choi
2016-04-12 11:25   ` Krzysztof Kozlowski
2016-04-13  6:20     ` Tomasz Figa
2016-04-14  6:28       ` Chanwoo Choi
2016-04-08  5:00 ` [PATCH 6/7] ARM: dts: Add bus nodes using VDD_INT for Exynos542x SoC Chanwoo Choi
2016-04-12 10:53   ` Krzysztof Kozlowski
2016-04-13 23:16     ` Chanwoo Choi
2016-04-08  5:00 ` [PATCH 7/7] ARM: dts: Add support of Bus frequency using VDD_INT for exynos5422-odroidxu3 Chanwoo Choi
2016-04-12 10:59   ` Krzysztof Kozlowski
2016-04-13 23:14     ` Chanwoo Choi
2016-04-08 12:55 ` [PATCH 0/7] PM / devfreq: Add NoCP devfreq-event and support busfreq on exyno5422-odroidxu3 Markus Reichl
2016-04-08 18:25   ` Chanwoo Choi
2016-04-08 18:11 ` Anand Moon
2016-04-08 18:24   ` Chanwoo Choi
2016-04-11  2:16     ` Chanwoo Choi [this message]
2016-04-11  4:01       ` Anand Moon
2016-04-11  4:03         ` Chanwoo Choi
2016-04-11  4:15 ` Chanwoo Choi

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=570B08F2.50302@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=inki.dae@samsung.com \
    --cc=k.kozlowski@samsung.com \
    --cc=kgene@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux.amoon@gmail.com \
    --cc=linux@arm.linux.org.uk \
    --cc=m.reichl@fivetechno.de \
    --cc=mark.rutland@arm.com \
    --cc=myungjoo.ham@samsung.com \
    --cc=pawel.moll@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=robh+dt@kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=tjakobi@math.uni-bielefeld.de \
    --cc=tomasz.figa@gmail.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).