From patchwork Mon Apr 11 02:16:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 8796001 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D5FEFC0553 for ; Mon, 11 Apr 2016 02:27:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E175B20254 for ; Mon, 11 Apr 2016 02:27:28 +0000 (UTC) Received: from bombadil.infradead.org (unknown [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AF57B20268 for ; Mon, 11 Apr 2016 02:27:23 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1apRPX-0000DI-U1; Mon, 11 Apr 2016 02:17:07 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1apRPU-00008w-Nr for linux-arm-kernel@lists.infradead.org; Mon, 11 Apr 2016 02:17:05 +0000 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O5G00WG26B75B90@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 11 Apr 2016 11:16:19 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.112]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id AA.2A.04785.3F80B075; Mon, 11 Apr 2016 11:16:19 +0900 (KST) X-AuditID: cbfee68e-f79d96d0000012b1-71-570b08f3003b Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id CC.52.06699.3F80B075; Mon, 11 Apr 2016 11:16:19 +0900 (KST) MIME-version: 1.0 Received: from [10.113.62.212] by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O5G005U36B63930@mmp2.samsung.com>; Mon, 11 Apr 2016 11:16:19 +0900 (KST) Message-id: <570B08F2.50302@samsung.com> Date: Mon, 11 Apr 2016 11:16:18 +0900 From: Chanwoo Choi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 To: Anand Moon Subject: Re: [PATCH 0/7] PM / devfreq: Add NoCP devfreq-event and support busfreq on exyno5422-odroidxu3 References: <1460091646-28701-1-git-send-email-cw00.choi@samsung.com> In-reply-to: X-Brightmail-Tracker: H4sIAAAAAAAAA02Sa0iTYRiGe/cd9m0pvC6nr+sEg1KMLOestwPmz0+kAxoUGumyD610jk2j orJabWRlVtJk2BGrbVnSkkrTsjVL8pC2NM8VmizdD2MVK83aoch/N8/hvp4bHoYQVVISZpey gFMrFblSWkhWhcpVS93M7C3L3dol+Iq9ncJnXdco3D5mBvj8+1ISjztj8dnhcQK3HXPxsXW4 m8KOugoau8/YAS5//YSH797r4+N+RzD+bPcAfONdJw/3HzXRuNRwh8StLW8ofKLBzsfPXXoK 625PUNhSNwUSw9iqy1WAPa49TbOOkjM8tm+giK01DvJZ862vNGu1nKTZ+5VF7PQLPlvTpSfZ khoLYN3WBZuC0oRrd3K5u/Zy6mUJmcKc0Y9aQlURvU83eIl3BDyUFgMBg6AcXT86QQR0GOoY qqaLgZARQRNAJ08biH9DTY1XeYGGEaC3n3poXyMYhiDPhSGyGDAMASNRWVmer0zAUNT+fZIO 6CXo5rVxIrD7AaDf9if8wG4Uanv2k/RpEi5Cg9o+v6ZhNHrq9PkzjBhuRaea9/vKoXCxF2ui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+Aq2VlggS2LloYusEAsuM0pMewIxiFMgWOL3j3vM ExiBrkQ4bxbCebMQzlvAyLyKUSK1ILmgOCk91ygvtVyvODG3uDQvXS85P3cTIzhRPZPewXh4 l/shRgEORiUe3heXucKFWBPLiitzDzFKcDArifD2snGHC/GmJFZWpRblxxeV5qQWH2I0Bfpv IrOUaHI+MInmlcQbGpuYGVkamRtaGBmbK4nzPv6/LkxIID2xJDU7NbUgtQimj4mDU6qB0fHG z9CcoJojjSbLPcIqbqvIJ6+X39IudKru64aNX3e+38p6zXPJtL//TiRtur6S60HuxKlRkpG3 2aMT10qcqJA5fKx7y4Zjx6LX+O1t+pB4tjpgqbPPfmG9woMx19pdXhl/NXsdsra48cu25vty Uqlqqfy/5866em+eRNTL0+ymW+RMlszkm6TEUpyRaKjFXFScCADT+VPJagMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160410_191704_930012_3606C61B X-CRM114-Status: GOOD ( 24.50 ) X-Spam-Score: -7.9 (-------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , "inki.dae@samsung.com" , =?UTF-8?B?S3J6eXN6dG9mIEtvesWCb3dza2k=?= , "linux-samsung-soc@vger.kernel.org" , Russell King , Pawel Moll , Ian Campbell , devicetree , Linux PM list , "Rafael J. Wysocki" , Tomasz Figa , Rob Herring , Linux Kernel , Markus Reichl , Tobias Jakobi , Kyungmin Park , Kukjin Kim , "myungjoo.ham@samsung.com" , Sylwester Nawrocki , Kumar Gala , linux-arm-kernel Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RDNS_NONE,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Anand, On 2016? 04? 09? 03:24, Chanwoo Choi wrote: > Hi Anand, > > On Sat, Apr 9, 2016 at 3:11 AM, Anand Moon 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 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: [] >> 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 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: [] >> 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=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] [] (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-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 > > Tested-by: Anand Moon 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)