Commit c1f1362d authored by sumit.saxena@avagotech.com's avatar sumit.saxena@avagotech.com Committed by Kamal Mostafa

megaraid_sas: Do not use PAGE_SIZE for max_sectors

commit 357ae967 upstream.

Do not use PAGE_SIZE marco to calculate max_sectors per I/O
request. Driver code assumes PAGE_SIZE will be always 4096 which can
lead to wrongly calculated value if PAGE_SIZE is not 4096. This issue
was reported in Ubuntu Bugzilla Bug #1475166.
Signed-off-by: default avatarSumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: default avatarKashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: default avatarTomas Henzl <thenzl@redhat.com>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent dbefeb69
...@@ -360,6 +360,8 @@ enum MR_EVT_ARGS { ...@@ -360,6 +360,8 @@ enum MR_EVT_ARGS {
MR_EVT_ARGS_GENERIC, MR_EVT_ARGS_GENERIC,
}; };
#define SGE_BUFFER_SIZE 4096
/* /*
* define constants for device list query options * define constants for device list query options
*/ */
......
...@@ -4661,7 +4661,7 @@ static int megasas_init_fw(struct megasas_instance *instance) ...@@ -4661,7 +4661,7 @@ static int megasas_init_fw(struct megasas_instance *instance)
instance->crash_dump_buf = NULL; instance->crash_dump_buf = NULL;
} }
instance->max_sectors_per_req = instance->max_num_sge * instance->max_sectors_per_req = instance->max_num_sge *
PAGE_SIZE / 512; SGE_BUFFER_SIZE / 512;
if (tmp_sectors && (instance->max_sectors_per_req > tmp_sectors)) if (tmp_sectors && (instance->max_sectors_per_req > tmp_sectors))
instance->max_sectors_per_req = tmp_sectors; instance->max_sectors_per_req = tmp_sectors;
......
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