Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1062178rwb; Wed, 26 Jul 2023 07:06:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlEAhptAyuJEMuneVe52/qNfYvGjdBmgDJcXRL5paR2/sbB+OPY/MZGOLWWLgYOwne53Lcoe X-Received: by 2002:a05:6a20:1394:b0:132:de96:2dcc with SMTP id hn20-20020a056a20139400b00132de962dccmr1621911pzc.56.1690380415898; Wed, 26 Jul 2023 07:06:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690380415; cv=none; d=google.com; s=arc-20160816; b=BRqOsm5jDlGhmeLa6o5K5CMNObLD9FvO7P3TpzIyOE1iIw/wBD8i75n+k+xv/1MYlV w1Nix+9ne5jmFbZHbzwoY8Qd9+MQaNGil4pmg98kj9oglHLBgJV/NWpjHwIw6bP4WBIg Afbak2z+kLaMO4aILrV9pLVxpDEq12KyKxmMh1Sj6RkWhutQQntIkv0ZGxTXm1pHI2oG ZVUzP2v2ijoTPr1Rv/ICMt8xuoR9VKSmT99LDJByfJ0AJsuxRLGInNqn/X6wEskdn5j9 +mH1WAxi40Aocd5fBzPc6F48xSY7oJGHwzD4XCExCQTG4asedLumxUYLkTk8ss0oGJRB R5Dg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m4-20020a633f04000000b00563da8d8416si1940894pga.355.2023.07.26.07.06.42; Wed, 26 Jul 2023 07:06:55 -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 S234246AbjGZNmp (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 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