Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1862195ybg; Thu, 24 Oct 2019 01:00:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyiT1qzBT2+/IIxHV3qAxmZPI+naPEa19fx0HJOPTj/op4vG0Oh+eznUnvktvGYNxtr680J X-Received: by 2002:a17:906:76c9:: with SMTP id q9mr36421138ejn.53.1571904006791; Thu, 24 Oct 2019 01:00:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571904006; cv=none; d=google.com; s=arc-20160816; b=vVjwijAGV0k/AIJaNqdVJNxORqmcaFdEqJ72sReINM8C8viugR+le09Q2ODnGPj4jy G8nOyqqpnHobWFyHySwDdg06P5WftJ2xFAp88/0nbzznjXIKwozkODSwJvYpWhGHEfNf DFfetLUNPjn5Mo4HOzw74w3g5wJJl49BqWrLeZ4nWS5qHuogVn054dQj0lDCh6uhWe/E XDYo1VFOj8Bx1pwaiO1HPPYkaJ4pMqtzPp1wv3J3QNrsqpNaRzRq3E3yHpNRMWrwS4M1 PWEBXarX9ST0BkNyLtg0QCYv+GXj6AYrm63KjKI5Sl4GqUGyH4shwLTWvyt7C8uJFAcQ mpRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:ironport-sdr; bh=aSmw5gDNrIjBC6E7B+QfBsOMPMDi1Z9/pxHtV0FcMtM=; b=P8OHaHVXCSCAmb5YelWv8m56Sq2Qt5Ph8H0JhcnTewwNdziNV491fWl8gXkORDfevE lPmg/Xv7bBSeRNbGmqPJvUvp35CBJPSlo0mapVg5ineKve040QmztYYT4srT6ywfO8g6 taGClNoTYAzKLKSWDqLW+g6o2gLK3atQibX6ay7sO5c5TFkR+ZxZlUOp9QNwDEeuAYS1 1onX45DBHn3NAlvtQNLdCuiZLZMG9RyxXFSwItNP4bSDzC8jw53MWYKWkaYVm7E+tEM8 H3jbNWeyCh1XHJtBD55f97IZRc6X3NxQbTpGy/97F7A/BrTyqYAGeyIlHyulb+Edi29R VqVg== ARC-Authentication-Results: i=1; mx.google.com; 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 bq16si14133244ejb.221.2019.10.24.00.59.42; Thu, 24 Oct 2019 01:00:06 -0700 (PDT) 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; 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 S2405115AbfJWQjz (ORCPT + 99 others); Wed, 23 Oct 2019 12:39:55 -0400 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]:34133 "EHLO alexa-out-sd-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389276AbfJWQjy (ORCPT ); Wed, 23 Oct 2019 12:39:54 -0400 Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-01.qualcomm.com with ESMTP; 23 Oct 2019 09:39:53 -0700 IronPort-SDR: mz+7h+OMI2ZZzTJNYiSIiPnZ+ZG1mjzsBPpUklpGAlY0DxT8efTlRrD9pMsJlhl1LjTnc5ViLw jWuuPWdF7G/KtV6HCIvF7f9zCcM1/zAhUZ+6s+DxXf9WaL8735LK8QS4MqTeOf1YDlz/WyJD5a BuXeBHVYtY5bxIr710jiT7hS2ZmVN1NNxU0Y2mXiz4uL9vanZ3hTk67qr/ArilKed2iKHF0K8c FDiGmMq69mwL9Mx1QYM5GCMBkFiHScJBa/gIvIDUtPYQnwfAwIoYHxx+d62W/bMIsTs3N0Ojp6 m3hC8/tmmJFX9fpGwj6hH+ND Received: from asutoshd-linux1.qualcomm.com ([10.46.160.39]) by ironmsg01-sd.qualcomm.com with ESMTP; 23 Oct 2019 09:39:52 -0700 Received: by asutoshd-linux1.qualcomm.com (Postfix, from userid 92687) id 98C1F2135F; Wed, 23 Oct 2019 09:39:52 -0700 (PDT) From: Asutosh Das To: cang@codeaurora.org, rnayak@codeaurora.org, vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, kernel-team@android.com, saravanak@google.com, salyzyn@google.com, Asutosh Das , Andy Gross , Alim Akhtar , Avri Altman , Pedro Sousa , "James E.J. Bottomley" , linux-arm-msm@vger.kernel.org (open list:ARM/QUALCOMM SUPPORT), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 2/2] scsi: ufs-qcom: enter and exit hibern8 during clock scaling Date: Wed, 23 Oct 2019 09:39:42 -0700 Message-Id: <1571848785-27698-2-git-send-email-asutoshd@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1571848785-27698-1-git-send-email-asutoshd@codeaurora.org> References: <1571848785-27698-1-git-send-email-asutoshd@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Qualcomm controller needs to be in hibern8 before scaling clocks. This change puts the controller in hibern8 state before scaling and brings it out after scaling of clocks. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-qcom.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index a5b7148..d117088 100644 --- a/drivers/scsi/ufs/ufs-qcom.c +++ b/drivers/scsi/ufs/ufs-qcom.c @@ -1305,6 +1305,9 @@ static int ufs_qcom_clk_scale_notify(struct ufs_hba *hba, int err = 0; if (status == PRE_CHANGE) { + err = ufshcd_uic_hibern8_enter(hba); + if (err) + return err; if (scale_up) err = ufs_qcom_clk_scale_up_pre_change(hba); else @@ -1324,6 +1327,7 @@ static int ufs_qcom_clk_scale_notify(struct ufs_hba *hba, dev_req_params->hs_rate, false); ufs_qcom_update_bus_bw_vote(host); + ufshcd_uic_hibern8_exit(hba); } out: -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.