From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753244AbaKLBVd (ORCPT ); Tue, 11 Nov 2014 20:21:33 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:58493 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753205AbaKLBV3 (ORCPT ); Tue, 11 Nov 2014 20:21:29 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown , Jaehoon Chung , Ben Dooks , Bartlomiej Zolnierkiewicz , Kyungmin Park , Ulf Hansson Subject: [PATCH 3.17 044/319] mmc: sdhci-s3c: fix runtime PM handling on sdhci_add_host() failure Date: Wed, 12 Nov 2014 10:13:02 +0900 Message-Id: <20141112010959.964910083@linuxfoundation.org> X-Mailer: git-send-email 2.1.3 In-Reply-To: <20141112010952.553519040@linuxfoundation.org> References: <20141112010952.553519040@linuxfoundation.org> User-Agent: quilt/0.63-1 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bartlomiej Zolnierkiewicz commit 221414db1934c1c883501998f510bb75acfbaa51 upstream. Runtime Power Management handling for the sdhci_add_host() failure case in sdhci_s3c_probe() should match the code in sdhci_s3c_remove() (which uses pm_runtime_disable() call which matches the earlier pm_runtime_enable() one). Fix it. This patch fixes "BUG: spinlock bad magic on CPU#0, swapper/0/1" and "Unbalanced pm_runtime_enable!" warnings. >>From the kernel log: ... [ 1.659631] s3c-sdhci 12530000.sdhci: sdhci_add_host() failed [ 1.665096] BUG: spinlock bad magic on CPU#0, swapper/0/1 [ 1.670433] lock: 0xea01e484, .magic: 00000000, .owner: /-1, .owner_cpu: 0 [ 1.677895] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.16.0-next-20140804-00008-ga59480f-dirty #707 [ 1.687037] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 1.694740] [] (show_stack) from [] (dump_stack+0x68/0xb8) [ 1.701948] [] (dump_stack) from [] (do_raw_spin_lock+0x15c/0x1a4) [ 1.709848] [] (do_raw_spin_lock) from [] (_raw_spin_lock_irqsave+0x20/0x28) [ 1.718619] [] (_raw_spin_lock_irqsave) from [] (sdhci_do_set_ios+0x1c/0x5cc) [ 1.727464] [] (sdhci_do_set_ios) from [] (sdhci_runtime_resume_host+0x50/0x104) [ 1.736574] [] (sdhci_runtime_resume_host) from [] (pm_generic_runtime_resume+0x2c/0x40) [ 1.746383] [] (pm_generic_runtime_resume) from [] (__rpm_callback+0x34/0x70) [ 1.755233] [] (__rpm_callback) from [] (rpm_callback+0x28/0x88) [ 1.762958] [] (rpm_callback) from [] (rpm_resume+0x384/0x4ec) [ 1.770511] [] (rpm_resume) from [] (pm_runtime_forbid+0x58/0x64) [ 1.778325] [] (pm_runtime_forbid) from [] (sdhci_s3c_probe+0x4a4/0x540) [ 1.786749] [] (sdhci_s3c_probe) from [] (platform_drv_probe+0x2c/0x5c) [ 1.795076] [] (platform_drv_probe) from [] (driver_probe_device+0x114/0x234) [ 1.803929] [] (driver_probe_device) from [] (__driver_attach+0x8c/0x90) [ 1.812347] [] (__driver_attach) from [] (bus_for_each_dev+0x54/0x88) [ 1.820506] [] (bus_for_each_dev) from [] (bus_add_driver+0xd8/0x1cc) [ 1.828665] [] (bus_add_driver) from [] (driver_register+0x78/0xf4) [ 1.836652] [] (driver_register) from [] (do_one_initcall+0x80/0x1d0) [ 1.844816] [] (do_one_initcall) from [] (kernel_init_freeable+0x108/0x1d4) [ 1.853503] [] (kernel_init_freeable) from [] (kernel_init+0x8/0xe4) [ 1.861568] [] (kernel_init) from [] (ret_from_fork+0x14/0x3c) [ 1.869582] platform 12530000.sdhci: Driver s3c-sdhci requests probe deferral ... [ 1.997047] s3c-sdhci 12530000.sdhci: Unbalanced pm_runtime_enable! ... [ 2.027235] s3c-sdhci 12530000.sdhci: sdhci_add_host() failed [ 2.032884] platform 12530000.sdhci: Driver s3c-sdhci requests probe deferral ... Tested on Hardkernel's Exynos4412 based ODROID-U3 board. Fixes: 9f4e8151dbbc ("mmc: sdhci-s3c: Enable runtime power management") Cc: Mark Brown Cc: Jaehoon Chung Cc: Ben Dooks Signed-off-by: Bartlomiej Zolnierkiewicz Acked-by: Kyungmin Park Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci-s3c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c @@ -606,8 +606,6 @@ static int sdhci_s3c_probe(struct platfo ret = sdhci_add_host(host); if (ret) { dev_err(dev, "sdhci_add_host() failed\n"); - pm_runtime_forbid(&pdev->dev); - pm_runtime_get_noresume(&pdev->dev); goto err_req_regs; } @@ -618,6 +616,8 @@ static int sdhci_s3c_probe(struct platfo return 0; err_req_regs: + pm_runtime_disable(&pdev->dev); + err_no_busclks: clk_disable_unprepare(sc->clk_io);