From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760330AbbIEBnm (ORCPT ); Fri, 4 Sep 2015 21:43:42 -0400 Received: from v094114.home.net.pl ([79.96.170.134]:41982 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1758255AbbIEBnc (ORCPT ); Fri, 4 Sep 2015 21:43:32 -0400 From: "Rafael J. Wysocki" To: Daniel Wagner Cc: linux-kernel@vger.kernel.org, Len Brown , Pavel Machek , linux-pm@vger.kernel.org Subject: Re: [RFC v0 2/9] suspend: Add getter function to report if freezing is active Date: Sat, 05 Sep 2015 04:11:16 +0200 Message-ID: <1683655.HLd9k04Slu@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/4.1.0-rc5+; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1441373702-31796-3-git-send-email-daniel.wagner@bmw-carit.de> References: <1441373702-31796-1-git-send-email-daniel.wagner@bmw-carit.de> <1441373702-31796-3-git-send-email-daniel.wagner@bmw-carit.de> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday, September 04, 2015 03:34:55 PM Daniel Wagner wrote: > Instead encode the FREEZE state via the CPU state we allow the > interesting subsystems (MCE, microcode) to query the power > subsystem directly. A use case, please. > Most notifiers are not interested at all > in this information so rather have explicit calls to freeze_active() > instead adding complexity to the rest of the users of the CPU > notifiers. Why does it has anything to do with CPU notifiers? We don't offline CPUs for suspend-to-idle. > Signed-off-by: Daniel Wagner > Cc: "Rafael J. Wysocki" > Cc: Len Brown > Cc: Pavel Machek > Cc: linux-pm@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > --- > include/linux/suspend.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/include/linux/suspend.h b/include/linux/suspend.h > index 5efe743..5e15ade 100644 > --- a/include/linux/suspend.h > +++ b/include/linux/suspend.h > @@ -216,6 +216,11 @@ static inline bool idle_should_freeze(void) > return unlikely(suspend_freeze_state == FREEZE_STATE_ENTER); > } > > +static inline bool freeze_active(void) > +{ > + return unlikely(suspend_freeze_state != FREEZE_STATE_NONE); > +} > + > extern void freeze_set_ops(const struct platform_freeze_ops *ops); > extern void freeze_wake(void); > > @@ -244,6 +249,7 @@ extern int pm_suspend(suspend_state_t state); > static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {} > static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } > static inline bool idle_should_freeze(void) { return false; } > +static inline bool freeze_active(void) { return false; } > static inline void freeze_set_ops(const struct platform_freeze_ops *ops) {} > static inline void freeze_wake(void) {} > #endif /* !CONFIG_SUSPEND */ > -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.