diff options
author | bo yang <bo.yang@lsi.com> | 2007-11-09 04:14:00 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-01-11 19:22:43 -0500 |
commit | 14faea9f7fe1e8805629b50cf14a65a85fe4a4fd (patch) | |
tree | 10440492118c4d7c49eced392e0f1e4667933924 | |
parent | 31ea7088974c2405e19d72f17c2afb103ef19e02 (diff) |
[SCSI] megaraid_sas: check max_sgl reported by FW for setting max_sectors_per_req
1. Setting the max_sectors_per_req based on max SGL supported by the
FW. Prior versions calculated this value from controller info's
max_sectors_1, max_sectors_2. For certain controllers/FW, this was
resulting in a value greater than max SGL supported by the FW. Now
we take the min of max sgl from FW and max_sectors calculation.
2. Increased MFI_POLL_TIMEOUT_SECS to 60 seconds from 10. FW may take
a max of 60 seconds to respond to the INIT cmd.
Signed-off-by: Bo Yang <bo.yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas.c | 14 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas.h | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c index 9aee2544798c..7eefbe0681d6 100644 --- a/drivers/scsi/megaraid/megaraid_sas.c +++ b/drivers/scsi/megaraid/megaraid_sas.c | |||
@@ -1890,6 +1890,7 @@ static int megasas_init_mfi(struct megasas_instance *instance) | |||
1890 | u32 reply_q_sz; | 1890 | u32 reply_q_sz; |
1891 | u32 max_sectors_1; | 1891 | u32 max_sectors_1; |
1892 | u32 max_sectors_2; | 1892 | u32 max_sectors_2; |
1893 | u32 tmp_sectors; | ||
1893 | struct megasas_register_set __iomem *reg_set; | 1894 | struct megasas_register_set __iomem *reg_set; |
1894 | struct megasas_ctrl_info *ctrl_info; | 1895 | struct megasas_ctrl_info *ctrl_info; |
1895 | /* | 1896 | /* |
@@ -1982,17 +1983,20 @@ static int megasas_init_mfi(struct megasas_instance *instance) | |||
1982 | * Note that older firmwares ( < FW ver 30) didn't report information | 1983 | * Note that older firmwares ( < FW ver 30) didn't report information |
1983 | * to calculate max_sectors_1. So the number ended up as zero always. | 1984 | * to calculate max_sectors_1. So the number ended up as zero always. |
1984 | */ | 1985 | */ |
1986 | tmp_sectors = 0; | ||
1985 | if (ctrl_info && !megasas_get_ctrl_info(instance, ctrl_info)) { | 1987 | if (ctrl_info && !megasas_get_ctrl_info(instance, ctrl_info)) { |
1986 | 1988 | ||
1987 | max_sectors_1 = (1 << ctrl_info->stripe_sz_ops.min) * | 1989 | max_sectors_1 = (1 << ctrl_info->stripe_sz_ops.min) * |
1988 | ctrl_info->max_strips_per_io; | 1990 | ctrl_info->max_strips_per_io; |
1989 | max_sectors_2 = ctrl_info->max_request_size; | 1991 | max_sectors_2 = ctrl_info->max_request_size; |
1990 | 1992 | ||
1991 | instance->max_sectors_per_req = (max_sectors_1 < max_sectors_2) | 1993 | tmp_sectors = min_t(u32, max_sectors_1 , max_sectors_2); |
1992 | ? max_sectors_1 : max_sectors_2; | 1994 | } |
1993 | } else | 1995 | |
1994 | instance->max_sectors_per_req = instance->max_num_sge * | 1996 | instance->max_sectors_per_req = instance->max_num_sge * |
1995 | PAGE_SIZE / 512; | 1997 | PAGE_SIZE / 512; |
1998 | if (tmp_sectors && (instance->max_sectors_per_req > tmp_sectors)) | ||
1999 | instance->max_sectors_per_req = tmp_sectors; | ||
1996 | 2000 | ||
1997 | kfree(ctrl_info); | 2001 | kfree(ctrl_info); |
1998 | 2002 | ||
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index f4ab30094621..9739023a222c 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h | |||
@@ -571,7 +571,7 @@ struct megasas_ctrl_info { | |||
571 | #define IS_DMA64 (sizeof(dma_addr_t) == 8) | 571 | #define IS_DMA64 (sizeof(dma_addr_t) == 8) |
572 | 572 | ||
573 | #define MFI_OB_INTR_STATUS_MASK 0x00000002 | 573 | #define MFI_OB_INTR_STATUS_MASK 0x00000002 |
574 | #define MFI_POLL_TIMEOUT_SECS 10 | 574 | #define MFI_POLL_TIMEOUT_SECS 60 |
575 | 575 | ||
576 | #define MFI_REPLY_1078_MESSAGE_INTERRUPT 0x80000000 | 576 | #define MFI_REPLY_1078_MESSAGE_INTERRUPT 0x80000000 |
577 | 577 | ||