Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp115557rwb; Tue, 25 Jul 2023 12:51:27 -0700 (PDT) X-Google-Smtp-Source: APBJJlE9zqX7b917NeVYJXkLHuDiGopHSRwzfKrtscWIqgB2AS/m//9ai4fELKn/KSlxLHjgTXY1 X-Received: by 2002:aa7:8894:0:b0:682:2152:45df with SMTP id z20-20020aa78894000000b00682215245dfmr204318pfe.9.1690314687517; Tue, 25 Jul 2023 12:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690314687; cv=none; d=google.com; s=arc-20160816; b=zkcVC9jDEDKRYTYUaskv/1b7i3tOkPJjPTiv8oJ277IWnKKG1aFr4YwZt4Wv7j4m/M SAD+sx3ACKYYD0zcWO6SroyT74lrNKdshJWrc+xwxX/fY1f4v6a0S/AkyXPXw26fed8V C7jknVPPXxfdIxuTiDURcEbgv0yCKkTl7UJvQ3o80Lg+tgc/iBJD8XfnEvnhhVHfalSZ VyX2HlgDYALffZRwCyCUM5koNM/NSKh82FlkIVF3/Jklnvkih/sX4UZUDO3SF6PNrCin ogAw09jMZ0RfTGW8PT49CDlcP+zzsO8Qi38iKvKo336GCnJEMYvGvd9sYjkXIF1RphM/ eKWA== 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=j5qX0WUNWJ75lHiysW44dzdR02OJw+Wtj0aSDdkBD3fSwiCJThBwcUu9RylJAX0Fg+ IDZiv4IfL2XOz/lVvQmhEMJETret6YlCRw7lauzG4Zgjkn7CeltBibjZjMAm4ut6kAUb UYDjuv8/Q1PDYA7l92oy3Rq9GBZ2x9oNB7yCUR3etEWZQ2q/59VqaJ3/vj52zIHeSf+C hEPasEG6gTZPlV9FTsCsuy+/gkwif4SSmO5ZMKa5Cy3HJf4A6wFm7c1br45oyxyL+Gw/ YNxPxF+N4WO+1V+zuXM/P11Toy8JISDrq4BEbz2jN1nXIgIVexsUMvjBqwrqclG8DYDS nTNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=kIITGu9S; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w5-20020a056a0014c500b0064d3e917a90si12692006pfu.180.2023.07.25.12.51.14; Tue, 25 Jul 2023 12:51:27 -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=kIITGu9S; 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 S231381AbjGYT2R (ORCPT + 99 others); Tue, 25 Jul 2023 15:28:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230379AbjGYT2N (ORCPT ); Tue, 25 Jul 2023 15:28:13 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B947112D; Tue, 25 Jul 2023 12:28:12 -0700 (PDT) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36PIAAZN028495; Tue, 25 Jul 2023 19:27:19 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=kIITGu9SXIXka4bE+HQIN20XYqjKaKGkdWi7gZxOcZdS06DJpWVX7Q3DExn3mdV47xbl Hv9Or+gc9ELW9iauKZreoV9U4fL60PZUDTASbBMMrKHxP423H3L1j2yTwOWnqFjDSv3w ulibDcRrfy3q9vO+tIPRngEL1u7ym4W7gg7grmgFXpp7RkT38vVgRNsd2ck/F3mJJv3S 0sjumpdEhjSY2qrMo+/reJ+TUlfBvn6r2zsE3aXfvGLauYGoYhGPYxhR6+Yom3nuyMVM 7KIHbJ0xiDVKVXeeJ5OXeascrBpE1BfJBfxTqYD5jdPbMp6taMW+4dgp974Ob0iAhAw0 Jw== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3s2gxd0hbd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jul 2023 19:27:19 +0000 Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 36PJRFEf032656; Tue, 25 Jul 2023 19:27:15 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 3s086kx1y2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 25 Jul 2023 19:27:15 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 36PJRFCk032647; Tue, 25 Jul 2023 19:27:15 GMT Received: from hu-maiyas-hyd.qualcomm.com (hu-nitirawa-hyd.qualcomm.com [10.213.109.152]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 36PJRFqx032642; Tue, 25 Jul 2023 19:27:15 +0000 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 2342877) id 7F0A35001B7; Wed, 26 Jul 2023 00:57:14 +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 V1 1/2] scsi: ufs: core: Export ufshcd_is_hba_active Date: Wed, 26 Jul 2023 00:57:09 +0530 Message-Id: <20230725192710.26698-2-quic_nitirawa@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230725192710.26698-1-quic_nitirawa@quicinc.com> References: <20230725192710.26698-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: aDjMbbHqmMB8RMc89k96EdvACsq_-mka X-Proofpoint-ORIG-GUID: aDjMbbHqmMB8RMc89k96EdvACsq_-mka 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-25_10,2023-07-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 spamscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 mlxlogscore=954 lowpriorityscore=0 clxscore=1015 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307250167 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 Export ufshcd_is_hba_active() to allow vendor driver modules to check the state of host controller. Signed-off-by: Nitin Rawat --- drivers/ufs/core/ufshcd.c | 3 ++- include/ufs/ufshcd.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) 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) -- 2.17.1