public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Calling sd_shutdown when in state SDEV_DEL
@ 2004-03-24 15:03 Heiko Carstens
  2004-03-24 15:35 ` James Bottomley
  2004-03-24 16:46 ` Mike Anderson
  0 siblings, 2 replies; 8+ messages in thread
From: Heiko Carstens @ 2004-03-24 15:03 UTC (permalink / raw)
  To: James Bottomley, linux-scsi

Hi,

upon scsi_remove_device the sd driver tries to send out a SYNCHRONIZE_CACHE
command (sd_shutdown) which is not possible because the sdev_state for the
device in question is already SDEV_DEL.
The patch below solves the problem, but I'm not sure if this is the right
way to do it. Also setting the state to SDEV_DEL after calling device_del
is probably pointless...

Heiko

diff -urN 2.5/drivers/scsi/scsi_sysfs.c 2.5-q/drivers/scsi/scsi_sysfs.c
--- 2.5/drivers/scsi/scsi_sysfs.c	Wed Mar 24 14:42:57 2004
+++ 2.5-q/drivers/scsi/scsi_sysfs.c	Wed Mar 24 14:39:21 2004
@@ -437,11 +437,12 @@
 void scsi_remove_device(struct scsi_device *sdev)
 {
 	if (sdev->sdev_state == SDEV_RUNNING || sdev->sdev_state == SDEV_CANCEL) {
-		scsi_device_set_state(sdev, SDEV_DEL);
+		scsi_device_quiesce(sdev);
 		class_device_unregister(&sdev->sdev_classdev);
 		if(sdev->transport_classdev.class)
 			class_device_unregister(&sdev->transport_classdev);
 		device_del(&sdev->sdev_gendev);
+		scsi_device_set_state(sdev, SDEV_DEL);
 		if (sdev->host->hostt->slave_destroy)
 			sdev->host->hostt->slave_destroy(sdev);
 		if (sdev->host->transportt->cleanup)


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

end of thread, other threads:[~2004-04-02 23:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-24 15:03 Calling sd_shutdown when in state SDEV_DEL Heiko Carstens
2004-03-24 15:35 ` James Bottomley
2004-03-24 16:28   ` Heiko Carstens
2004-03-24 17:04   ` Mike Anderson
2004-03-24 20:09     ` James Bottomley
2004-03-25  1:48       ` Mike Anderson
2004-04-02 23:33         ` James Bottomley
2004-03-24 16:46 ` Mike Anderson

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