Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1219413

Re: [RFC v0 2/9] suspend: Add getter function to report if freezing is active

From "Rafael J. Wysocki" <rjw@rjwysocki.net>
Newsgroups linux.kernel
Subject Re: [RFC v0 2/9] suspend: Add getter function to report if freezing is active
Date 2015-09-05 03:50 +0200
Message-ID <q5aMa-2OO-11@gated-at.bofh.it> (permalink)
References <q4ZnH-3wF-3@gated-at.bofh.it> <q4ZnI-3wF-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <daniel.wagner@bmw-carit.de>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Len Brown <len.brown@intel.com>
> Cc: Pavel Machek <pavel@ucw.cz>
> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC v0 0/9] Remove CPU_*_FROZEN Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-09-04 15:40 +0200
  [RFC v0 8/9] cpu: Do not set CPU_TASKS_FROZEN anymore Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-09-04 15:40 +0200
  [RFC v0 1/9] smpboot: Add a separate CPU state when a surviving CPU times out Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-09-04 15:40 +0200
  [RFC v0 2/9] suspend: Add getter function to report if freezing is active Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-09-04 15:40 +0200
    Re: [RFC v0 2/9] suspend: Add getter function to report if freezing is active "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-09-05 03:50 +0200
  [RFC v0 5/9] sched: Use freeze_active() instead CPU_*_FROZEN state information Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-09-04 15:40 +0200
  [RFC v0 4/9] smpboot: Use freeze_active() instead CPU_DEAD_FROZEN state information Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-09-04 15:40 +0200
  [RFC v0 6/9] cpu: Restructure FROZEN state handling Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-09-04 15:40 +0200
  [RFC v0 3/9] x86: Use freeze_active() instead of CPU_*_FROZEN Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-09-04 15:40 +0200
  [RFC v0 9/9] doc: Update cpu-hotplug documents on removal of CPU_TASKS_FROZEN Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-09-04 15:40 +0200

csiph-web