Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5996255ybc; Wed, 27 Nov 2019 13:06:46 -0800 (PST) X-Google-Smtp-Source: APXvYqwS0XmZlOJaL8QsS9rJ4hsCUgMh41pr/BzLEDcCQkY0nO5pbGlu98kGcvyAS1+JwZ29AUKo X-Received: by 2002:a50:b5e4:: with SMTP id a91mr34516810ede.299.1574888806641; Wed, 27 Nov 2019 13:06:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574888806; cv=none; d=google.com; s=arc-20160816; b=ers57h3E4jBrbk9Bdiey9xtBM0uuPWadmNCdddR8wGSXSpmCawwHcfTFZMQZfXit4g m6LD06X9/Oy18jRbE9XeD9q6IN6wfbpRLlj3sUb/bWxsn0/qu5i9N0snnWOXdn3WDvd/ qZxZeHvo3xSQGodAIP7b1AUqFhXABnKtq/wIRbXB/BLmYL0aCuY6AT9bG9qGHyGsFODt MM3G5pRx7KYfrEv1o+rUKbxewf8Exn/FufZo2lAPaKtkC4Xdn3r2wuAUdL/x/mSGJFS0 j0JRcC35x5xGCe1R/XOtzrMxTLlMak2evJt5awHH7szyRtqnFhVy/sMFV8wx7tJ7ZXIY rhHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ca2+xYn/xbFeU/2M3VxkDiejgZGUc+D6+ZaXVgbNFJ4=; b=jOho9J25XDPG9amkovJILOAAtUhQzPVMeRiK4qgKnIA3wztmXdx3wFHHPMO8F0mOpr TRFuJfUv/rbfzi1z/IZqbSMbTkGztYr3da4OPuDp3uAcna9G3is2O5cOTPH5TIWBaFfD thNpROPBLGR2KzKrByBEwEiMoC/09T0bNKUFIl+8Cx/lBhK4qxlXV2cJKURSErXMf6vI uwTM0Da8G9CVex9lC2QM3WBR0zY4BRjuQVGy3qSYG7p4LDpDb2oaxjxCktUGtB6l+Apd PGcXdUALE3fV+W9r+hfRsEmeor63UTBxtAV8pwLQ0sodoKZpnId5iwnLOitQ7Cb5Q2Vq giPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BvDWfFUM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v12si1382224edr.222.2019.11.27.13.06.23; Wed, 27 Nov 2019 13:06:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BvDWfFUM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732194AbfK0VEt (ORCPT + 99 others); Wed, 27 Nov 2019 16:04:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:58304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731580AbfK0VEo (ORCPT ); Wed, 27 Nov 2019 16:04:44 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0896121771; Wed, 27 Nov 2019 21:04:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888683; bh=rzlFMkmivZ6Tw8GRPSvnVO/UpRCEyuNnI37LYXz/4rg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BvDWfFUMGk1zGlzFF4Kc9X8CnBsNY4SW2of1vfRgvgr0GbJwz48aKVlCaRx9REjeE SoABjal1ZAW2qlQj4DhtA39cwVu/uROCfOgI8VDASrkeuKtX3MRRGBUvzD1CfGOcb8 XEYmAMdWCDuG7vRPk9GpDqTmnszC6dPS3T8JTBqQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shivasharan S , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.19 227/306] scsi: megaraid_sas: Fix msleep granularity Date: Wed, 27 Nov 2019 21:31:17 +0100 Message-Id: <20191127203131.617510989@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shivasharan S [ Upstream commit 9155cf30a3c4ef97e225d6daddf9bd4b173267e8 ] In megasas_transition_to_ready() driver waits 180seconds for controller to change FW state. Here we are calling msleep(1) in a loop for this. As explained in timers-howto.txt, msleep(1) will actually sleep longer than 1ms. If a faulty controller is connected, we will end up waiting for much more than 180 seconds causing unnecessary delays during load. Change the granularity of msleep() call from 1ms to 1000ms. Signed-off-by: Shivasharan S Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/megaraid/megaraid_sas_base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index bc37666f998e6..2f94ab9c23540 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -3894,12 +3894,12 @@ megasas_transition_to_ready(struct megasas_instance *instance, int ocr) /* * The cur_state should not last for more than max_wait secs */ - for (i = 0; i < (max_wait * 1000); i++) { + for (i = 0; i < max_wait; i++) { curr_abs_state = instance->instancet-> read_fw_status_reg(instance->reg_set); if (abs_state == curr_abs_state) { - msleep(1); + msleep(1000); } else break; } -- 2.20.1