Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257818
b: refs/heads/master
c: a3e1e55
h: refs/heads/master
v: v3
  • Loading branch information
Kashyap, Desai authored and James Bottomley committed Jun 29, 2011
1 parent bd71a74 commit 2e86c0e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ce7b1810def1e2f0101931f8f339f9d8a694cd19
refs/heads/master: a3e1e55e4b5ca4d49618c592b4d10814e21e12a7
23 changes: 23 additions & 0 deletions trunk/drivers/scsi/mpt2sas/mpt2sas_scsih.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ static u32 logging_level;
MODULE_PARM_DESC(logging_level, " bits for enabling additional logging info "
"(default=0)");

static ushort max_sectors = 0xFFFF;
module_param(max_sectors, ushort, 0);
MODULE_PARM_DESC(max_sectors, "max sectors, range 64 to 8192 default=8192");

/* scsi-mid layer global parmeter is max_report_luns, which is 511 */
#define MPT2SAS_MAX_LUN (16895)
static int max_lun = MPT2SAS_MAX_LUN;
Expand Down Expand Up @@ -7436,6 +7440,25 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
shost->transportt = mpt2sas_transport_template;
shost->unique_id = ioc->id;

if (max_sectors != 0xFFFF) {
if (max_sectors < 64) {
shost->max_sectors = 64;
printk(MPT2SAS_WARN_FMT "Invalid value %d passed "
"for max_sectors, range is 64 to 8192. Assigning "
"value of 64.\n", ioc->name, max_sectors);
} else if (max_sectors > 8192) {
shost->max_sectors = 8192;
printk(MPT2SAS_WARN_FMT "Invalid value %d passed "
"for max_sectors, range is 64 to 8192. Assigning "
"default value of 8192.\n", ioc->name,
max_sectors);
} else {
shost->max_sectors = max_sectors & 0xFFFE;
printk(MPT2SAS_INFO_FMT "The max_sectors value is "
"set to %d\n", ioc->name, shost->max_sectors);
}
}

if ((scsi_add_host(shost, &pdev->dev))) {
printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
ioc->name, __FILE__, __LINE__, __func__);
Expand Down

0 comments on commit 2e86c0e

Please sign in to comment.