linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 05/12] megaraid_sas : Donot use PAGE_SIZE macro for calculation of max_sectors per IO request
@ 2015-10-15  8:10 sumit.saxena
  2015-10-16 14:44 ` Tomas Henzl
  0 siblings, 1 reply; 2+ messages in thread
From: sumit.saxena @ 2015-10-15  8:10 UTC (permalink / raw)
  To: linux-scsi, stable, thenzl, martin.petersen, hch, jbottomley,
	kashyap.desai, sumit.saxena, kiran-kumar.kasturi
  Cc: uday.lingala

Do not use PAGE_SIZE marco to calculate max_sectors per IO request. Driver code assumes PAGE_SIZE will be always 4096 which can do lead to wrongly calculated value if PAGE_SIZE is not 4096. This issue was reported in Ubuntu Bugzilla Bug #1475166.

Cc: <stable@vger.kernel.org>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
---
 drivers/scsi/megaraid/megaraid_sas.h      |    2 ++
 drivers/scsi/megaraid/megaraid_sas_base.c |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index d236cc2..fab7602 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -388,6 +388,8 @@ enum MR_EVT_ARGS {
 	MR_EVT_ARGS_GENERIC,
 };
 
+
+#define SGE_BUFFER_SIZE	4096
 /*
  * define constants for device list query options
  */
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 92c5bbe..6204a66 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -4871,7 +4871,7 @@ static int megasas_init_fw(struct megasas_instance *instance)
 
 
 	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))
 		instance->max_sectors_per_req = tmp_sectors;
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 05/12] megaraid_sas : Donot use PAGE_SIZE macro for calculation of max_sectors per IO request
  2015-10-15  8:10 [PATCH 05/12] megaraid_sas : Donot use PAGE_SIZE macro for calculation of max_sectors per IO request sumit.saxena
@ 2015-10-16 14:44 ` Tomas Henzl
  0 siblings, 0 replies; 2+ messages in thread
From: Tomas Henzl @ 2015-10-16 14:44 UTC (permalink / raw)
  To: sumit.saxena, linux-scsi, stable, martin.petersen, hch,
	jbottomley, kashyap.desai, kiran-kumar.kasturi
  Cc: uday.lingala

On 15.10.2015 10:10, sumit.saxena@avagotech.com wrote:
> Do not use PAGE_SIZE marco to calculate max_sectors per IO request. Driver code assumes PAGE_SIZE will be always 4096 which can do lead to wrongly calculated value if PAGE_SIZE is not 4096. This issue was reported in Ubuntu Bugzilla Bug #1475166.
>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>

Reviewed-by: Tomas Henzl <thenzl@redhat.com>

Tomas


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-16 14:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-15  8:10 [PATCH 05/12] megaraid_sas : Donot use PAGE_SIZE macro for calculation of max_sectors per IO request sumit.saxena
2015-10-16 14:44 ` Tomas Henzl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).