aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas
diff options
context:
space:
mode:
authorKashyap, Desai <kashyap.desai@lsi.com>2011-06-14 01:26:12 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-06-29 17:15:00 -0400
commita3e1e55e4b5ca4d49618c592b4d10814e21e12a7 (patch)
treefce4875375a44e4374fb57fa7cdfab8f74cdf2de /drivers/scsi/mpt2sas
parentce7b1810def1e2f0101931f8f339f9d8a694cd19 (diff)
[SCSI] mpt2sas: Set max_sector count from module parameter
This feature is to override the default max_sectors setting at load time, taking max_sectors as an command line option when loading the driver. The setting is currently hard-coded in the driver to 8192 sectors (4MB transfers). If max_sectors is specified at load time, minimum specified setting will be 64, and the maximum is 8192. The driver will modify the setting to be on even boundary. If max_sectors is not specified, the driver will default to 8192. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/mpt2sas')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_scsih.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index e327a3c03608..f86f2b1418e7 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -94,6 +94,10 @@ static u32 logging_level;
94MODULE_PARM_DESC(logging_level, " bits for enabling additional logging info " 94MODULE_PARM_DESC(logging_level, " bits for enabling additional logging info "
95 "(default=0)"); 95 "(default=0)");
96 96
97static ushort max_sectors = 0xFFFF;
98module_param(max_sectors, ushort, 0);
99MODULE_PARM_DESC(max_sectors, "max sectors, range 64 to 8192 default=8192");
100
97/* scsi-mid layer global parmeter is max_report_luns, which is 511 */ 101/* scsi-mid layer global parmeter is max_report_luns, which is 511 */
98#define MPT2SAS_MAX_LUN (16895) 102#define MPT2SAS_MAX_LUN (16895)
99static int max_lun = MPT2SAS_MAX_LUN; 103static int max_lun = MPT2SAS_MAX_LUN;
@@ -7436,6 +7440,25 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
7436 shost->transportt = mpt2sas_transport_template; 7440 shost->transportt = mpt2sas_transport_template;
7437 shost->unique_id = ioc->id; 7441 shost->unique_id = ioc->id;
7438 7442
7443 if (max_sectors != 0xFFFF) {
7444 if (max_sectors < 64) {
7445 shost->max_sectors = 64;
7446 printk(MPT2SAS_WARN_FMT "Invalid value %d passed "
7447 "for max_sectors, range is 64 to 8192. Assigning "
7448 "value of 64.\n", ioc->name, max_sectors);
7449 } else if (max_sectors > 8192) {
7450 shost->max_sectors = 8192;
7451 printk(MPT2SAS_WARN_FMT "Invalid value %d passed "
7452 "for max_sectors, range is 64 to 8192. Assigning "
7453 "default value of 8192.\n", ioc->name,
7454 max_sectors);
7455 } else {
7456 shost->max_sectors = max_sectors & 0xFFFE;
7457 printk(MPT2SAS_INFO_FMT "The max_sectors value is "
7458 "set to %d\n", ioc->name, shost->max_sectors);
7459 }
7460 }
7461
7439 if ((scsi_add_host(shost, &pdev->dev))) { 7462 if ((scsi_add_host(shost, &pdev->dev))) {
7440 printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", 7463 printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
7441 ioc->name, __FILE__, __LINE__, __func__); 7464 ioc->name, __FILE__, __LINE__, __func__);