From patchwork Mon Oct 11 18:32:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Shmidt X-Patchwork-Id: 246001 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 o9BIZ7KA017505 for ; Mon, 11 Oct 2010 18:35:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755765Ab0JKSfG (ORCPT ); Mon, 11 Oct 2010 14:35:06 -0400 Received: from lo.gmane.org ([80.91.229.12]:33078 "EHLO lo.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755684Ab0JKSfF (ORCPT ); Mon, 11 Oct 2010 14:35:05 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1P5NDD-0002Xx-5y for linux-mmc@vger.kernel.org; Mon, 11 Oct 2010 20:35:03 +0200 Received: from 216-239-45-4.google.com ([216.239.45.4]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 11 Oct 2010 20:35:03 +0200 Received: from dimitrysh by 216-239-45-4.google.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 11 Oct 2010 20:35:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: linux-mmc@vger.kernel.org From: Dmitry Shmidt Subject: [PATCH] mmc: Add "ignore mmc pm notify" functionality Date: Mon, 11 Oct 2010 18:32:26 +0000 (UTC) Lines: 53 Message-ID: Mime-Version: 1.0 X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 216.239.45.4 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.63 Safari/534.3) 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.3 (demeter1.kernel.org [140.211.167.41]); Mon, 11 Oct 2010 18:35:07 +0000 (UTC) diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index d80cfdc..ba684e6 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -137,7 +137,8 @@ int mmc_add_host(struct mmc_host *host) #endif mmc_start_host(host); - register_pm_notifier(&host->pm_notify); + if (!(host->pm_flags & MMC_PM_IGNORE_PM_NOTIFY)) + register_pm_notifier(&host->pm_notify); return 0; } @@ -154,7 +155,9 @@ EXPORT_SYMBOL(mmc_add_host); */ void mmc_remove_host(struct mmc_host *host) { - unregister_pm_notifier(&host->pm_notify); + if (!(host->pm_flags & MMC_PM_IGNORE_PM_NOTIFY)) + unregister_pm_notifier(&host->pm_notify); + mmc_stop_host(host); #ifdef CONFIG_DEBUG_FS diff --git a/include/linux/mmc/pm.h b/include/linux/mmc/pm.h index d37aac4..3903823 100644 --- a/include/linux/mmc/pm.h +++ b/include/linux/mmc/pm.h @@ -26,5 +26,6 @@ typedef unsigned int mmc_pm_flag_t; #define MMC_PM_KEEP_POWER (1 << 0) /* preserve card power during suspend */ #define MMC_PM_WAKE_SDIO_IRQ (1 << 1) /* wake up host system on SDIO IRQ assertion */ +#define MMC_PM_IGNORE_PM_NOTIFY (1 << 2) /* ignore mmc pm notify