Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2748010rdb; Mon, 4 Dec 2023 06:36:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IGebJsDqc6YB1MOGGTvFTYp8HQRr5ujvT68gYEY088uuCEG5bEWkz9r+zKHOvbAyLgMx3Lm X-Received: by 2002:a05:6a20:938b:b0:18f:97c:8241 with SMTP id x11-20020a056a20938b00b0018f097c8241mr2224153pzh.75.1701700582363; Mon, 04 Dec 2023 06:36:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701700582; cv=none; d=google.com; s=arc-20160816; b=eykNmn0/tU6AJi4Z/g2I8jHGCeEwYaGtMbhJ9+BFPGyy5d0KpB5e9Es5TXGfH3Vqk9 Cda6cFlBJbcZ2xqewbTlMvQGq5kiRMhVEEalU6J192BlQBI0tg8EvgknufO9PQer/Yu2 ggbqvkkbytXXxCfx/FOVz6U7WofDI9IhULcjDLJoaasqmmbbugkEPMVDT4vlnfH/UYbt cwSfCxyO56/oduASkvalPmabq1IgtEqvhvoi/+HMf6cYrrszBQoC0VXDPsIzObrzg3Bp DJRrcz21OU+/aUHnIuopzDhEH2jjDzhrI3fnT4yZINi0195a2EGsdLrRYA3Yyh7vJPa6 jUAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Cjni/hlpt/X+AaOx2fHWVROji8DsyjSHHQQ+GVNzNUg=; fh=HcRlw/Sg6CRjZaVEhD/JElnETX7jGCiCWdZ2/j1v8mQ=; b=UFDLhZECz8oYsaaXmCe1wbdDUlWvK1AFkRjVmwajMhbqYZFrw9GBBosr4J9NPBOkaa MR4uY6HcEZBmwWdIkPqypDNpKRoxDhm97eaT79UO0tcyVSL7bJynj5b1oyOu5/1dAlk7 5078cXJxwDLvLt/xk0c9e4pnObwNGeAv+zkrU6w3wmP+iQpBWU8z8zjgc0uVFeZkcPmN +PkfC/I18dUp52PdG/czoPLfRrRXj0xTyKEIEcnxVyg6RmgAWqz2cOs9B3/jqpRhJAhN 8RnWdxyhy/Wqwb3oesZESDFQZFJ03u5m1DOS6NYSbZ5CfywEB2GPd4YVe/1H3+rGYtPv i8PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=LWP6pyjY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id w6-20020a056a0014c600b006ce1127888asi4586925pfu.10.2023.12.04.06.36.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 06:36:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=LWP6pyjY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4DC0D80A9193; Mon, 4 Dec 2023 06:36:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345438AbjLDOgI (ORCPT + 99 others); Mon, 4 Dec 2023 09:36:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233602AbjLDOgD (ORCPT ); Mon, 4 Dec 2023 09:36:03 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5C71106; Mon, 4 Dec 2023 06:36:09 -0800 (PST) Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3B4AnLQp030548; Mon, 4 Dec 2023 14:31:43 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 : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=Cjni/hlpt/X+AaOx2fHWVROji8DsyjSHHQQ+GVNzNUg=; b=LWP6pyjYUsT4/MFb4+r5u/WMrk/e+YoMOspl5Knu1uifXtlJzri3CeufIuVeaW0vKt3w YWif8nqfTjaLSbFpm+Kp5VXpayZwSJarHWqoqUDY3nGE3DO/wNsLnB35kXTTE6fKr2Qc ireka6/OCU3gBIh5PWeBzh+w/aFNY0l1HIccUchsT6738cHsWJheCd9HxvLON2CfbVGl s4jt//NRZvDnYXDp/BWtUTv4Qe101UP3+WPtPBBGssMkB/fSM/VK+WweBW/O95+uLK8X niADSbBVo9Dop2veTP1JPzJXWuA5FQ/V9Nm2kV1c2IT6/8I4vNG7AttdP8LNkGfeJ5HX hA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3usdbn8m82-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Dec 2023 14:31:43 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3B4EVfPl019600 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 4 Dec 2023 14:31:41 GMT Received: from hu-mnaresh-hyd.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 4 Dec 2023 06:31:35 -0800 From: Maramaina Naresh To: "James E.J. Bottomley" , "Martin K. Petersen" , Peter Wang , Manivannan Sadhasivam , Andy Gross , Bjorn Andersson , Konrad Dybcio , Matthias Brugger , AngeloGioacchino Del Regno , CC: Alim Akhtar , Avri Altman , Bart Van Assche , , , , , , , Subject: [PATCH V2 2/3] ufs: ufs-mediatek: Enable CPU latency PM QoS support for MEDIATEK SoC Date: Mon, 4 Dec 2023 20:01:00 +0530 Message-ID: <20231204143101.64163-3-quic_mnaresh@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231204143101.64163-1-quic_mnaresh@quicinc.com> References: <20231204143101.64163-1-quic_mnaresh@quicinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: ygjjDnGUt9ZU1vBNg46PmO1f0ZZXD18j X-Proofpoint-GUID: ygjjDnGUt9ZU1vBNg46PmO1f0ZZXD18j X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-04_13,2023-12-04_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 bulkscore=0 mlxlogscore=999 phishscore=0 lowpriorityscore=0 mlxscore=0 impostorscore=0 clxscore=1015 spamscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2312040106 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 04 Dec 2023 06:36:21 -0800 (PST) Revert the existing PM QoS feature from MEDIATEK UFS driver as similar PM QoS feature implementation is moved to core ufshcd and also enable CPU latency PM QoS capability for MEDIATEK SoC. Signed-off-by: Maramaina Naresh --- drivers/ufs/host/ufs-mediatek.c | 20 +++----------------- drivers/ufs/host/ufs-mediatek.h | 3 --- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c index fc61790d289b..d8ece88103b9 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -626,21 +625,9 @@ static void ufs_mtk_init_host_caps(struct ufs_hba *hba) dev_info(hba->dev, "caps: 0x%x", host->caps); } -static void ufs_mtk_boost_pm_qos(struct ufs_hba *hba, bool boost) -{ - struct ufs_mtk_host *host = ufshcd_get_variant(hba); - - if (!host || !host->pm_qos_init) - return; - - cpu_latency_qos_update_request(&host->pm_qos_req, - boost ? 0 : PM_QOS_DEFAULT_VALUE); -} - static void ufs_mtk_scale_perf(struct ufs_hba *hba, bool scale_up) { ufs_mtk_boost_crypt(hba, scale_up); - ufs_mtk_boost_pm_qos(hba, scale_up); } static void ufs_mtk_pwr_ctrl(struct ufs_hba *hba, bool on) @@ -937,6 +924,9 @@ static int ufs_mtk_init(struct ufs_hba *hba) /* Enable clk scaling*/ hba->caps |= UFSHCD_CAP_CLK_SCALING; + /* Enable PM QoS */ + hba->caps |= UFSHCD_CAP_PM_QOS; + hba->quirks |= UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL; hba->quirks |= UFSHCD_QUIRK_MCQ_BROKEN_INTR; hba->quirks |= UFSHCD_QUIRK_MCQ_BROKEN_RTC; @@ -959,10 +949,6 @@ static int ufs_mtk_init(struct ufs_hba *hba) host->ip_ver = ufshcd_readl(hba, REG_UFS_MTK_IP_VER); - /* Initialize pm-qos request */ - cpu_latency_qos_add_request(&host->pm_qos_req, PM_QOS_DEFAULT_VALUE); - host->pm_qos_init = true; - goto out; out_variant_clear: diff --git a/drivers/ufs/host/ufs-mediatek.h b/drivers/ufs/host/ufs-mediatek.h index f76e80d91729..38eab95b0f79 100644 --- a/drivers/ufs/host/ufs-mediatek.h +++ b/drivers/ufs/host/ufs-mediatek.h @@ -7,7 +7,6 @@ #define _UFS_MEDIATEK_H #include -#include #include /* @@ -167,7 +166,6 @@ struct ufs_mtk_mcq_intr_info { struct ufs_mtk_host { struct phy *mphy; - struct pm_qos_request pm_qos_req; struct regulator *reg_va09; struct reset_control *hci_reset; struct reset_control *unipro_reset; @@ -178,7 +176,6 @@ struct ufs_mtk_host { struct ufs_mtk_hw_ver hw_ver; enum ufs_mtk_host_caps caps; bool mphy_powered_on; - bool pm_qos_init; bool unipro_lpm; bool ref_clk_enabled; u16 ref_clk_ungating_wait_us; -- 2.34.1