From patchwork Thu Jan 28 02:42:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Can Guo X-Patchwork-Id: 12051655 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 506F5C433E0 for ; Thu, 28 Jan 2021 02:45:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 05AF664DD3 for ; Thu, 28 Jan 2021 02:45:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229563AbhA1Coq (ORCPT ); Wed, 27 Jan 2021 21:44:46 -0500 Received: from labrats.qualcomm.com ([199.106.110.90]:15550 "EHLO labrats.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbhA1Cop (ORCPT ); Wed, 27 Jan 2021 21:44:45 -0500 IronPort-SDR: 1qfe8KWQ0zsYJ5yIEG2EWBqzePd7ksZfUONk2nY6ktZh+Z8fNvPtQ9JZvzqVZr7CZi6l71BabH 38SBqK54tlA5OQ3HCtwI34WYYu4aBNOQogjfPaWYjaVh3FabEJDYgKwVmEQ0ofQUqVo/ljNDQ+ Vj1pLBT2zFoKcIic2jTr1bHuknTt0UKLN1cly4a+TI0rkOxQJKAWVIexTWlVRCWmZylfHwwnwG Avhemo4rL3IPrNhoTx5KPq/DcsEzitJbj7d1XuNiLB3EADpx3dU1IiNNVWveGKMAAkVwHfaFYL EbY= X-IronPort-AV: E=Sophos;i="5.79,381,1602572400"; d="scan'208";a="47715382" Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by labrats.qualcomm.com with ESMTP; 27 Jan 2021 18:44:06 -0800 X-QCInternal: smtphost Received: from wsp769891wss.qualcomm.com (HELO stor-presley.qualcomm.com) ([192.168.140.85]) by ironmsg03-sd.qualcomm.com with ESMTP; 27 Jan 2021 18:44:04 -0800 Received: by stor-presley.qualcomm.com (Postfix, from userid 359480) id CD0CB219CD; Wed, 27 Jan 2021 18:44:04 -0800 (PST) From: Can Guo To: jaegeuk@kernel.org, asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, bjorn.andersson@linaro.org, linux-scsi@vger.kernel.org, kernel-team@android.com, cang@codeaurora.org Cc: Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Stanley Chu , Bean Huo , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] scsi: ufs: Give clk scaling min gear a value Date: Wed, 27 Jan 2021 18:42:42 -0800 Message-Id: <1611801769-20561-1-git-send-email-cang@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The initialization of clk_scaling.min_gear by mistake. This change adds it back, otherwise clock scaling down would fail. Fixes: 4543d9d78227 ("scsi: ufs: Refactor ufshcd_init/exit_clk_scaling/gating()") Signed-off-by: Can Guo diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 36bcbb3..8ef6796 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -1602,6 +1602,9 @@ static void ufshcd_init_clk_scaling(struct ufs_hba *hba) if (!ufshcd_is_clkscaling_supported(hba)) return; + if (!hba->clk_scaling.min_gear) + hba->clk_scaling.min_gear = UFS_HS_G1; + INIT_WORK(&hba->clk_scaling.suspend_work, ufshcd_clk_scaling_suspend_work); INIT_WORK(&hba->clk_scaling.resume_work,