From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chanwoo Choi 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 Message-ID: <570B08F2.50302@samsung.com> References: <1460091646-28701-1-git-send-email-cw00.choi@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mailout4.samsung.com ([203.254.224.34]:55644 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752026AbcDKCQo convert rfc822-to-8bit (ORCPT ); Sun, 10 Apr 2016 22:16:44 -0400 In-reply-to: Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Anand Moon Cc: "myungjoo.ham@samsung.com" , Kyungmin Park , =?UTF-8?B?S3J6eXN6dG9mIEtvesWCb3dza2k=?= , Kukjin Kim , Sylwester Nawrocki , Tomasz Figa , "Rafael J. Wysocki" , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Russell King , Markus Reichl , Tobias Jakobi , "inki.dae@samsung.com" , Linux Kernel , Linux PM list , "linux-samsung-soc@vger.kernel.org" , linux-arm-kernel Hi Anand, On 2016=EB=85=84 04=EC=9B=94 09=EC=9D=BC 03:24, Chanwoo Choi wrote: > Hi Anand, >=20 > On Sat, Apr 9, 2016 at 3:11 AM, Anand Moon wr= ote: >> Hi Chanwoo, >> [snip] >>> >> >> I am observing following deadlock. Both on Odroid U3 and Odroid XU4. >=20 > 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/gover= nor_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 *d= evfreq, unsigned long freq) if (!devfreq->governor) return -EINVAL; =20 - mutex_lock(&devfreq->lock); + mutex_lock_nested(&devfreq->lock, SINGLE_DEPTH_NESTING); =20 ret =3D devfreq->governor->get_target_freq(devfreq, &freq); if (ret < 0) Best Regards, Chanwoo Choi >=20 >> >> [ 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: [] >> update_devfreq_passive+0x2c/0x88 >> [ 7.746534] >> [ 7.746534] but task is already holding lock: >> [ 7.752339] (&devfreq->lock){+.+.+.}, at: [] >> 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 xhc= i-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: [] >> process_one_work+0x13c/0x454 >> [ 7.816029] #1: ((&(&devfreq->work)->work)){+.+...}, at: >> [] process_one_work+0x13c/0x454 >> [ 7.825128] #2: (&devfreq->lock){+.+.+.}, at: [] >> devfreq_monitor+0x1c/0x78 >> [ 7.833013] #3: (&nh->srcu){......}, at: [] >> __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] [] (unwind_backtrace) from [] >> (show_stack+0x10/0x14) >> [ 7.871417] [] (show_stack) from [] >> (dump_stack+0xa4/0xd0) >> [ 7.878613] [] (dump_stack) from [] >> (__lock_acquire+0x1ce8/0x207c) >> [ 7.886492] [] (__lock_acquire) from [] >> (lock_acquire+0x90/0xd4) >> [ 7.892726] usb 5-1: New USB device found, idVendor=3D0bda, idPro= duct=3D8153 >> [ 7.892737] usb 5-1: New USB device strings: Mfr=3D1, Product=3D2= , SerialNumber=3D6 >> [ 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] [] (lock_acquire) from [] >> (mutex_lock_nested+0x78/0x4ec) >> [ 7.929301] [] (mutex_lock_nested) from [] >> (update_devfreq_passive+0x2c/0x88) >> [ 7.938138] [] (update_devfreq_passive) from [] >> (devfreq_passive_notifier_call+0x48/0x50) >> [ 7.948016] [] (devfreq_passive_notifier_call) from >> [] (notifier_call_chain+0x54/0xa4) >> [ 7.957633] [] (notifier_call_chain) from [] >> (__srcu_notifier_call_chain+0x98/0xe0) >> [ 7.966991] [] (__srcu_notifier_call_chain) from >> [] (srcu_notifier_call_chain+0x18/0x20) >> [ 7.976783] [] (srcu_notifier_call_chain) from >> [] (update_devfreq+0xe4/0x18c) >> [ 7.985622] [] (update_devfreq) from [] >> (devfreq_monitor+0x24/0x78) >> [ 7.993595] [] (devfreq_monitor) from [] >> (process_one_work+0x1ac/0x454) >> [ 8.001913] [] (process_one_work) from [] >> (worker_thread+0x50/0x508) >> [ 8.009976] [] (worker_thread) from [] >> (kthread+0xf8/0x110) >> [ 8.017254] [] (kthread) from [] >> (ret_from_fork+0x14/0x24) >> >> Best Regards >> -Anand Moon >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-sams= ung-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-samsu= ng-soc" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >=20 >=20