aboutsummaryrefslogtreecommitdiffstats
path: root/driver
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2006-01-10 23:25:31 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-10 23:25:31 -0800
commit91a2cf51903acbc90f5b4d2453ddcafa09f8d20a (patch)
tree98226aac3ed024a27055226fec833bc93178de51 /driver
parent99eb0023004a97a8cfdec3b41328d5ea1de38dd8 (diff)
downloadpatches-91a2cf51903acbc90f5b4d2453ddcafa09f8d20a.tar.gz
added more patches
Diffstat (limited to 'driver')
-rw-r--r--driver/device_shutdown-can-loop-if-the-driver-frees-itself.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/driver/device_shutdown-can-loop-if-the-driver-frees-itself.patch b/driver/device_shutdown-can-loop-if-the-driver-frees-itself.patch
new file mode 100644
index 0000000000000..13d3972ad4d80
--- /dev/null
+++ b/driver/device_shutdown-can-loop-if-the-driver-frees-itself.patch
@@ -0,0 +1,46 @@
+From akpm@osdl.org Mon Jan 9 01:09:07 2006
+Message-Id: <200601090905.k09953Iv027215@shell0.pdx.osdl.net>
+From: "Michael Richardson" <mcr@sandelman.ottawa.on.ca>
+Subject: device_shutdown can loop if the driver frees itself
+To: mcr@sandelman.ottawa.on.ca, dhowells@redhat.com, greg@kroah.com,
+ mcr@marajade.sandelman.ca, mochel@digitalimplant.org,
+ mm-commits@vger.kernel.org
+Date: Mon, 09 Jan 2006 01:04:51 -0800
+
+
+From: "Michael Richardson" <mcr@sandelman.ottawa.on.ca>
+
+This patch changes device_shutdown() to use the newly introduced safe
+reverse list traversal. We experienced loops on system reboot if we had
+removed and re-inserted our device from the device list.
+
+We noticed this problem on PPC405. Our PCI IDE device comes and goes a lot.
+
+Our hypothesis was that there was a loop caused by the driver->shutdown
+freeing memory. It is possible that we do something wrong as well, but
+being unable to reboot is kind of nasty.
+
+Signed-off-by: Michael Richardson <mcr@marajade.sandelman.ca>
+Cc: Patrick Mochel <mochel@digitalimplant.org>
+Cc: David Howells <dhowells@redhat.com>
+Signed-off-by: Andrew Morton <akpm@osdl.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/base/power/shutdown.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- gregkh-2.6.orig/drivers/base/power/shutdown.c
++++ gregkh-2.6/drivers/base/power/shutdown.c
+@@ -35,10 +35,10 @@ extern int sysdev_shutdown(void);
+ */
+ void device_shutdown(void)
+ {
+- struct device * dev;
++ struct device * dev, *devn;
+
+ down_write(&devices_subsys.rwsem);
+- list_for_each_entry_reverse(dev, &devices_subsys.kset.list,
++ list_for_each_entry_safe_reverse(dev, devn, &devices_subsys.kset.list,
+ kobj.entry) {
+ if (dev->bus && dev->bus->shutdown) {
+ dev_dbg(dev, "shutdown\n");