ChangeSet 1.2181.22.8, 2005/03/19 14:58:03-06:00, [EMAIL PROTECTED]

        [PATCH] fix breakage in the SCSI generic tag code
        
        When I redid the target allocation routines, I inadvertently broke the
        generic tag code.  The problem is that the device is added to the host
        list after slave_configure in the new code.  This is too late since if
        any command disconnects during the initial inquiry phase, we now cannot
        find the device for the reconnect.  The fix is to add the device to the
        lists earlier.
        
        Signed-off-by: James Bottomley <[EMAIL PROTECTED]>



 scsi_sysfs.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)


diff -Nru a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
--- a/drivers/scsi/scsi_sysfs.c 2005-03-30 16:08:04 -08:00
+++ b/drivers/scsi/scsi_sysfs.c 2005-03-30 16:08:04 -08:00
@@ -563,15 +563,7 @@
  **/
 int scsi_sysfs_add_sdev(struct scsi_device *sdev)
 {
-       struct Scsi_Host *shost = sdev->host;
-       struct scsi_target *starget = scsi_target(sdev);
        int error, i;
-       unsigned long flags;
-
-       spin_lock_irqsave(shost->host_lock, flags);
-       list_add_tail(&sdev->same_target_siblings, &starget->devices);
-       list_add_tail(&sdev->siblings, &shost->__devices);
-       spin_unlock_irqrestore(shost->host_lock, flags);
 
        if ((error = scsi_device_set_state(sdev, SDEV_RUNNING)) != 0)
                return error;
@@ -788,6 +780,10 @@
 
 void scsi_sysfs_device_initialize(struct scsi_device *sdev)
 {
+       unsigned long flags;
+       struct Scsi_Host *shost = sdev->host;
+       struct scsi_target  *starget = sdev->sdev_target;
+
        device_initialize(&sdev->sdev_gendev);
        sdev->sdev_gendev.bus = &scsi_bus_type;
        sdev->sdev_gendev.release = scsi_device_dev_release;
@@ -803,6 +799,10 @@
                 sdev->channel, sdev->id, sdev->lun);
        sdev->scsi_level = SCSI_2;
        transport_setup_device(&sdev->sdev_gendev);
+       spin_lock_irqsave(shost->host_lock, flags);
+       list_add_tail(&sdev->same_target_siblings, &starget->devices);
+       list_add_tail(&sdev->siblings, &shost->__devices);
+       spin_unlock_irqrestore(shost->host_lock, flags);
 }
 
 int scsi_is_sdev_device(const struct device *dev)
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to