All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Linux-pm mailing list <linux-pm@lists.osdl.org>
Cc: Linus Torvalds <torvalds@osdl.org>
Subject: [patch 2.6.18-rc2-mm 1/2] PM: make /sys/devices/.../power/state optional
Date: Wed, 19 Jul 2006 13:37:01 -0700	[thread overview]
Message-ID: <200607191337.02365.david-b@pacbell.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 538 bytes --]

There seems to be a consensus on linux-pm that the sysfs power/state files
are the wrong approach to userspace having control over runtime PM.  Not
that there's agreement on what such controls _should_ look like, or even
that there should be such controls for purposes other than testing...

So here's a patch that just makes it easy to get rid of this misfeature.
It'll help flush out any userspace software that really thinks it needs that
mechanism; PCMCIA seems to no longer be in that camp, it has it's own
sysfs attribute.

- Dave


[-- Attachment #2: pm-sysfs.patch --]
[-- Type: text/x-diff, Size: 2060 bytes --]

Add a new PM_SYSFS_DEPRECATED config option to control whether or
not the /sys/devices/.../power/state files are provided.  This will
make it easier to get rid of that mechanism when the time comes,
and to verify that userspace tools work right without it.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>

Index: linux/kernel/power/Kconfig
===================================================================
--- linux.orig/kernel/power/Kconfig	2006-07-18 11:00:35.000000000 -0700
+++ linux/kernel/power/Kconfig	2006-07-18 11:14:57.000000000 -0700
@@ -53,6 +53,17 @@
 	CAUTION: this option will cause your machine's real-time clock to be
 	set to an invalid time after a resume.
 
+config PM_SYSFS_DEPRECATED
+	bool "Driver model /sys/devices/.../power/state files (DEPRECATED)"
+	depends on PM && SYSFS
+	default n
+	help
+	  The driver model started out with a sysfs file intended to provide
+	  a userspace hook for device power management.  This feature has never
+	  worked very well, except for limited testing purposes, and so it will
+	  be removed.   It's not clear that a generic mechanism could really
+	  handle the wide variability of device power states; any replacements
+	  are likely to be bus or driver specific.
 
 config SOFTWARE_SUSPEND
 	bool "Software Suspend"
Index: linux/drivers/base/power/sysfs.c
===================================================================
--- linux.orig/drivers/base/power/sysfs.c	2006-07-18 11:13:56.000000000 -0700
+++ linux/drivers/base/power/sysfs.c	2006-07-18 11:15:24.000000000 -0700
@@ -7,6 +7,8 @@
 #include "power.h"
 
 
+#ifdef	CONFIG_PM_SYSFS_DEPRECATED
+
 /**
  *	state - Control current power state of device
  *
@@ -67,6 +69,8 @@
 
 static DEVICE_ATTR(state, 0644, state_show, state_store);
 
+#endif	/* CONFIG_PM_SYSFS_DEPRECATED */
+
 /*
  *	wakeup - Report/change current wakeup option for device
  *
@@ -140,7 +144,9 @@
 
 
 static struct attribute * power_attrs[] = {
+#ifdef	CONFIG_PM_SYSFS_DEPRECATED
 	&dev_attr_state.attr,
+#endif
 	&dev_attr_wakeup.attr,
 	NULL,
 };

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



             reply	other threads:[~2006-07-19 20:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-19 20:37 David Brownell [this message]
2006-08-16 11:57 ` [patch 2.6.18-rc2-mm 1/2] PM: make /sys/devices/.../power/state optional Pavel Machek
2006-08-16 18:40   ` David Brownell
2006-08-16 19:08     ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200607191337.02365.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=linux-pm@lists.osdl.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.