From patchwork Tue May 6 16:37:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nitin Rawat X-Patchwork-Id: 887862 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 803EE283FC9; Tue, 6 May 2025 16:37:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746549470; cv=none; b=A20w4s5H43BUI+5Lv2xzIsRXmrjXaqSHyrIF17u4OE7LDIhePrEZQRjez0TWKr/OJosAQWbMjGU0VGniO2ehiAUrQiiviMmXNXXS792S/E6JVOiw2gTMM+19cD8UmYNWV3czmF72YhP7SRrBkxuUE1YRWB2VdzCQG5XG6LLg4jM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746549470; c=relaxed/simple; bh=GqlNI9rwCDk5o+gWHh1kMkqw1K20G34MrlFAv+NqNI4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UKgSOsE13JDEe4R0BCTmT09iiOMBqdUCWsfm5sTb5xMjCuBfH4WxunJorkm70Yb1qreXRoOnsE4qx8lmn9JPLIS05xHi5kcFuGqannZRr8orUl7ZoCI6Tmtg/ilXQ4dPo4qzUCyEbBfYySSROPyIpROlLHMMwL+qjNIlyC1v7wE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=qualcomm.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=nANSPQur; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="nANSPQur" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 546964SL002574; Tue, 6 May 2025 16:37:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=QW71RSDpipu RjnJxG36tgJata/JVHYLv8EUUyd3ynTc=; b=nANSPQurMmFUb8aNAqHyhAbXEws hBihVEQN3EgBbW+fkEP1vXpAHYnw7JdGGZTEad7GbfLzfD03n65ULdSahfICVNJJ F9D6El4jSnkppuK5b/6Pzpcn0DeRlX4Uab8swd12hgSyQ3st+sn8ipOAT6CzNlY4 q0Xp0OotHsJjT4k2O2Alb2wRSOj/46Veonqod1UDJRA1dlcvbDjK1y8t12NBs4oI u8EfCfJY3nL/T9yYJ+uOP0Maja4PkKW26E8SjRa18ENpOE3Ru5Vb4L+Wm7oxVGsZ 2Hk6f8UOtooOWHpp4V88QJuv9vut2fE+4TJKfTi2feBbOO4jDurn4sviM9Q== 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 46f5w3aw8f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 May 2025 16:37:12 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTP id 546Gb9gl003118; Tue, 6 May 2025 16:37:09 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 46dc7kx4m6-1; Tue, 06 May 2025 16:37:09 +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 546Gb9bE003112; Tue, 6 May 2025 16:37:09 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 546Gb9rS003111; Tue, 06 May 2025 16:37:09 +0000 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 2342877) id 8FB4A5015AC; Tue, 6 May 2025 22:07:08 +0530 (+0530) From: Nitin Rawat To: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, krzk+dt@kernel.org, robh@kernel.org, mani@kernel.org, conor+dt@kernel.org, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, beanhuo@micron.com, peter.wang@mediatek.com Cc: linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Nitin Rawat Subject: [PATCH V2 1/3] scsi: ufs: dt-bindings: Document UFS Disable LPM property Date: Tue, 6 May 2025 22:07:03 +0530 Message-ID: <20250506163705.31518-2-quic_nitirawa@quicinc.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250506163705.31518-1-quic_nitirawa@quicinc.com> References: <20250506163705.31518-1-quic_nitirawa@quicinc.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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-Spam-Details-Enc: AW1haW4tMjUwNTA2MDE1NyBTYWx0ZWRfX15SXF8kDf2DP YR3X2OXPCTnl3h6NuTNPS/zizkOeDf/VMtRYK5QQdlxcHsYVCdvGkGiKXGUpExzavJ/jF4BZJa6 a1qCQsw3wm2ASuj9G5tP3oLngfOodyO97DLCbGnulQ0NHKUeBnGnnjQkfFoQJN/Fzk98XGV9GDr F30FXHqfi68zHX0JZfCDudzar1A7r4FY0Kf3LljK1DEFnrpFRjKFS4/pMiClPCn8kCBqvxPuwyj XSU8LiWOoBjomu1NuIRwcMC4dtsT2jkDGWdYQoSPrm1FTPkljJ27oYSMFMl1zpF6InLLSEL1LL6 0EKoeaP5Dhmlct3eVXeM/4g2oYKpvoARmoNwYGvF9/pxjixt930vRkQzSkOr6OZKKt7J+GzNEGa DO+esOOctYvbVNEOGv3W2Kgx0crag9mVZ8BPjre2xST5KdnF4u0uwZFCRFxE4eVsquRErqbz X-Proofpoint-GUID: MFxACo-HEU_6sW2CPlVhfIm5cMRDjDZX X-Proofpoint-ORIG-GUID: MFxACo-HEU_6sW2CPlVhfIm5cMRDjDZX X-Authority-Analysis: v=2.4 cv=W+s4VQWk c=1 sm=1 tr=0 ts=681a3ab8 cx=c_pps a=Ou0eQOY4+eZoSc0qltEV5Q==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=bmo5lHaIWG-R3PfxNqQA:9 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-06_07,2025-05-05_01,2025-02-21_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 clxscore=1015 adultscore=0 phishscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 mlxscore=0 malwarescore=0 lowpriorityscore=0 suspectscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2504070000 definitions=main-2505060157 Disable UFS low power mode on emulation FPGA platforms or other platforms where it is either unsupported or power efficiency is not a critical requirement. Document the UFS Disable LPM property for such platforms. Signed-off-by: Nitin Rawat --- Documentation/devicetree/bindings/ufs/ufs-common.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/ufs/ufs-common.yaml b/Documentation/devicetree/bindings/ufs/ufs-common.yaml index 31fe7f30ff5b..eab28beb0e76 100644 --- a/Documentation/devicetree/bindings/ufs/ufs-common.yaml +++ b/Documentation/devicetree/bindings/ufs/ufs-common.yaml @@ -89,6 +89,11 @@ properties: msi-parent: true + disable-lpm: + type: boolean + description: + Disable UFS LPM features. + dependencies: freq-table-hz: [ clocks ] operating-points-v2: [ clocks, clock-names ] From patchwork Tue May 6 16:37:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nitin Rawat X-Patchwork-Id: 888261 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 97DFE285418; Tue, 6 May 2025 16:37:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746549469; cv=none; b=ckVfd+JCe/uO5yEcEpD93Aj8Xu9Aouj90/iun0tclf4TxdYZdcYXShuuW7uCy4ZzHTeVHxA0C3K6LfzzMhCRCoMnThWO/G/v4KYaAl/4gQQirituVzzgHp5UF2xskvf5nY5QDbQU+DP+88wV/omwfIKeahystCJ7mK4k0tk/SaE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746549469; c=relaxed/simple; bh=dlaDVNVarITlY9CYIWm0GSWderQfXvYxZsIOs6wia88=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RDGG9Q6NWZ0txNf2C7QDGhvdr8yHdqjVFTWkt7TSn6kpoinVsw0ajhur/SZsVPfqEm8563sbImwymR68OssaQU5+E8wfICdXWGSGMzT8PM8QgSwqVi22wlbufZAD3lHBBzyNpBs3esPHViLrqck5v6r92Cr6MhBvwfKOGU7tVoo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=qualcomm.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=dwAu3ThQ; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="dwAu3ThQ" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 546G3YnG010387; Tue, 6 May 2025 16:37:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=mOEqEL4uaUy DR2OeHXNRNTwUy+KjE/sWX+Qe7xUCJ3Q=; b=dwAu3ThQS2hILih5ZWz1bZa+I1B msTvApnO6WFf7u8DtIO5AFM5AO0gUU/XH92Ube3TiQ+S69VC856X7kaHO75dRXeP gClb5xdiVVopF2pLJ839+CL4kfukH9h/w+sCaXxHDWyGKi2M6zQW+2Fz3CZCLVhF xUNZCh3Z6adP0ZC6vT3RACF5uaW+qDmBk1HfCPnWoXSIng8buJ50C28afk/b2Et0 kmWBd1HkMH7nEQq/TRXCEwswWsQrE7j4UwoNeUgY3mltsrdtQP4xqiOFUbuWcDE2 f+8fbK8WlftJXlU5xMKnFIRuSo4OEQu0kF6ucUECSjd+OxglVBgdKlqOO0Q== 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 46fnm1g3ew-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 May 2025 16:37:14 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTP id 546Gb8jj003106; Tue, 6 May 2025 16:37:10 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 46dc7kx4mc-1; Tue, 06 May 2025 16:37:10 +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 546GbAdj003125; Tue, 6 May 2025 16:37:10 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 546GbAIg003123; Tue, 06 May 2025 16:37:10 +0000 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 2342877) id CC0C45015A9; Tue, 6 May 2025 22:07:09 +0530 (+0530) From: Nitin Rawat To: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, krzk+dt@kernel.org, robh@kernel.org, mani@kernel.org, conor+dt@kernel.org, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, beanhuo@micron.com, peter.wang@mediatek.com Cc: linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Nitin Rawat Subject: [PATCH V2 2/3] scsi: ufs: pltfrm: Add parsing support for disable LPM property Date: Tue, 6 May 2025 22:07:04 +0530 Message-ID: <20250506163705.31518-3-quic_nitirawa@quicinc.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250506163705.31518-1-quic_nitirawa@quicinc.com> References: <20250506163705.31518-1-quic_nitirawa@quicinc.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: EzuMJVBkfzIl8xuKhqOW5jr8rC7X5i7m X-Proofpoint-ORIG-GUID: EzuMJVBkfzIl8xuKhqOW5jr8rC7X5i7m X-Authority-Analysis: v=2.4 cv=bLkWIO+Z c=1 sm=1 tr=0 ts=681a3aba cx=c_pps a=Ou0eQOY4+eZoSc0qltEV5Q==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=UmUAYFU6QPnZDoKYRGwA:9 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTA2MDE1NyBTYWx0ZWRfX01uvkH428Wb1 p3laDn0FB50M3ykr8PJjV9q5ZVEs74SfJhx/acYABGB9Kkv4g14/8GYGmmJ3WQU0ILJjxIssWF4 MbWdOOgtGYzm9Gxo+A6TKkg5B5XErxfbh82tfhjT8wmZS0HWiRQvbJT0CO8KD+XmgTXaJGOHKra 8BoqZMpZ1mjhho3o8Uv9xTtSDHMjt/bxJbnSPpIb0vOrYkk6z7nHwi63R60YI7CWXPX1D7zDmlG g54VCIvDtU8ghM9gYCZojVz1rctE2eMfVuobSxRaU/uQcGv3ohiHsP96X3jn2TRsRJl5Lq3XrZv Fky2GnYXJUfpSZ2XafzqFp/di0oELmgFc4AHsGdLGNRUXYxiSOfY5TiGMQVBkHgrHrWxg8nNU14 JvzX92hKz8HWpcJiO5o6CDwEpA1GiAlzhh+QHVYp2pxfWqsXpzBMRKGNTkygCrbwAoVen7cM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-06_07,2025-05-05_01,2025-02-21_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 suspectscore=0 impostorscore=0 mlxscore=0 malwarescore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 bulkscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2504070000 definitions=main-2505060157 There are emulation FPGA platforms or other platforms where UFS low power mode is either unsupported or power efficiency is not a critical requirement. Add support for parsing disable LPM property from device tree . The disable lpm support in devicetree is added through the "disable-lpm" property for such platforms. Disabling LPM ensure stable operation and compatibility with these environments, where power management features might interfere with performance or functionality. Signed-off-by: Nitin Rawat --- drivers/ufs/host/ufshcd-pltfrm.c | 13 +++++++++++++ include/ufs/ufshcd.h | 1 + 2 files changed, 14 insertions(+) -- 2.48.1 diff --git a/drivers/ufs/host/ufshcd-pltfrm.c b/drivers/ufs/host/ufshcd-pltfrm.c index ffe5d1d2b215..deed658fedad 100644 --- a/drivers/ufs/host/ufshcd-pltfrm.c +++ b/drivers/ufs/host/ufshcd-pltfrm.c @@ -210,6 +210,17 @@ static void ufshcd_init_lanes_per_dir(struct ufs_hba *hba) } } +/** + * ufshcd_parse_lpm_support - read from DT whether LPM modes should be disabled. + * @hba: host controller instance + */ +static void ufshcd_parse_lpm_support(struct ufs_hba *hba) +{ + struct device *dev = hba->dev; + + hba->disable_lpm = of_property_read_bool(dev->of_node, "disable-lpm"); +} + /** * ufshcd_parse_clock_min_max_freq - Parse MIN and MAX clocks freq * @hba: per adapter instance @@ -495,6 +506,8 @@ int ufshcd_pltfrm_init(struct platform_device *pdev, ufshcd_init_lanes_per_dir(hba); + ufshcd_parse_lpm_support(hba); + err = ufshcd_parse_operating_points(hba); if (err) { dev_err(dev, "%s: OPP parse failed %d\n", __func__, err); diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index e928ed0265ff..5a3daed1f086 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -1143,6 +1143,7 @@ struct ufs_hba { int critical_health_count; atomic_t dev_lvl_exception_count; u64 dev_lvl_exception_id; + bool disable_lpm; }; /** From patchwork Tue May 6 16:37:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nitin Rawat X-Patchwork-Id: 887863 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2A4B285406; Tue, 6 May 2025 16:37:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746549468; cv=none; b=TcylBfL5rpkiH163MDNaJEqS+1D+x1xhvqlpX0TYHzKIvbRhZGs0BDe3SiIbFpZK6lYhA9aLGD8lcXj1Eny2PPxH0R1Xj7slVh/se7Mqj+cv/uqh/1OtZlVGf2RKzY3cgvk5gxiTtbCJpSU+mbSBOnbjueWZek35W8YoE5nwn/E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746549468; c=relaxed/simple; bh=rl+VdJnM8U54MEl4WHmsvqizGTzkQ+fz3Py8qHb+n/A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=j7SRN/KduzwKMo644RwvoCCINovtd/MzeutXGX1ZJT+k2SkVxhWbm90fHUZrZXk6/ZLm+J20e03fjd7Pn6qq4Ip38ZAhLwCsyFOoK/w096rf/M+hWpRY0rG8bz+5dLFfOJCB7lxZc5AHpCON2bEJY5lLMpRCGxMbqat0z7NhNsE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=qualcomm.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=Kx3UI59W; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Kx3UI59W" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5468FFKQ013247; Tue, 6 May 2025 16:37:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=AnZXfvO2F4n jdN9SKiMeC1UFuBcsq368N5AF4Tbnc1M=; b=Kx3UI59W/cplb8j2ebmjukIrh6j zBKZc3N/9oIDp9SEGX2jKmaEo2WfbzBIEB0iJOiiACXlfPEzyCCa3yo/CA+b9DA4 hXh9RN8HOhi8TcLEq4hS3SBBxLqcz3Zb0vBY2W++arYFU4QegRaiBJyp7DaQ0QIO OtLE8kj6aceZEOSjUZuSB3wkulble9J180nyipr9Ud3Nd6wH/ZZyT9I3iysKffT5 C1DFpHuGix/vXhCf5eMw1oX2+ePKzAyGCfu4BL2S6As+FoSX5qiAjSUEp0+tZwY2 FNhUMPIpv1TjkcIIwqa+qIjWRs+xieU97R5/S2Ig6hd3foBbWCkSj18U2KA== 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 46f5u42yn3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 May 2025 16:37:15 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTP id 546GbCIE003142; Tue, 6 May 2025 16:37:12 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 46dc7kx4mh-1; Tue, 06 May 2025 16:37:12 +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 546GbBdK003137; Tue, 6 May 2025 16:37:12 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 546GbB9D003135; Tue, 06 May 2025 16:37:11 +0000 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 2342877) id 185885015A9; Tue, 6 May 2025 22:07:11 +0530 (+0530) From: Nitin Rawat To: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, krzk+dt@kernel.org, robh@kernel.org, mani@kernel.org, conor+dt@kernel.org, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, beanhuo@micron.com, peter.wang@mediatek.com Cc: linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Nitin Rawat Subject: [PATCH V2 3/3] scsi: ufs: qcom: Add support to disable UFS LPM Feature Date: Tue, 6 May 2025 22:07:05 +0530 Message-ID: <20250506163705.31518-4-quic_nitirawa@quicinc.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250506163705.31518-1-quic_nitirawa@quicinc.com> References: <20250506163705.31518-1-quic_nitirawa@quicinc.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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-Authority-Analysis: v=2.4 cv=KcfSsRYD c=1 sm=1 tr=0 ts=681a3abb cx=c_pps a=Ou0eQOY4+eZoSc0qltEV5Q==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=xQxKfdDwmO31qOoK2vYA:9 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-GUID: Q1ylV7Bx-Ra_HMbSphY1rWezIYfnpAMv X-Proofpoint-ORIG-GUID: Q1ylV7Bx-Ra_HMbSphY1rWezIYfnpAMv X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTA2MDE1NyBTYWx0ZWRfXzZPgNsenZhX2 1w/6oZRFvytp8t7yL4dYm1xEPKyk6iFlYUOvXvNV0GpiClmgy8JS0JOy6R66WvD3rm6979YK+td htFa1lPb6YjdNkEtVlF8zn+6pCHVIBCCJLvFHX2DynYZ+VHJOpo77DDWQJEOdULslxn6m04Pzb4 ZGHMm63a2EGjLLDE3thGrvQBQNbzpcBcLLgs3ZJpDvDGkdAzl3kPdAreWwOmohnAaYxgBXOfA3Z luWtshlKcViIhAai1FNgUEpvy35NSiXHJcdMcGQ12Oapl8A68XAdkJo0/b4WYIkalDOcxDN7b3+ i9ErGktb77pAYzsr+8kVZLgKJGX0zrS1B7mnsSrazSVMswZjtNDO75N6AEMnGa1TgBnqTR5M4UI wGqfZXVanODrekzsHRKpCwclS1lOyqfwkttZLL7KnTZmw/MFfdUyXVbKZUxTWuSfjWpYqf8p X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-06_07,2025-05-05_01,2025-02-21_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 impostorscore=0 priorityscore=1501 malwarescore=0 adultscore=0 clxscore=1015 mlxscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2504070000 definitions=main-2505060157 There are emulation FPGA platforms or other platforms where UFS low power mode is either unsupported or power efficiency is not a critical requirement. Disable all low power mode UFS feature based on the "disable-lpm" device tree property parsed in platform driver. Signed-off-by: Nitin Rawat --- drivers/ufs/host/ufs-qcom.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) -- 2.48.1 diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index c0761ccc1381..ad4974c6d08e 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -1057,12 +1057,15 @@ static void ufs_qcom_set_host_caps(struct ufs_hba *hba) static void ufs_qcom_set_caps(struct ufs_hba *hba) { - hba->caps |= UFSHCD_CAP_CLK_GATING | UFSHCD_CAP_HIBERN8_WITH_CLK_GATING; - hba->caps |= UFSHCD_CAP_CLK_SCALING | UFSHCD_CAP_WB_WITH_CLK_SCALING; - hba->caps |= UFSHCD_CAP_AUTO_BKOPS_SUSPEND; + if (!hba->disable_lpm) { + hba->caps |= UFSHCD_CAP_CLK_GATING | UFSHCD_CAP_HIBERN8_WITH_CLK_GATING; + hba->caps |= UFSHCD_CAP_CLK_SCALING | UFSHCD_CAP_WB_WITH_CLK_SCALING; + hba->caps |= UFSHCD_CAP_AUTO_BKOPS_SUSPEND; + hba->caps |= UFSHCD_CAP_AGGR_POWER_COLLAPSE; + hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND; + } + hba->caps |= UFSHCD_CAP_WB_EN; - hba->caps |= UFSHCD_CAP_AGGR_POWER_COLLAPSE; - hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND; ufs_qcom_set_host_caps(hba); }