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: 11858855 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 21EEE92C for ; Mon, 26 Oct 2020 21:37:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0723E2084C for ; Mon, 26 Oct 2020 21:37:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389885AbgJZVhZ (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-arm-msm@vger.kernel.org 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: /*