Commit b579dd43 authored by James Bottomley's avatar James Bottomley

Fix the max_sectors warning afflicting some host adapter drivers

Also merge in missing printk \n's noticed by Robert Love
parent 7984899a
......@@ -485,17 +485,10 @@ int scsi_register_host(Scsi_Host_Template *shost_tp)
BUG_ON(!shost_tp->detect);
if (!shost_tp->max_sectors) {
printk(KERN_WARNING
"scsi HBA driver %s didn't set max_sectors, "
"please fix the template", shost_tp->name);
shost_tp->max_sectors = 1024;
}
if (!shost_tp->release) {
printk(KERN_WARNING
"scsi HBA driver %s didn't set a release method, "
"please fix the template", shost_tp->name);
"please fix the template\n", shost_tp->name);
shost_tp->release = &scsi_host_legacy_release;
}
......
......@@ -177,6 +177,13 @@ void scsi_initialize_queue(Scsi_Device * SDpnt, struct Scsi_Host * SHpnt)
*/
blk_queue_max_phys_segments(q, MAX_PHYS_SEGMENTS);
if(!SHpnt->max_sectors)
/* driver imposes no hard sector transfer limit.
* start at machine infinity initially */
SHpnt->max_sectors = SCSI_DEFAULT_MAX_SECTORS;
/* FIXME: we should also adjust this limit later on
* after we know what the device capabilities are */
blk_queue_max_sectors(q, SHpnt->max_sectors);
if (!SHpnt->use_clustering)
......
......@@ -373,6 +373,14 @@ extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE];
#define ASKED_FOR_SENSE 0x20
#define SYNC_RESET 0x40
/*
* This specifies "machine infinity" for host templates which don't
* limit the transfer size. Note this limit represents an absolute
* maximum, and may be over the transfer limits allowed for individual
* devices (e.g. 256 for SCSI-1)
*/
#define SCSI_DEFAULT_MAX_SECTORS 1024
/*
* This is the crap from the old error handling code. We have it in a special
* place so that we can more easily delete it later on.
......
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