public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pci: don't override drv->shutdown unconditionally
@ 2005-06-17 18:30 Christoph Hellwig
  2005-06-17 18:49 ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2005-06-17 18:30 UTC (permalink / raw)
  To: gregkh, akpm; +Cc: linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=unknown-8bit, Size: 856 bytes --]

There are many drivers that have been setting the generic driver
model­level shutdown callback, and pci thus must not override it.

Without this patch we can have really bad data loss on various
raid controllers.


Index: linux-2.6/drivers/pci/pci-driver.c
===================================================================
--- linux-2.6.orig/drivers/pci/pci-driver.c	2005-05-05 11:01:03.000000000 +0200
+++ linux-2.6/drivers/pci/pci-driver.c	2005-06-17 18:44:52.000000000 +0200
@@ -393,7 +393,8 @@
 	drv->driver.bus = &pci_bus_type;
 	drv->driver.probe = pci_device_probe;
 	drv->driver.remove = pci_device_remove;
-	drv->driver.shutdown = pci_device_shutdown,
+	if (!drv->driver.shutdown)
+		drv->driver.shutdown = pci_device_shutdown,
 	drv->driver.owner = drv->owner;
 	drv->driver.kobj.ktype = &pci_driver_kobj_type;
 	pci_init_dynids(&drv->dynids);

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH] PCI: don't override drv->shutdown unconditionally
@ 2005-06-17 19:25 Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2005-06-17 19:25 UTC (permalink / raw)
  To: torvalds, Andrew Morton; +Cc: linux-kernel, linux-pci, hch

There are many drivers that have been setting the generic driver
model level shutdown callback, and pci thus must not override it.

Without this patch we can have really bad data loss on various
raid controllers.


From: Christoph Hellwig <hch@lst.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


---
 drivers/pci/pci-driver.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

--- gregkh-2.6.orig/drivers/pci/pci-driver.c	2005-06-16 15:19:44.000000000 -0700
+++ gregkh-2.6/drivers/pci/pci-driver.c	2005-06-17 12:17:34.000000000 -0700
@@ -395,7 +395,10 @@
 	drv->driver.bus = &pci_bus_type;
 	drv->driver.probe = pci_device_probe;
 	drv->driver.remove = pci_device_remove;
-	drv->driver.shutdown = pci_device_shutdown,
+	/* FIXME, once all of the existing PCI drivers have been fixed to set
+	 * the pci shutdown function, this test can go away. */
+	if (!drv->driver.shutdown)
+		drv->driver.shutdown = pci_device_shutdown,
 	drv->driver.owner = drv->owner;
 	drv->driver.kobj.ktype = &pci_driver_kobj_type;
 	pci_init_dynids(&drv->dynids);

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-06-17 19:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-17 18:30 [PATCH] pci: don't override drv->shutdown unconditionally Christoph Hellwig
2005-06-17 18:49 ` Greg KH
2005-06-17 18:51   ` Christoph Hellwig
2005-06-17 18:53     ` Greg KH
2005-06-17 19:01       ` Greg KH
2005-06-17 19:34         ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2005-06-17 19:25 [PATCH] PCI: " Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox