]> git.neil.brown.name Git - history.git/commitdiff
Re: [PATCH] fix 2.5 scsi queue depth setting
authorPatrick Mansfield <patmans@us.ibm.com>
Wed, 6 Nov 2002 11:12:56 +0000 (06:12 -0500)
committerJames Bottomley <jejb@mulgrave.(none)>
Wed, 6 Nov 2002 11:12:56 +0000 (06:12 -0500)
On Wed, Nov 06, 2002 at 01:50:00PM -0500, J.E.J. Bottomley wrote:
> I'm OK with that, since the drivers can be audited as they're moved over to
> slave attach.  It also works for drivers that use older hardware (like the
> 53c700) which don't call adjust_queue_depth from slave attach, but slightly
> later on when they've really verified the device will accept tags.  In this
> case, I don't want the mid layer to call adjust_queue_depth for me even if I
> leave slave_attach with only one command allocated.

OK, here it is again, as discussed, plus it calls scsi_release_commandblocks
on slave_attach failure.

drivers/scsi/scsi.c
drivers/scsi/scsi_syms.c

index 3e213de85da8af9bf514c776c73aa79248348fe9..723435a04508bf62ade7d0f7c0374b648d918202 100644 (file)
@@ -2019,26 +2019,24 @@ int scsi_slave_attach(struct scsi_device *sdev)
                /*
                 * No one was attached.
                 */
-               if ((sdev->host->hostt->slave_attach != NULL) &&
-                   (sdev->host->hostt->slave_attach(sdev) != 0)) {
-                       printk(KERN_INFO "scsi: failed low level driver"
-                              " attach, some SCSI device might not be"
-                              " configured\n");
-                       return 1;
-               }
-               if ((sdev->new_queue_depth == 0) &&
-                   (sdev->host->cmd_per_lun != 0))
-                       scsi_adjust_queue_depth(sdev, 0,
-                                               sdev->host->cmd_per_lun);
                scsi_build_commandblocks(sdev);
                if (sdev->current_queue_depth == 0) {
                        printk(KERN_ERR "scsi: Allocation failure during"
                               " attach, some SCSI devices might not be"
                               " configured\n");
-                       if (sdev->host->hostt->slave_detach != NULL)
-                               sdev->host->hostt->slave_detach(sdev);
                        return 1;
                }
+               if (sdev->host->hostt->slave_attach != NULL) {
+                       if (sdev->host->hostt->slave_attach(sdev) != 0) {
+                               printk(KERN_INFO "scsi: failed low level driver"
+                                      " attach, some SCSI device might not be"
+                                      " configured\n");
+                               scsi_release_commandblocks(sdev);
+                               return 1;
+                       }
+               } else if (sdev->host->cmd_per_lun != 0)
+                       scsi_adjust_queue_depth(sdev, 0,
+                                               sdev->host->cmd_per_lun);
        }
        return 0;
 }
index 44564637dbfb0d657874f18212d688b12df951ef..2bd4df57dd64cf657aacda37ff6cba38b550a78a 100644 (file)
@@ -82,6 +82,8 @@ EXPORT_SYMBOL(scsi_end_request);
 
 EXPORT_SYMBOL(scsi_register_blocked_host);
 EXPORT_SYMBOL(scsi_deregister_blocked_host);
+EXPORT_SYMBOL(scsi_slave_attach);
+EXPORT_SYMBOL(scsi_slave_detach);
 
 /*
  * This symbol is for the highlevel drivers (e.g. sg) only.