Commit f4e01df0 authored by Patrick Mansfield's avatar Patrick Mansfield Committed by James Bottomley

Re: [PATCH] fix 2.5 scsi queue depth setting

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.
parent 6647da0e
......@@ -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;
}
......
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment