Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4611768pxb; Mon, 27 Sep 2021 23:07:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxr6AYOaev3b2vYrOZA0r2ZoRIgqzhzsBKijuyveT4L/VEdOdv0oUu6yQ8oIiShu4b4GdFz X-Received: by 2002:a63:f5b:: with SMTP id 27mr2983736pgp.302.1632809278431; Mon, 27 Sep 2021 23:07:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632809278; cv=none; d=google.com; s=arc-20160816; b=HSWIWpKPJ1koYOBkmDOEPNOMp0UqOviLNj68kIAUW+A6rplhKOXIQ+aWOjMERmln85 va3jcI3UN8INH9jvyAx4bbkdXZbyJF8oFv+uBkLt68Q/P1TaxcZ9yvfLblfDAT/puuwg 1u1i1+Ffaqyn4I3Wth/hESMLZz7K8CRwFDNKOpzFuc/tGNQgxT0Cde8Em3GlY4yna44I aI1HbxxQEOzeQJlCDJ3eyp+n+wvHI9qH+yjBmn827rKIzWJnHLQydWSZTT9Z4QIscsPS /qmbYSe9t/I8GTv8KR9228FAKmyj7wQEorKRUgME8RsA7qgjclxSH7Y47EIzU6pmvcfw ygiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:content-language :thread-index:content-transfer-encoding:mime-version:message-id:date :subject:in-reply-to:cc:to:from:dkim-signature:dkim-filter; bh=8sweX3DIsALuKLz+wzpzAeQefZMloVVd1YMoHWSAA8Y=; b=bb4OjT8jZJJecSeEtoTvj5x+/Ec4tI52GZBSI2+Rt2tpXi+/HmO3pPdnQ289rWybj2 /XDwuJ8crSKsZI4lwvvWM2NFpXZn+gPR2LEiK95dNmV8AC4nA8WZ8sqOEQW2fUnNOrZJ +16JjT76VlJkU+6ZBxOFZZUqazbCcP7DvEOFt9wQBgjp3AUa7TsLNcb7EpDBu/ofll4O j0kur2N/7U/Osr20/1HUCVBgMMq6vreTH5tQotKtMKAYQYQ+8A0t2RDm0XStnMWThp5e c7In5DgohusJx4p2C4kvdv9cJSrI17X7BPrbkSVwu2kXOtaAKZRaruWNxiU8dtU8yP2O 52Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=fBL3jYiO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m13si23828556pff.61.2021.09.27.23.07.45; Mon, 27 Sep 2021 23:07:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=fBL3jYiO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239330AbhI1GHQ (ORCPT + 99 others); Tue, 28 Sep 2021 02:07:16 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:56595 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239683AbhI1GGB (ORCPT ); Tue, 28 Sep 2021 02:06:01 -0400 Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20210928060421epoutp0266dfebe4b66f8cf6439e144497c6d1cc~o5zCrOZef2429724297epoutp02N for ; Tue, 28 Sep 2021 06:04:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20210928060421epoutp0266dfebe4b66f8cf6439e144497c6d1cc~o5zCrOZef2429724297epoutp02N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1632809061; bh=8sweX3DIsALuKLz+wzpzAeQefZMloVVd1YMoHWSAA8Y=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=fBL3jYiO7vESXFereg+QX0cweivPPROXJhMJcn/yG7WIYDoLZXUG5KVvWUvSqqcMF Gyd78xGe9x2oRz3WHiPmiJSr+u1O93Ghr9c0IHG17ZNSA7aZ16IcJyq9op+79yBCj7 XYcBdha15P5f64z009ag4Xsk1iGpbSKInT539FSQ= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20210928060420epcas5p4d953816bbbf6290317681d222b63bd12~o5zB-D7FF3135731357epcas5p4I; Tue, 28 Sep 2021 06:04:20 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.38.175]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4HJTV81cpvz4x9Q2; Tue, 28 Sep 2021 06:04:16 +0000 (GMT) Received: from epcas5p1.samsung.com ( [182.195.41.39]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 9C.40.10367.D50B2516; Tue, 28 Sep 2021 15:04:13 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPA id 20210928060357epcas5p22ff1cce62e551d446377dd6443bc316f~o5ysQMunA1416714167epcas5p26; Tue, 28 Sep 2021 06:03:57 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210928060357epsmtrp10068b6bdbc4e1720793fed78b6f4f67b~o5ysPP3ie1504215042epsmtrp1I; Tue, 28 Sep 2021 06:03:57 +0000 (GMT) X-AuditID: b6c32a4a-b2dff7000000287f-dd-6152b05d71b2 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id C1.E4.08750.C40B2516; Tue, 28 Sep 2021 15:03:56 +0900 (KST) Received: from alimakhtar03 (unknown [107.122.12.5]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210928060355epsmtip26014d70cf40fa59c43f4a4193a9ec5fb~o5yqbA3nW0054400544epsmtip2j; Tue, 28 Sep 2021 06:03:54 +0000 (GMT) From: "Alim Akhtar" To: "'Bao D. Nguyen'" , , , , Cc: , "'Andy Gross'" , "'Bjorn Andersson'" , "'Avri Altman'" , "'James E.J. Bottomley'" , "'open list'" In-Reply-To: <94cda1143d3332c3284a09b88139e358eab5a233.1632171047.git.nguyenb@codeaurora.org> Subject: RE: [PATCH v1 2/2] scsi: ufs-qcom: enter and exit hibern8 during clock scaling Date: Tue, 28 Sep 2021 11:33:53 +0530 Message-ID: <000801d7b42e$9f69df10$de3d9d30$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQFSrXMYWf6xZll5STjad3GlX/AECgF7MZHvAVJql3KsrJU7oA== Content-Language: en-us X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJJsWRmVeSWpSXmKPExsWy7bCmum7shqBEg1sPeC3OPf7NYrG37QS7 xcufV9ksTu9/x2Lxaf0yVotFN7YxWUzcf5bd4vKuOWwW3dd3sFksP/6PyeJj12xGB26Py329 TB6bVnWyedy5tofNY8KiA4weH5/eYvH4vEnOo/1AN1MAe1S2TUZqYkpqkUJqXnJ+SmZeuq2S d3C8c7ypmYGhrqGlhbmSQl5ibqqtkotPgK5bZg7QkUoKZYk5pUChgMTiYiV9O5ui/NKSVIWM /OISW6XUgpScApMCveLE3OLSvHS9vNQSK0MDAyNToMKE7IwN9/uYC7qEK859UWxgfMrfxcjJ ISFgIvFlyke2LkYuDiGB3YwSF2Y9YYFwPjFKfLrVxA7hfGaUaLgzix2mpXN5JytEYhejxMZp K5hAEkICLxklj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LJiU1J7MstUjfLoErY8P9PuaC LuGKc18UGxif8ncxcnJICJhIdC7vZO1i5OIQEtjBKHH33DpGiIS0xPWNE9ghbGGJlf+es0MU PWeUWPnmEDNIgk1AV2LH4jY2kISIwBJGiUfrLzOBOMwC7UwSvXeeMkG03GGUeDyjGWwWp0Cs xNvpl1hAbGGBcImG+VPB9rEIqEos2vEPbCyvgKXE/G0/WSFsQYmTM58A1XMATdWTaNsIVs4s IC+x/e0cZojzFCR+Pl0GVi4i4CSxb84BFogacYmXR4+wT2AUnoVk0iyESbOQTJqFpGMBI8sq RsnUguLc9NxiwwKjvNRyveLE3OLSvHS95PzcTYzgWNTS2sG4Z9UHvUOMTByMhxglOJiVRHiD WfwThXhTEiurUovy44tKc1KLDzFKc7AoifNe6DoZLySQnliSmp2aWpBaBJNl4uCUamDK9/rc vcyHY+PcR/tmyqz0M/a9Zemc1Ba+6MqEfRvf5ur8PKE7py8/eO1eCfeuQ584vcQXPrfqvbGX javuTtqjXW1hR3ZWq9xe0Rq8Myms68TZ4P0R8iHbLXZOL/7R0r/kjvJ7zrNHxKtz7HcvlQu0 mr/i6pfynBrWORM27g3Y2P75CevjT1l54d/frr430+3u/+tmyxhrbrXMv/Hw0B3n9MPyqnKs 55ztHrJ2mMm/mVDqW5O22CDeduPZuUtXVM9iYf6ysTfL50Xbx/7ITRI9v7526D/9HSRUy9wl HbPT9PKqyGstW654XnJ2397tI8H9OsbsHs90gZW5T3MUT+Tc/KV+x9xc7nTsDM5zew53KbEU ZyQaajEXFScCAPCL7b80AwAA X-CMS-MailID: 20210928060357epcas5p22ff1cce62e551d446377dd6443bc316f X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210920210821epcas5p233e0025318135ae97b5f87eb83391b4a References: <94cda1143d3332c3284a09b88139e358eab5a233.1632171047.git.nguyenb@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, >-----Original Message----- >From: nguyenb=codeaurora.org@mg.codeaurora.org >[mailto:nguyenb=codeaurora.org@mg.codeaurora.org] On Behalf Of Bao D. >Nguyen >Sent: Tuesday, September 21, 2021 2:38 AM >To: cang@codeaurora.org; asutoshd@codeaurora.org; >martin.petersen@oracle.com; linux-scsi@vger.kernel.org >Cc: linux-arm-msm@vger.kernel.org; Bao D . Nguyen >; Andy Gross ; Bjorn Andersson >; Alim Akhtar ; Avri >Altman ; James E.J. Bottomley ; >open list >Subject: [PATCH v1 2/2] scsi: ufs-qcom: enter and exit hibern8 during clock scaling > >From: Asutosh Das > >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 >Signed-off-by: Bao D. Nguyen >--- Reviewed-by: Alim Akhtar > drivers/scsi/ufs/ufs-qcom.c | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > >diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index >92d4c61..92f5bb4 100644 >--- a/drivers/scsi/ufs/ufs-qcom.c >+++ b/drivers/scsi/ufs/ufs-qcom.c >@@ -1212,24 +1212,34 @@ 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 > err = ufs_qcom_clk_scale_down_pre_change(hba); >+ if (err) >+ ufshcd_uic_hibern8_exit(hba); >+ > } else { > if (scale_up) > err = ufs_qcom_clk_scale_up_post_change(hba); > else > err = ufs_qcom_clk_scale_down_post_change(hba); > >- if (err || !dev_req_params) >+ >+ if (err || !dev_req_params) { >+ ufshcd_uic_hibern8_exit(hba); > goto out; >+ } > > ufs_qcom_cfg_timers(hba, > dev_req_params->gear_rx, > dev_req_params->pwr_rx, > dev_req_params->hs_rate, > false); >+ ufshcd_uic_hibern8_exit(hba); > } > > out: >-- >The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a >Linux Foundation Collaborative Project