From patchwork Fri May 20 21:20:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 9130065 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6DDC060221 for ; Fri, 20 May 2016 21:19:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62144279C4 for ; Fri, 20 May 2016 21:19:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56E1827CF9; Fri, 20 May 2016 21:19:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=2.0 tests=BAYES_00,FSL_HELO_HOME, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F10FA279C4 for ; Fri, 20 May 2016 21:19:40 +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 1b3rnr-0000Bo-WA; Fri, 20 May 2016 21:17:52 +0000 Received: from cloudserver094114.home.net.pl ([79.96.170.134]) by bombadil.infradead.org with smtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b3rno-0000AZ-D3 for linux-arm-kernel@lists.infradead.org; Fri, 20 May 2016 21:17:49 +0000 Received: from 217.96.255.233.ipv4.supernova.orange.pl (217.96.255.233) (HELO vostro.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer v0.80.2) id ea186e77ea9462fc; Fri, 20 May 2016 23:17:23 +0200 From: "Rafael J. Wysocki" To: Fabio Estevam Subject: Re: Crash after 'reboot' due to 9be4fd2c7723a Date: Fri, 20 May 2016 23:20:59 +0200 Message-ID: <4080948.V5DMHR9bsk@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/4.5.0-rc1+; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160520_141748_644202_C53114D2 X-CRM114-Status: GOOD ( 18.52 ) 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: Russell King , Ping Bai , "linux-pm@vger.kernel.org" , Viresh Kumar , "Rafael J. Wysocki" , Guenter Roeck , Sascha Hauer , Shawn Guo , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Friday, May 20, 2016 03:32:43 PM Fabio Estevam wrote: > On Fri, May 20, 2016 at 3:05 PM, Fabio Estevam wrote: > > Rafael, > > > > Running the 'reboot' command works fine on a 4.5 kernel running on a > > mx6ul platform (ARM single core SoC), but it crashes on 4.6. > > > > Running bisect I got 9be4fd2c7723a3057b0b39676 ("cpufreq: governor: > > Replace timers with utilization update callbacks") as the first bad > > commit. > > > > Below is the output crash log. > > > > Not sure if this issue is related to the problem reported by Guenter here: > > http://lkml.iu.edu/hypermail/linux/kernel/1602.1/06075.html > > > > Any ideas? > > If I rebuilt a kernel with SMP=n then the reboot command works as expected. Does it work if you boot with maxcpus=1 or nosmp in the kernel command line? Also, please try if the appended patch makes any difference. --- drivers/base/core.c | 3 +++ drivers/cpufreq/cpufreq.c | 11 ----------- 2 files changed, 3 insertions(+), 11 deletions(-) Index: linux-pm/drivers/cpufreq/cpufreq.c =================================================================== --- linux-pm.orig/drivers/cpufreq/cpufreq.c +++ linux-pm/drivers/cpufreq/cpufreq.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include @@ -2556,14 +2555,6 @@ int cpufreq_unregister_driver(struct cpu } EXPORT_SYMBOL_GPL(cpufreq_unregister_driver); -/* - * Stop cpufreq at shutdown to make sure it isn't holding any locks - * or mutexes when secondary CPUs are halted. - */ -static struct syscore_ops cpufreq_syscore_ops = { - .shutdown = cpufreq_suspend, -}; - struct kobject *cpufreq_global_kobject; EXPORT_SYMBOL(cpufreq_global_kobject); @@ -2575,8 +2566,6 @@ static int __init cpufreq_core_init(void cpufreq_global_kobject = kobject_create_and_add("cpufreq", &cpu_subsys.dev_root->kobj); BUG_ON(!cpufreq_global_kobject); - register_syscore_ops(&cpufreq_syscore_ops); - return 0; } core_initcall(cpufreq_core_init); Index: linux-pm/drivers/base/core.c =================================================================== --- linux-pm.orig/drivers/base/core.c +++ linux-pm/drivers/base/core.c @@ -10,6 +10,7 @@ * */ +#include #include #include #include @@ -2042,6 +2043,8 @@ void device_shutdown(void) { struct device *dev, *parent; + cpufreq_suspend(); + spin_lock(&devices_kset->list_lock); /* * Walk the devices list backward, shutting down each in turn.