linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Drake <dsd@gentoo.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: usb_id segfaulting on 2.6.23
Date: Tue, 06 Nov 2007 17:51:22 +0000	[thread overview]
Message-ID: <4730A99A.3010809@gentoo.org> (raw)
In-Reply-To: <47135D33.7080805@gentoo.org>

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

Alan Stern wrote:
> Ah, okay.  This is a known problem, a configuration-related issue.  
> The PM core doesn't create a device's /sys/.../power subdirectory
> unless CONFIG_PM_SLEEP is set.  In fact it should be created whenever
> CONFIG_PM is set.
> 
> I haven't had time to write a patch for this yet.  Do you want to try?

OK. Any comments on this before I sent it to the proper channels?

Thanks,
Daniel

[-- Attachment #2: power-sysfs.patch --]
[-- Type: text/plain, Size: 2450 bytes --]


From: Daniel Drake <dsd@gentoo.org>

Index: linux-2.6.24-rc1-git14/drivers/base/core.c
===================================================================
--- linux-2.6.24-rc1-git14.orig/drivers/base/core.c
+++ linux-2.6.24-rc1-git14/drivers/base/core.c
@@ -770,6 +770,9 @@ int device_add(struct device *dev)
 	error = device_add_attrs(dev);
 	if (error)
 		goto AttrsError;
+	error = dpm_sysfs_add(dev);
+	if (error)
+		goto PMsysfsError;
 	error = device_pm_add(dev);
 	if (error)
 		goto PMError;
@@ -797,11 +800,13 @@ int device_add(struct device *dev)
 	return error;
  BusError:
 	device_pm_remove(dev);
- PMError:
+ PMsysfsError:
 	if (dev->bus)
 		blocking_notifier_call_chain(&dev->bus->bus_notifier,
 					     BUS_NOTIFY_DEL_DEVICE, dev);
 	device_remove_attrs(dev);
+ PMError:
+	dpm_sysfs_remove(dev);
  AttrsError:
 	device_remove_class_symlinks(dev);
  SymlinkError:
Index: linux-2.6.24-rc1-git14/drivers/base/power/Makefile
===================================================================
--- linux-2.6.24-rc1-git14.orig/drivers/base/power/Makefile
+++ linux-2.6.24-rc1-git14/drivers/base/power/Makefile
@@ -1,5 +1,6 @@
 obj-y			:= shutdown.o
-obj-$(CONFIG_PM_SLEEP)	+= main.o sysfs.o
+obj-$(CONFIG_PM)	+= sysfs.o
+obj-$(CONFIG_PM_SLEEP)	+= main.o
 obj-$(CONFIG_PM_TRACE)	+= trace.o
 
 ifeq ($(CONFIG_DEBUG_DRIVER),y)
Index: linux-2.6.24-rc1-git14/drivers/base/power/power.h
===================================================================
--- linux-2.6.24-rc1-git14.orig/drivers/base/power/power.h
+++ linux-2.6.24-rc1-git14/drivers/base/power/power.h
@@ -21,6 +21,22 @@ static inline struct device * to_device(
 extern int device_pm_add(struct device *);
 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
  */
@@ -28,16 +44,16 @@ extern void device_pm_remove(struct devi
 extern int dpm_sysfs_add(struct device *);
 extern void dpm_sysfs_remove(struct device *);
 
-#else /* CONFIG_PM_SLEEP */
-
+#else /* CONFIG_PM */
 
-static inline int device_pm_add(struct device * dev)
+static inline int dpm_sysfs_add(struct device * dev)
 {
 	return 0;
 }
-static inline void device_pm_remove(struct device * dev)
+static inline void dpm_sysfs_remove(struct device * dev)
 {
 
 }
 
-#endif
+#endif /* CONFIG_PM */
+

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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

[-- Attachment #4: Type: text/plain, Size: 226 bytes --]

_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

  parent reply	other threads:[~2007-11-06 17:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-15 12:29 usb_id segfaulting on 2.6.23 Daniel Drake
2007-10-15 12:41 ` Kay Sievers
2007-10-15 12:58 ` Kay Sievers
2007-10-15 13:07 ` Daniel Drake
2007-10-15 21:19 ` Kay Sievers
2007-10-16 18:15 ` Kay Sievers
2007-11-06  0:42 ` Daniel Drake
2007-11-06  2:26 ` Kay Sievers
2007-11-06  7:42 ` Oliver Neukum
2007-11-06 11:47 ` Daniel Drake
2007-11-06 12:38 ` Oliver Neukum
2007-11-06 14:11 ` Oliver Neukum
2007-11-06 15:03 ` Daniel Drake
2007-11-06 16:11   ` Alan Stern
2007-11-06 16:05 ` Alan Stern
2007-11-06 17:51 ` Daniel Drake [this message]
2007-11-06 17:54 ` Daniel Drake
2007-11-06 22:18 ` Greg KH

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=4730A99A.3010809@gentoo.org \
    --to=dsd@gentoo.org \
    --cc=linux-hotplug@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).