From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CFBFBECAAD1 for ; Tue, 30 Aug 2022 17:23:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PDvf8ow7Ph2dJzdta3Z3UasBAtg4z0gxfFWRVE0B2BI=; b=eQw6hdyZDYYW9X 5de8iVB/UxqCQsTC9zlGSSKOX1G+OO0wlB9EUJrPaWfM/eDhtWB+UzV52E3isGoqipGCIBvVKxYy7 DisLZK22g5oLntFxXRvpG1n8YQkZG7A7mbBCsPXNFQxXozeOpMSOIxL0lRMuIUkgN9lhk5CBEKfGM iseg7FSB7YIjzxwmmi7hnFxCR6HFafxq4n+e1aLxDd0MQISYWiBt88YGcKBPbF/uRc0VlMZS35TDj y+hC6IItY4zYJcS+CiWHx1u1+jTWAY1av89NZvGtpOcH3xVAGKQt07xiZ9WrQ38Qd+XdPSvCuOJxC sgAckV2m465RWV8hBU4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oT4wS-000n8p-SY; Tue, 30 Aug 2022 17:22:25 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oT4wP-000n5z-Am; Tue, 30 Aug 2022 17:22:22 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id ED70CB81D14; Tue, 30 Aug 2022 17:22:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED4C7C433C1; Tue, 30 Aug 2022 17:22:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661880138; bh=mbw7MSPR3g4EtRoj9xhwty39pKwBVqgVI8IGo4q1OC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IF+2Y1sx24FtRDdhwmgYxZ3eGfKe008sG5nYQibJQUgTkEDpOhlGBPbi2iq5ewTjX q2D6v9tEVH2X36A1+9Sb1gLgUi2QRG34bgMCks0YjYlf8/eBDDxK2EH9yKq9e8iRCz rGzKYZX9bu0WTKOTc71qfPYCV6PbQEU0+LKgdJk38Ed105szXm2pKSTll7DJEG3uiH tUEqL+1Q8JqyGS6gSRvk1rnFmQuqQMGpcsJjlXIavf/S5qjXsgYOoEepX/1Ywj614D a6DL5RamroTmHEaA32yf/xdEdgtKIo8s1AJfmA/5aaTQBodaADLGaG4JN5vOzhpEnc p8TTWw7NeIWBQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Bart Van Assche , Stanley Chu , "Martin K . Petersen" , Sasha Levin , jejb@linux.ibm.com, matthias.bgg@gmail.com, beanhuo@micron.com, avri.altman@wdc.com, adrian.hunter@intel.com, j-young.choi@samsung.com, linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH AUTOSEL 5.15 09/23] scsi: ufs: core: Reduce the power mode change timeout Date: Tue, 30 Aug 2022 13:21:26 -0400 Message-Id: <20220830172141.581086-9-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220830172141.581086-1-sashal@kernel.org> References: <20220830172141.581086-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220830_102221_547521_D1E42EA8 X-CRM114-Status: GOOD ( 13.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Bart Van Assche [ Upstream commit 8f2c96420c6ec3dcb18c8be923e24c6feaa5ccf6 ] The current power mode change timeout (180 s) is so large that it can cause a watchdog timer to fire. Reduce the power mode change timeout to 10 seconds. Link: https://lore.kernel.org/r/20220811234401.1957911-1-bvanassche@acm.org Reviewed-by: Stanley Chu Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/ufs/ufshcd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 2f6468f22b489..dae1a85f1512c 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -8476,6 +8476,8 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba, struct scsi_device *sdp; unsigned long flags; int ret, retries; + unsigned long deadline; + int32_t remaining; spin_lock_irqsave(hba->host->host_lock, flags); sdp = hba->sdev_ufs_device; @@ -8508,9 +8510,14 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba, * callbacks hence set the RQF_PM flag so that it doesn't resume the * already suspended childs. */ + deadline = jiffies + 10 * HZ; for (retries = 3; retries > 0; --retries) { + ret = -ETIMEDOUT; + remaining = deadline - jiffies; + if (remaining <= 0) + break; ret = scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, &sshdr, - START_STOP_TIMEOUT, 0, 0, RQF_PM, NULL); + remaining / HZ, 0, 0, RQF_PM, NULL); if (!scsi_status_is_check_condition(ret) || !scsi_sense_valid(&sshdr) || sshdr.sense_key != UNIT_ATTENTION) -- 2.35.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel