From patchwork Wed Jul 26 13:41:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nitin Rawat X-Patchwork-Id: 126414 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp446689vqo; Wed, 26 Jul 2023 07:35:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlFLzcT/c59JSunmy3eBx/Zyk9K64HWoseemkAkz/7FL/ScNRRHeHS2SvRUmFPWCEUcPwO7U X-Received: by 2002:a05:6a21:47c8:b0:137:3803:33c with SMTP id as8-20020a056a2147c800b001373803033cmr1910627pzc.54.1690382131781; Wed, 26 Jul 2023 07:35:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690382131; cv=none; d=google.com; s=arc-20160816; b=W89v7yxw/4vgVoMZVa8bL5TMpcNjgHPngZKEGKxSNWgjSYOpS05hPF5MiIgCsk1on4 C8Qd3PflEI6m/Nw8mbsypKlajSvLgyzeD8wD5pigOjmPpz/nJf1vFg+oDOrZiZEg4m0M l/aCogLrOCnXOlfQYZ9JfKcoYf2EzByzEwlzZ6J3MKQ2WT+Gk5QCzuWm8Kqk+EnD0rgq iUv+8EZwGdTFRIO+qzB0h9UISAC2xZAGENkFOl/nM8Vow+r5c7ruF1kJhwDLdO1wdMUZ 6UkNxv5SLgaDR5pIIX9vBg8zt6+5Ah1cPNRH1jOPerXNDEwbzfILjUwsw8mpQ/XwQbpo +aJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=6Rtbzl8f2b/zKk6//BhNizcH1rZYFH3VxZICLLh6Dx8=; fh=SZF46NJDpmjJRjNmqZvFOs3JNJCGWSoTLL5wJ/TrF2Q=; b=D5QMhRs9kAAIu8nVK4XrmvkJzuq2nTJ76Ystwov41vDtgNsNmCK85Ag7iSYbtyydWB med9MXh2staAqHRacuzUHwn/SghjUdiBNlnuNtDWeekOu06LSXgejPeJ8aUsill0jNWp 9iilUdy+sw8JnVFaNxZcxKbDMFwFn1Q0aAJ6RXJ7B9by+uzCKOfZ/1R4gCKekM/BrFM3 DRF5ogYLyHdyh2VLjtR0biDR6H/KB23IulEAecFiYPgBbpPev6aHA8Pr720dr9NjMip5 KD+kNGcVzfMTacfJrP5sXwJjIVyfCOTyW0KSkoZTGqFlko+6qj3mZG7A1GPXCjPomfSS /hvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=mxZ80FXG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k13-20020a056a00168d00b0068658355b40si13436680pfc.162.2023.07.26.07.35.17; Wed, 26 Jul 2023 07:35:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=mxZ80FXG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234037AbjGZNmp (ORCPT + 99 others); Wed, 26 Jul 2023 09:42:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233808AbjGZNmh (ORCPT ); Wed, 26 Jul 2023 09:42:37 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6802CE69; Wed, 26 Jul 2023 06:42:36 -0700 (PDT) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36QCbnj0030980; Wed, 26 Jul 2023 13:41:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=qcppdkim1; bh=6Rtbzl8f2b/zKk6//BhNizcH1rZYFH3VxZICLLh6Dx8=; b=mxZ80FXGWWM9j23yQFeq+lkp+3nMVZM40GEgEjR+txB2MVF5p2w2kduaVAtRuUq3wI+m k3nnLBK4j1trqGvPzvq28/HsiLVhBvQPkqEJlFrse9Tg/J9OR0bxb7GfazBOrYDI8eV+ +tW7TzU4yWiA9jb4SgFy9jOF6y4NPes71M0pyHkssFo00avEbN1YUj4OjlcP5s4raKJJ iy9l62a1qOgC3SLpnRf68YDTJ4xmwkaUJv2qGKupPFfMqpIIcyaggzAi14j+j2WCfg6a bMEKAgwLUyiPUmyK1dCYg5HtYVJiHmIhPSTn1LWgIbfw1p9NMP4h3Wz3ZOSRKFH7M1fc sw== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3s336t056m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jul 2023 13:41:48 +0000 Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 36QDfiAf017634; Wed, 26 Jul 2023 13:41:44 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 3s086kxdvp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 26 Jul 2023 13:41:44 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 36QDfhMf017626; Wed, 26 Jul 2023 13:41:43 GMT Received: from hu-maiyas-hyd.qualcomm.com (hu-nitirawa-hyd.qualcomm.com [10.213.109.152]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 36QDfhSO017622; Wed, 26 Jul 2023 13:41:43 +0000 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 2342877) id 0E343572B96; Wed, 26 Jul 2023 19:11:43 +0530 (+0530) From: Nitin Rawat To: powen.kao@mediatek.com, bvanassche@acm.org, alim.akhtar@samsung.com, adrian.hunter@intel.com, jejb@linux.ibm.com, stanley.chu@mediatek.com, asutoshd@codeaurora.org, quic_cang@quicinc.com, mani@kernel.org, martin.petersen@oracle.com, beanhuo@micron.com, ebiggers@google.com, agross@kernel.org, Arthur.Simchaev@wdc.com, konrad.dybcio@linaro.org Cc: quic_ziqichen@quicinc.com, quic_nguyenb@quicinc.com, quic_narepall@quicinc.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Nitin Rawat Subject: [PATCH V2 1/2] scsi: ufs: core: Export ufshcd_is_hba_active Date: Wed, 26 Jul 2023 19:11:39 +0530 Message-Id: <20230726134140.7180-2-quic_nitirawa@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230726134140.7180-1-quic_nitirawa@quicinc.com> References: <20230726134140.7180-1-quic_nitirawa@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: OT4HI2Lz54zOy1GXtAAefMxLy5IjnK3S X-Proofpoint-GUID: OT4HI2Lz54zOy1GXtAAefMxLy5IjnK3S X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-26_06,2023-07-26_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 spamscore=0 clxscore=1015 mlxlogscore=954 adultscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 bulkscore=0 impostorscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307260121 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772494134164678152 X-GMAIL-MSGID: 1772494134164678152 Export ufshcd_is_hba_active() to allow vendor driver modules to check the state of host controller. Signed-off-by: Nitin Rawat Acked-by: Manivannan Sadhasivam --- drivers/ufs/core/ufshcd.c | 3 ++- include/ufs/ufshcd.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 983fae84d9e8..962aa5c1fe69 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -995,10 +995,11 @@ static inline void ufshcd_hba_start(struct ufs_hba *hba) * * Returns true if and only if the controller is active. */ -static inline bool ufshcd_is_hba_active(struct ufs_hba *hba) +bool ufshcd_is_hba_active(struct ufs_hba *hba) { return ufshcd_readl(hba, REG_CONTROLLER_ENABLE) & CONTROLLER_ENABLE; } +EXPORT_SYMBOL_GPL(ufshcd_is_hba_active); u32 ufshcd_get_local_unipro_ver(struct ufs_hba *hba) { diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index 6dc11fa0ebb1..ef04c3363be8 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -1398,6 +1398,7 @@ int ufshcd_wb_toggle_buf_flush(struct ufs_hba *hba, bool enable); int ufshcd_suspend_prepare(struct device *dev); int __ufshcd_suspend_prepare(struct device *dev, bool rpm_ok_for_spm); void ufshcd_resume_complete(struct device *dev); +bool ufshcd_is_hba_active(struct ufs_hba *hba); /* Wrapper functions for safely calling variant operations */ static inline int ufshcd_vops_init(struct ufs_hba *hba) From patchwork Wed Jul 26 13:41:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nitin Rawat X-Patchwork-Id: 126391 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp428134vqo; Wed, 26 Jul 2023 07:07:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlEwSXZ7OYCVDJLBd5pwRGv82dKYsXPZ407WxIdHxZp4LbDmU/jfALIecozwNl7UdsydgGPm X-Received: by 2002:a05:6a21:798a:b0:137:23a2:2b3c with SMTP id bh10-20020a056a21798a00b0013723a22b3cmr2239031pzc.49.1690380463080; Wed, 26 Jul 2023 07:07:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690380463; cv=none; d=google.com; s=arc-20160816; b=kspoHKtpXop9e0d+Wk0EA/TSigRQm/p80x6Ps52FbxCtgqwT89ZTDZV/FVE6TUyM8J SgnfrAz72y+g2QGdB82Zxvj0e3DYnx8FFExTBPsoex2BE3xRlQxEstwbq2rujoPXqxiF mwUwI0SxjWCsFYIrbV/DktQJ2I6QFMepbEck/j1Yj6Xdops8qx1OYbddxyrsa7YrZsZb fKblJyVwTAwAC7hzFJBnjrlOuKnUyjNlAdXKUuvwV9t+WlhSh7T5Zoq0/cLCsF10o1ZV icA1jQFmZAG7YkDDepcjr6zd0N73ZTifj9sZH8g60TeSbq9hMnYTQKl/60fidpLcge0A 0Mig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=v3fJG4hcwnQVClC9EqYXRi1q8buYQM/N3AKD0PIMSv8=; fh=oWoQmLJBMwg7njcL7TpQjBDqqWtqDTETVnMHtPj2T8o=; b=p3h35KMxqCBBkqEvp+Vd9Olzj7QJdqm9KHUJKMjVkTpFxZ4axFLlkqFkaMKzWBDMdi x4FpIuRFrCmHZoevWAuxOMHR/ADPt1MGHp0Thhtyk2qdIVfDHZHM3aHYOZH/VFZVLYCU ns9/OfNvbsYqQTphr+uvY18p/UhCUNfCszjv0iKQ6qL6XMD9SZGsFGCm7VaP73t/kgnU iYdmWSzPGsMKFSxBugmHBjFT0qy5uaA9RxyKyJon2mFmojbtjWxpzd0WIr2LXSJQOPEx pEhj7E7aoWGsumwlYyRqia1AJmeJ9bFTMDeP/jo0qpxAAiF64n4mOcOeiB0BkcYx2p+B /e7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=nPqdlHyb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j190-20020a6380c7000000b00563dc551164si1791026pgd.162.2023.07.26.07.07.28; Wed, 26 Jul 2023 07:07:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=nPqdlHyb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233312AbjGZNmj (ORCPT + 99 others); Wed, 26 Jul 2023 09:42:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232619AbjGZNm3 (ORCPT ); Wed, 26 Jul 2023 09:42:29 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14133118; Wed, 26 Jul 2023 06:42:29 -0700 (PDT) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36QD1f6B032532; Wed, 26 Jul 2023 13:41:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=qcppdkim1; bh=v3fJG4hcwnQVClC9EqYXRi1q8buYQM/N3AKD0PIMSv8=; b=nPqdlHybAlxKpVTFKcgta9RsIPtkRZ+JZdH2nRyLP6iyf0RJkwb7uyRCQLDmbtZMOTuT zLST+rj/Yg5ZZeyLOBbRUEnRoJhD/ORrZ80QB+rFY4ZghJV+kipmwvnVcwzIVyNwq+ct kC4ZGnDUwrjznSQtnc3+WdCwjAqLBhn2qLvombXEmxxoYQ/76198STiIShHXSq6A5mTP dkPznSu9hvQ0ec6ObV40shfmkajprwTpPFdyoZGSQ/NkOl5punSz7MGaq7snauHhGSSF 72PLOV9elvUOIQF5OF+XRY9Jc6ehKz1ByzawKumCY/yM5V0my77pf78rrCpwxw/Y1wms hA== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3s2fms2mg9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jul 2023 13:41:48 +0000 Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 36QDfjqQ017649; Wed, 26 Jul 2023 13:41:45 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 3s086kxdvw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 26 Jul 2023 13:41:45 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 36QDfi8M017644; Wed, 26 Jul 2023 13:41:44 GMT Received: from hu-maiyas-hyd.qualcomm.com (hu-nitirawa-hyd.qualcomm.com [10.213.109.152]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 36QDfigO017642; Wed, 26 Jul 2023 13:41:44 +0000 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 2342877) id E85455001B7; Wed, 26 Jul 2023 19:11:43 +0530 (+0530) From: Nitin Rawat To: powen.kao@mediatek.com, bvanassche@acm.org, alim.akhtar@samsung.com, adrian.hunter@intel.com, jejb@linux.ibm.com, stanley.chu@mediatek.com, asutoshd@codeaurora.org, quic_cang@quicinc.com, mani@kernel.org, martin.petersen@oracle.com, beanhuo@micron.com, ebiggers@google.com, agross@kernel.org, Arthur.Simchaev@wdc.com, konrad.dybcio@linaro.org Cc: quic_ziqichen@quicinc.com, quic_nguyenb@quicinc.com, quic_narepall@quicinc.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Nitin Rawat , Manish Pandey Subject: [PATCH V2 2/2] scsi: ufs: ufs-qcom: check host controller state Date: Wed, 26 Jul 2023 19:11:40 +0530 Message-Id: <20230726134140.7180-3-quic_nitirawa@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230726134140.7180-1-quic_nitirawa@quicinc.com> References: <20230726134140.7180-1-quic_nitirawa@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: qZ1nNmFTooGi6Xevl3uv6A18fTLficFb X-Proofpoint-ORIG-GUID: qZ1nNmFTooGi6Xevl3uv6A18fTLficFb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-26_06,2023-07-26_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 bulkscore=0 phishscore=0 spamscore=0 malwarescore=0 mlxlogscore=999 clxscore=1015 lowpriorityscore=0 suspectscore=0 priorityscore=1501 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307260121 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772492384329397926 X-GMAIL-MSGID: 1772492384329397926 Commit <52a518019ca1> (Fix missing clk change notification) added UFS clock scaling notification to ufshcd_host_reset_and_restore. This invokes hibern8 enter and exit on qualcomm platform which fails because controller is in reset state. Fix this by checking the Host controller state before sending hibern8 command. __ufshcd_wl_resume() ufshcd_reset_and_restore() ufshcd_host_reset_and_restore() ufshcd_scale_clks() ufshcd_vops_clk_scale_notify() ufs_qcom_clk_scale_notify() ufshcd_uic_hibern8_enter() Fixes: 52a518019ca1 ("scsi: ufs: core: Fix missing clk change notification on host reset") Co-developed-by: Manish Pandey Signed-off-by: Manish Pandey Signed-off-by: Nitin Rawat Acked-by: Manivannan Sadhasivam --- drivers/ufs/host/ufs-qcom.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.17.1 diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index 8d6fd4c3324f..95412e98a598 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -1254,6 +1254,10 @@ static int ufs_qcom_clk_scale_notify(struct ufs_hba *hba, struct ufs_pa_layer_attr *dev_req_params = &host->dev_req_params; int err = 0; + /* check the host controller state before sending hibern8 cmd */ + if (!ufshcd_is_hba_active(hba)) + return 0; + if (status == PRE_CHANGE) { err = ufshcd_uic_hibern8_enter(hba); if (err)