scsi: megaraid_sas: set minimum value of resetwaittime to be 1 secs
authorShivasharan S <shivasharan.srikanteshwara@broadcom.com>
Wed, 23 Aug 2017 11:46:56 +0000 (04:46 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 25 Aug 2017 02:29:10 +0000 (22:29 -0400)
Setting resetwaittime to 0 during a FW fault will result in driver not
calling the OCR.

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Cc: stable@vger.kernel.org
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/megaraid/megaraid_sas_base.c

index 5202c2fd72ac3f2eb5ae2228302e233b9b94b45f..2c309ec33696d30d4c16098cbf665a9b4c58eadd 100644 (file)
@@ -5479,7 +5479,8 @@ static int megasas_init_fw(struct megasas_instance *instance)
                instance->throttlequeuedepth =
                                MEGASAS_THROTTLE_QUEUE_DEPTH;
 
-       if (resetwaittime > MEGASAS_RESET_WAIT_TIME)
+       if ((resetwaittime < 1) ||
+           (resetwaittime > MEGASAS_RESET_WAIT_TIME))
                resetwaittime = MEGASAS_RESET_WAIT_TIME;
 
        if ((scmd_timeout < 10) || (scmd_timeout > MEGASAS_DEFAULT_CMD_TIMEOUT))