aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYang, Bo <Bo.Yang@lsi.com>2010-10-12 09:18:50 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-10-26 12:06:03 -0400
commit1fd106851698e9a858d20ab0e0f0afd5e9ec9332 (patch)
tree5e0086317a354a50f67bd50bc117a363f35b68e4
parent837f5fe89c843422452ef5e1a7e3d20e9caa3268 (diff)
[SCSI] megaraid_sas: Add input parameter for max_sectors
Driver add the input parameters support for max_sectors for megaraid sas gen2 chip. Customer can set the max_sectors support to 1MB for gen2 chip during the driver load. Signed-off-by Bo Yang <bo.yang@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--drivers/scsi/megaraid/megaraid_sas.c30
-rw-r--r--drivers/scsi/megaraid/megaraid_sas.h1
2 files changed, 31 insertions, 0 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
index 09a455d4b6ed..41ffc205724f 100644
--- a/drivers/scsi/megaraid/megaraid_sas.c
+++ b/drivers/scsi/megaraid/megaraid_sas.c
@@ -56,6 +56,15 @@ module_param_named(poll_mode_io, poll_mode_io, int, 0);
56MODULE_PARM_DESC(poll_mode_io, 56MODULE_PARM_DESC(poll_mode_io,
57 "Complete cmds from IO path, (default=0)"); 57 "Complete cmds from IO path, (default=0)");
58 58
59/*
60 * Number of sectors per IO command
61 * Will be set in megasas_init_mfi if user does not provide
62 */
63static unsigned int max_sectors;
64module_param_named(max_sectors, max_sectors, int, 0);
65MODULE_PARM_DESC(max_sectors,
66 "Maximum number of sectors per IO command");
67
59MODULE_LICENSE("GPL"); 68MODULE_LICENSE("GPL");
60MODULE_VERSION(MEGASAS_VERSION); 69MODULE_VERSION(MEGASAS_VERSION);
61MODULE_AUTHOR("megaraidlinux@lsi.com"); 70MODULE_AUTHOR("megaraidlinux@lsi.com");
@@ -3586,6 +3595,27 @@ static int megasas_io_attach(struct megasas_instance *instance)
3586 instance->max_fw_cmds - MEGASAS_INT_CMDS; 3595 instance->max_fw_cmds - MEGASAS_INT_CMDS;
3587 host->this_id = instance->init_id; 3596 host->this_id = instance->init_id;
3588 host->sg_tablesize = instance->max_num_sge; 3597 host->sg_tablesize = instance->max_num_sge;
3598 /*
3599 * Check if the module parameter value for max_sectors can be used
3600 */
3601 if (max_sectors && max_sectors < instance->max_sectors_per_req)
3602 instance->max_sectors_per_req = max_sectors;
3603 else {
3604 if (max_sectors) {
3605 if (((instance->pdev->device ==
3606 PCI_DEVICE_ID_LSI_SAS1078GEN2) ||
3607 (instance->pdev->device ==
3608 PCI_DEVICE_ID_LSI_SAS0079GEN2)) &&
3609 (max_sectors <= MEGASAS_MAX_SECTORS)) {
3610 instance->max_sectors_per_req = max_sectors;
3611 } else {
3612 printk(KERN_INFO "megasas: max_sectors should be > 0"
3613 "and <= %d (or < 1MB for GEN2 controller)\n",
3614 instance->max_sectors_per_req);
3615 }
3616 }
3617 }
3618
3589 host->max_sectors = instance->max_sectors_per_req; 3619 host->max_sectors = instance->max_sectors_per_req;
3590 host->cmd_per_lun = 128; 3620 host->cmd_per_lun = 128;
3591 host->max_channel = MEGASAS_MAX_CHANNELS - 1; 3621 host->max_channel = MEGASAS_MAX_CHANNELS - 1;
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index 16a4f68a34b0..54d1a154b448 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -706,6 +706,7 @@ struct megasas_ctrl_info {
706#define MEGASAS_MAX_LD_IDS (MEGASAS_MAX_LD_CHANNELS * \ 706#define MEGASAS_MAX_LD_IDS (MEGASAS_MAX_LD_CHANNELS * \
707 MEGASAS_MAX_DEV_PER_CHANNEL) 707 MEGASAS_MAX_DEV_PER_CHANNEL)
708 708
709#define MEGASAS_MAX_SECTORS (2*1024)
709#define MEGASAS_DBG_LVL 1 710#define MEGASAS_DBG_LVL 1
710 711
711#define MEGASAS_FW_BUSY 1 712#define MEGASAS_FW_BUSY 1