From patchwork Mon Oct 26 21:31:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Asutosh Das \(asd\)" X-Patchwork-Id: 287058 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=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 BB693C388F9 for ; Mon, 26 Oct 2020 21:37:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A36B21655 for ; Mon, 26 Oct 2020 21:37:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389893AbgJZVhZ (ORCPT ); Mon, 26 Oct 2020 17:37:25 -0400 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:59929 "EHLO alexa-out-sd-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389424AbgJZVhZ (ORCPT ); Mon, 26 Oct 2020 17:37:25 -0400 X-Greylist: delayed 365 seconds by postgrey-1.27 at vger.kernel.org; Mon, 26 Oct 2020 17:37:25 EDT Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-02.qualcomm.com with ESMTP; 26 Oct 2020 14:31:19 -0700 X-QCInternal: smtphost Received: from asutoshd-linux1.qualcomm.com ([10.46.160.39]) by ironmsg04-sd.qualcomm.com with ESMTP; 26 Oct 2020 14:31:18 -0700 Received: by asutoshd-linux1.qualcomm.com (Postfix, from userid 92687) id 7A6D820DDC; Mon, 26 Oct 2020 14:31:18 -0700 (PDT) From: Asutosh Das To: cang@codeaurora.org, martin.petersen@oracle.com, linux-scsi@vger.kernel.org Cc: "Bao D. Nguyen" , linux-arm-msm@vger.kernel.org, Asutosh Das , Alim Akhtar , Avri Altman , "James E.J. Bottomley" , Stanley Chu , Bean Huo , Bart Van Assche , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1 1/1] scsi: ufs: Keep UFS regulators on when autobkops enabled Date: Mon, 26 Oct 2020 14:31:10 -0700 Message-ID: <6fd8e4d88eb331c9f04c74a3581593961f2caf73.1603747748.git.asutoshd@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Message-ID: <20201026213110.mX-CE94H2PT_FGBt-CpLbjfayxOjzZ10SPRZh8OaBX4@z> From: "Bao D. Nguyen" When bkops is enabled, the UFS device may do bkops during suspend. With bkops enabled during suspend, keep the regulators in active operation configuration, allowing the device to draw high power to support bkops and avoid over current event. Signed-off-by: Bao D. Nguyen Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 47c544d..a94543c 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -8523,7 +8523,9 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op) if (ret) goto set_dev_active; - ufshcd_vreg_set_lpm(hba); + /* Device may perform bkops if autobkops is enabled */ + if (!hba->auto_bkops_enabled) + ufshcd_vreg_set_lpm(hba); disable_clks: /*