From patchwork Tue Apr 19 10:46:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 717801 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3JAjQTC029681 for ; Tue, 19 Apr 2011 10:46:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754639Ab1DSKqY (ORCPT ); Tue, 19 Apr 2011 06:46:24 -0400 Received: from moutng.kundenserver.de ([212.227.126.171]:65396 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754423Ab1DSKqY (ORCPT ); Tue, 19 Apr 2011 06:46:24 -0400 Received: from axis700.grange (pD9EB8F0A.dip0.t-ipconnect.de [217.235.143.10]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0Lucts-1PllpE3egi-00znbl; Tue, 19 Apr 2011 12:46:21 +0200 Received: by axis700.grange (Postfix, from userid 1000) id 643F8189B89; Tue, 19 Apr 2011 12:46:20 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id 5AAB3189B88; Tue, 19 Apr 2011 12:46:20 +0200 (CEST) Date: Tue, 19 Apr 2011 12:46:20 +0200 (CEST) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: linux-mmc@vger.kernel.org cc: Alan Stern , Magnus Damm , Simon Horman , "Rafael J. Wysocki" Subject: [PATCH/RFC] MMC: remove unbalanced pm_runtime_suspend() Message-ID: MIME-Version: 1.0 X-Provags-ID: V02:K0:637wn8yy1otXAPHC+r5dFEHGFwYXiVwOl9SqNSQNGZU AZ5Apl+vRnKJIESb0PWNEQ9HWaGehyEeG7XIjrAusNGzk80RA8 5WhXdvYOF5qJGlHZ/zQb9wgQ516KsvrdFEbfgMZwGSYjcaCo67 aQkFNuluRCZ5RJsBp6tcoaNONYtXQ4NTxkGU3qiCD6fUAykUmz ptwNDA9PbrdOnhRkBq+VGnNYKqtGWXirXTTm0nmhI4= Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 19 Apr 2011 10:46:25 +0000 (UTC) MMC bus PM operations implement a .runtime_idle() method, which calls pm_runtime_suspend(), but this call is not balanced by a resume counterpart, which causes problems with repeated card-plug and driver-load cycles. Removing this method fixes the disbalance. Signed-off-by: Guennadi Liakhovetski --- With this patch and with v2 of the MMCIF PM patch, that I'll be posting shortly, I can load / unload the driver, insert and remove the card and suspend and wake up the system multiple times and each time the full PM cycle is performed, going down to the platform callbacks. However, it might well be, that there's a more correct way to achieve the same. -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 63667a8..44866a6 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c @@ -158,15 +158,9 @@ static int mmc_runtime_resume(struct device *dev) return mmc_power_restore_host(card->host); } -static int mmc_runtime_idle(struct device *dev) -{ - return pm_runtime_suspend(dev); -} - static const struct dev_pm_ops mmc_bus_pm_ops = { .runtime_suspend = mmc_runtime_suspend, .runtime_resume = mmc_runtime_resume, - .runtime_idle = mmc_runtime_idle, }; #define MMC_PM_OPS_PTR (&mmc_bus_pm_ops)