From patchwork Fri Sep 14 09:08:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chander Kashyap X-Patchwork-Id: 11410 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 31BED23E41 for ; Fri, 14 Sep 2012 09:09:59 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 9A30BA32EA9 for ; Fri, 14 Sep 2012 09:09:58 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id k11so6203860iea.11 for ; Fri, 14 Sep 2012 02:09:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=qWY5YtMviXe59IBwWUTilFdWjal3eBz8+k9urRHD11Q=; b=aufZmY+fEo0FaWR1Sc5D5Id+otlMjg7VaVBI/xTHJ2OwqY0XntlEXFcYFsHGOeo+wl KH3F2aVofsws62qiK4Ok2Z7nbCHlRal7jjs7Fk7SrgR5WOC17ZXwaNnSp8i1JE2JVX5z e1z8Q8RAFwPpzs4wgvQGYu3ss+2X1q5Vlz+OveuHlm5XMMdS0SezIjNBgsxz4Egy2Z8i 5gz53e4EX2iG7PChH8UjGdK7i9tIBc6vRkdt81YCxxgC4IB7p+F6V5e5SnCqr9uKcQXV Uaq3OdIRtegaxUj2EPSnET2yXj7YgMlhoH/SrumzkEXRj0v6+/a0pECEMDJRZ7L969Uy nUkA== Received: by 10.50.191.227 with SMTP id hb3mr20168769igc.43.1347613798395; Fri, 14 Sep 2012 02:09:58 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp178479igc; Fri, 14 Sep 2012 02:09:57 -0700 (PDT) Received: by 10.68.224.71 with SMTP id ra7mr4323049pbc.154.1347613797703; Fri, 14 Sep 2012 02:09:57 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id qs7si1890734pbc.312.2012.09.14.02.09.57 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 14 Sep 2012 02:09:57 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of chander.kashyap@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of chander.kashyap@linaro.org) smtp.mail=chander.kashyap@linaro.org Received: by mail-pb0-f50.google.com with SMTP id md12so6121145pbc.37 for ; Fri, 14 Sep 2012 02:09:57 -0700 (PDT) Received: by 10.68.189.193 with SMTP id gk1mr4346470pbc.123.1347613797437; Fri, 14 Sep 2012 02:09:57 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id qo8sm683031pbb.19.2012.09.14.02.09.53 (version=SSLv3 cipher=OTHER); Fri, 14 Sep 2012 02:09:57 -0700 (PDT) From: Chander Kashyap To: linux-mmc@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: cjb@laptop.org, ben@simtec.co.uk, broonie@opensource.wolfsonmicro.com, kgene.kim@samsung.com, girish.shivananjappa@linaro.org, patches@linaro.org, Chander Kashyap Subject: [PATCH 2/3] mmc: sdhci-s3c: Fix crash on module insertion for second time Date: Fri, 14 Sep 2012 14:38:50 +0530 Message-Id: <1347613731-29428-3-git-send-email-chander.kashyap@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1347613731-29428-1-git-send-email-chander.kashyap@linaro.org> References: <1347613731-29428-1-git-send-email-chander.kashyap@linaro.org> X-Gm-Message-State: ALoCoQl5f+pkG7w0cwv8D6mJHWgH/Qwi4vEuM+Kzx0+GFw5OAHtgVgV3NCCHmxrt5lPSpSwgck6+ If sdhci-s3c driver is built as module, it gives following error if inserted again after removing. This was happening as pm_runtime_use_autosuspend() is called in sdhci_s3c_probe() function but in sdhci_s3c_remove() its complementry pm_runtime_dont_use_autosuspend() is not called. BUG: spinlock bad magic on CPU#1, insmod/955 lock: 0xee771368, .magic: 00000000, .owner: insmod/955, .owner_cpu: 1 [] (unwind_backtrace+0x0/0xf8) from [] (do_raw_spin_unlock+0xa4/0xe4) [] (do_raw_spin_unlock+0xa4/0xe4) from [] (_raw_spin_unlock_irqrestore+0xc/0x38) [] (_raw_spin_unlock_irqrestore+0xc/0x38) from [] (sdhci_runtime_suspend_host+0x54/0x80) [] (sdhci_runtime_suspend_host+0x54/0x80) from [] (sdhci_s3c_runtime_suspend+0x14/0x38 [sdhci_s3c]) [] (sdhci_s3c_runtime_suspend+0x14/0x38 [sdhci_s3c]) from [] (pm_generic_runtime_suspend+0x2c/0x40) [] (pm_generic_runtime_suspend+0x2c/0x40) from [] (__rpm_callback+0x70/0x98) [] (__rpm_callback+0x70/0x98) from [] (rpm_suspend+0xf0/0x534) [] (rpm_suspend+0xf0/0x534) from [] (__pm_runtime_suspend+0x5c/0x74) [] (__pm_runtime_suspend+0x5c/0x74) from [] (pm_generic_runtime_idle+0x44/0x4c) [] (pm_generic_runtime_idle+0x44/0x4c) from [] (__rpm_callback+0x70/0x98) [] (__rpm_callback+0x70/0x98) from [] (rpm_idle+0xdc/0x18c) [] (rpm_idle+0xdc/0x18c) from [] (pm_runtime_set_autosuspend_delay+0x30/0x3c) [] (pm_runtime_set_autosuspend_delay+0x30/0x3c) from [] (sdhci_s3c_probe+0x35c/0x52c [sdhci_s3c]) [] (sdhci_s3c_probe+0x35c/0x52c [sdhci_s3c]) from [] (platform_drv_probe+0x18/0x1c) Signed-off-by: Chander Kashyap Acked-by: Jaehoon Chung --- drivers/mmc/host/sdhci-s3c.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 0cbb4c2..3f4518d 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c @@ -658,6 +658,7 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev) sdhci_remove_host(host, 1); + pm_runtime_dont_use_autosuspend(&pdev->dev); pm_runtime_disable(&pdev->dev); clk_disable(sc->clk_bus[sc->cur_clk]);