From patchwork Fri Apr 8 11:40:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 65395 Delivered-To: patches@linaro.org Received: by 10.112.43.237 with SMTP id z13csp15007lbl; Fri, 8 Apr 2016 04:41:16 -0700 (PDT) X-Received: by 10.25.211.75 with SMTP id k72mr3417668lfg.45.1460115676690; Fri, 08 Apr 2016 04:41:16 -0700 (PDT) Return-Path: Received: from mail-lf0-x231.google.com (mail-lf0-x231.google.com. [2a00:1450:4010:c07::231]) by mx.google.com with ESMTPS id r10si4159224lbn.59.2016.04.08.04.41.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Apr 2016 04:41:16 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::231 as permitted sender) client-ip=2a00:1450:4010:c07::231; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::231 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x231.google.com with SMTP id g184so77275210lfb.3 for ; Fri, 08 Apr 2016 04:41:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=g1Dd/nGxe68aRYxqR6xx9VZj/t8X5Ysl4Pu65ZsSvqw=; b=JMeSaXQFhh8G90q8v6Ks2BDZnFtbvLxiNUC5nP23M+zzG2n5It4xAyauU3v6mS/9rA BDICKkG4U+WB/bS+C84iZZk+LN0QOw1ouSJLKu1uFmAr/Yfe7VB4eQw08o5mfSqODAdf Nt2JpCLE4BDcWxyLG3zdFzZDAhlLyRFbQFQyc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=g1Dd/nGxe68aRYxqR6xx9VZj/t8X5Ysl4Pu65ZsSvqw=; b=GXRyA7Cd5nJdTOhnckzvLBk+fabSNtEvs069Ohh3kbO7k0Ww4pTJkhdmuNtWob3iVx UKRiImUJOvdb4NHtH/5ZaM20wzjJfMSz6L/gZPfzQ2RO7fPloD+FISEuYXpuwf9mpUpb lxZcE5wvkHcLpWw8CG7LRfafzDQ9/PjYk3S5kvHsITZBCm9QmCRLWH0q5R5C7C7Mii7u smDK9Qsi9/oR78F2ieuY2UsVRtMksJCaSdNYrOpkryOJSZNGNmrt7+L4xaDDP9zPWqef yrVN3adQmLP+SezW7I0pIMavdmGKoXlivzQLJ1nzG+44JxUbYMTB+K9M1mOqcj3N0c4E kj/A== X-Gm-Message-State: AD7BkJL5u2+bH7+mDNJbHhFk/YhFUG5MjjdBUB0ELIW/t2Y/xnlsn2ejLrI685WVpKwUIpo5N10= X-Received: by 10.25.213.210 with SMTP id m201mr3756751lfg.116.1460115675907; Fri, 08 Apr 2016 04:41:15 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-155-4-128-67.na.cust.bahnhof.se. [155.4.128.67]) by smtp.gmail.com with ESMTPSA id s63sm1917498lfs.17.2016.04.08.04.41.14 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 08 Apr 2016 04:41:14 -0700 (PDT) From: Ulf Hansson To: "Rafael J. Wysocki" , linux-pm@vger.kernel.org Cc: Kevin Hilman , Len Brown , Pavel Machek , Linus Walleij , Ulf Hansson Subject: [PATCH V2] PM / Runtime: Move ignore_children flag under CONFIG_PM Date: Fri, 8 Apr 2016 13:40:53 +0200 Message-Id: <1460115653-32421-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 The ignore_children flag is used only when CONFIG_PM is set, so let's move it into that section within the struct dev_pm_info. Move also the corresponding pm_suspend_ignore_children() API out of device.h into pm_runtime.h, to be consistent with similar APIs. Unfortunate this causes the Toshiba PCI SD mmc host driver to fail to compile as it needs pm_runtime.h, so let's fix this here as well. Signed-off-by: Ulf Hansson --- Changes in v2: - Fix compiler error for toshsd mmc host driver. --- drivers/mmc/host/toshsd.c | 1 + include/linux/device.h | 5 ----- include/linux/pm.h | 2 +- include/linux/pm_runtime.h | 6 ++++++ 4 files changed, 8 insertions(+), 6 deletions(-) -- 1.9.1 diff --git a/drivers/mmc/host/toshsd.c b/drivers/mmc/host/toshsd.c index e2cdd5f..553ef41 100644 --- a/drivers/mmc/host/toshsd.c +++ b/drivers/mmc/host/toshsd.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include diff --git a/include/linux/device.h b/include/linux/device.h index 002c597..b130304 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -956,11 +956,6 @@ static inline bool device_async_suspend_enabled(struct device *dev) return !!dev->power.async_suspend; } -static inline void pm_suspend_ignore_children(struct device *dev, bool enable) -{ - dev->power.ignore_children = enable; -} - static inline void dev_pm_syscore_device(struct device *dev, bool val) { #ifdef CONFIG_PM_SLEEP diff --git a/include/linux/pm.h b/include/linux/pm.h index 6a5d654..06eb353 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -563,7 +563,6 @@ struct dev_pm_info { bool is_suspended:1; /* Ditto */ bool is_noirq_suspended:1; bool is_late_suspended:1; - bool ignore_children:1; bool early_init:1; /* Owned by the PM core */ bool direct_complete:1; /* Owned by the PM core */ spinlock_t lock; @@ -591,6 +590,7 @@ struct dev_pm_info { unsigned int deferred_resume:1; unsigned int run_wake:1; unsigned int runtime_auto:1; + bool ignore_children:1; unsigned int no_callbacks:1; unsigned int irq_safe:1; unsigned int use_autosuspend:1; diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 7af093d..2e14d26 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h @@ -56,6 +56,11 @@ extern void pm_runtime_update_max_time_suspended(struct device *dev, s64 delta_ns); extern void pm_runtime_set_memalloc_noio(struct device *dev, bool enable); +static inline void pm_suspend_ignore_children(struct device *dev, bool enable) +{ + dev->power.ignore_children = enable; +} + static inline bool pm_children_suspended(struct device *dev) { return dev->power.ignore_children @@ -156,6 +161,7 @@ static inline void __pm_runtime_disable(struct device *dev, bool c) {} static inline void pm_runtime_allow(struct device *dev) {} static inline void pm_runtime_forbid(struct device *dev) {} +static inline void pm_suspend_ignore_children(struct device *dev, bool enable) {} static inline bool pm_children_suspended(struct device *dev) { return false; } static inline void pm_runtime_get_noresume(struct device *dev) {} static inline void pm_runtime_put_noidle(struct device *dev) {}