lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 3 Aug 2008 19:42:45 +0530
From:	"Dasgupta, Romit" <romit@...com>
To:	Alan Stern <stern@...land.harvard.edu>
CC:	David Engraf <david.engraf@...com.eu>, Greg KH <greg@...ah.com>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH] [PM] Fixes missing PM entries in sysfs without
 CONFIG_PM_SLEEP

Alan,
         Here is a patch for you. Tested with

1) CONFIG_SUSPEND, CONFIG_HIBERNATION i.e. with CONFIG_PM_SLEEP
2) without CONFIG_PM_SLEEP but with CONFIG_PM
3) without CONFIG_PM

Thanks,
-Romit


Description: Fixes missing PM entries in sysfs without CONFIG_PM_SLEEP.
Signed-off-by: Romit Dasgupta <romit@...com>
diff --git a/drivers/base/power/power.h b/drivers/base/power/power.h
index a3252c0..ad8112d 100644
--- a/drivers/base/power/power.h
+++ b/drivers/base/power/power.h
@@ -1,3 +1,25 @@
+#ifdef CONFIG_PM
+
+/*
+ * sysfs.c
+ */
+
+extern int dpm_sysfs_add(struct device *);
+extern void dpm_sysfs_remove(struct device *);
+
+#else /* CONFIG_PM */
+
+static inline int dpm_sysfs_add(struct device *dev)
+{
+       return 0;
+}
+
+static inline void dpm_sysfs_remove(struct device *dev)
+{
+}
+
+#endif
+
 #ifdef CONFIG_PM_SLEEP

 /*
@@ -16,29 +38,13 @@ extern void device_pm_remove(struct device *);

 #else /* CONFIG_PM_SLEEP */

-static inline int device_pm_add(struct device *dev) { return 0; }
-static inline void device_pm_remove(struct device *dev) {}
-
-#endif
-
-#ifdef CONFIG_PM
-
-/*
- * sysfs.c
- */
-
-extern int dpm_sysfs_add(struct device *);
-extern void dpm_sysfs_remove(struct device *);
-
-#else /* CONFIG_PM */
-
-static inline int dpm_sysfs_add(struct device *dev)
+static inline int device_pm_add(struct device *dev)
 {
-       return 0;
+       return dpm_sysfs_add(dev);
 }
-
-static inline void dpm_sysfs_remove(struct device *dev)
+static inline void device_pm_remove(struct device *dev)
 {
+       dpm_sysfs_remove(dev);
 }

 #endif

>-----Original Message-----
>From: Alan Stern [mailto:stern@...land.harvard.edu]
>Sent: Sunday, August 03, 2008 5:16 AM
>To: Dasgupta, Romit
>Cc: David Engraf; Greg KH; linux-usb@...r.kernel.org
>Subject: RE: usb_create_sysfs_dev_files in hub.c:1586 fails on system boot
>
>On Fri, 1 Aug 2008, Dasgupta, Romit wrote:
>
>> CONFIG_PM_SLEEP needs to be enabled for power to be added as a sysfs and
>that is dependent on CONFIG_SUSPEND (Suspend to RAM and standby).
>
>You're right.  I thought we had fixed that some time ago, but it's
>still wrong.  In particular, the inline definition of device_pm_add()
>in drivers/base/power/power.h is wrong; it needs to call
>dpm_sysfs_add().
>
>I can't make up a patch now; I'll do it on Monday if nobody beats me to
>it.
>
>Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ