* [PATCH V1 0/3] Add support to disable UFS LPM
@ 2025-04-17 12:46 Nitin Rawat
2025-04-17 12:46 ` [PATCH V1 1/3] scsi: ufs: dt-bindings: Document UFS Disable LPM property Nitin Rawat
` (3 more replies)
0 siblings, 4 replies; 13+ messages in thread
From: Nitin Rawat @ 2025-04-17 12:46 UTC (permalink / raw)
To: alim.akhtar, avri.altman, bvanassche, krzk+dt, robh, mani,
conor+dt, James.Bottomley, martin.petersen, beanhuo, peter.wang
Cc: linux-arm-msm, linux-scsi, linux-kernel, devicetree, Nitin Rawat
Add support to disable UFS Low Power Mode (LPM) for platforms
that doesn't support LPM.
Nitin Rawat (3):
scsi: ufs: dt-bindings: Document UFS Disable LPM property
scsi: ufs: pltfrm: Add parsing support for disable LPM property
scsi: ufs: qcom: Add support to disable UFS LPM Feature
.../devicetree/bindings/ufs/ufs-common.yaml | 5 +++++
drivers/ufs/host/ufs-qcom.c | 15 ++++++++-------
drivers/ufs/host/ufshcd-pltfrm.c | 15 +++++++++++++++
include/ufs/ufshcd.h | 1 +
4 files changed, 29 insertions(+), 7 deletions(-)
--
2.48.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH V1 1/3] scsi: ufs: dt-bindings: Document UFS Disable LPM property
2025-04-17 12:46 [PATCH V1 0/3] Add support to disable UFS LPM Nitin Rawat
@ 2025-04-17 12:46 ` Nitin Rawat
2025-04-17 12:46 ` [PATCH V1 2/3] scsi: ufs: pltfrm: Add parsing support for disable " Nitin Rawat
` (2 subsequent siblings)
3 siblings, 0 replies; 13+ messages in thread
From: Nitin Rawat @ 2025-04-17 12:46 UTC (permalink / raw)
To: alim.akhtar, avri.altman, bvanassche, krzk+dt, robh, mani,
conor+dt, James.Bottomley, martin.petersen, beanhuo, peter.wang
Cc: linux-arm-msm, linux-scsi, linux-kernel, devicetree, Nitin Rawat
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 <quic_nitirawa@quicinc.com>
---
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 ]
--
2.48.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH V1 2/3] scsi: ufs: pltfrm: Add parsing support for disable LPM property
2025-04-17 12:46 [PATCH V1 0/3] Add support to disable UFS LPM Nitin Rawat
2025-04-17 12:46 ` [PATCH V1 1/3] scsi: ufs: dt-bindings: Document UFS Disable LPM property Nitin Rawat
@ 2025-04-17 12:46 ` Nitin Rawat
2025-04-18 4:43 ` Mukesh Kumar Savaliya
2025-04-17 12:46 ` [PATCH V1 3/3] scsi: ufs: qcom: Add support to disable UFS LPM Feature Nitin Rawat
2025-04-17 21:36 ` [PATCH V1 0/3] Add support to disable UFS LPM Bart Van Assche
3 siblings, 1 reply; 13+ messages in thread
From: Nitin Rawat @ 2025-04-17 12:46 UTC (permalink / raw)
To: alim.akhtar, avri.altman, bvanassche, krzk+dt, robh, mani,
conor+dt, James.Bottomley, martin.petersen, beanhuo, peter.wang
Cc: linux-arm-msm, linux-scsi, linux-kernel, devicetree, Nitin Rawat
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 <quic_nitirawa@quicinc.com>
---
drivers/ufs/host/ufshcd-pltfrm.c | 15 +++++++++++++++
include/ufs/ufshcd.h | 1 +
2 files changed, 16 insertions(+)
diff --git a/drivers/ufs/host/ufshcd-pltfrm.c b/drivers/ufs/host/ufshcd-pltfrm.c
index ffe5d1d2b215..764525d9262b 100644
--- a/drivers/ufs/host/ufshcd-pltfrm.c
+++ b/drivers/ufs/host/ufshcd-pltfrm.c
@@ -210,6 +210,19 @@ 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");
+ if (hba->disable_lpm)
+ dev_info(hba->dev, "UFS LPM is disabled\n");
+}
+
/**
* ufshcd_parse_clock_min_max_freq - Parse MIN and MAX clocks freq
* @hba: per adapter instance
@@ -495,6 +508,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;
};
/**
--
2.48.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH V1 3/3] scsi: ufs: qcom: Add support to disable UFS LPM Feature
2025-04-17 12:46 [PATCH V1 0/3] Add support to disable UFS LPM Nitin Rawat
2025-04-17 12:46 ` [PATCH V1 1/3] scsi: ufs: dt-bindings: Document UFS Disable LPM property Nitin Rawat
2025-04-17 12:46 ` [PATCH V1 2/3] scsi: ufs: pltfrm: Add parsing support for disable " Nitin Rawat
@ 2025-04-17 12:46 ` Nitin Rawat
2025-04-22 12:45 ` Rob Herring
2025-04-23 5:00 ` Peter Wang (王信友)
2025-04-17 21:36 ` [PATCH V1 0/3] Add support to disable UFS LPM Bart Van Assche
3 siblings, 2 replies; 13+ messages in thread
From: Nitin Rawat @ 2025-04-17 12:46 UTC (permalink / raw)
To: alim.akhtar, avri.altman, bvanassche, krzk+dt, robh, mani,
conor+dt, James.Bottomley, martin.petersen, beanhuo, peter.wang
Cc: linux-arm-msm, linux-scsi, linux-kernel, devicetree, Nitin Rawat
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 <quic_nitirawa@quicinc.com>
---
drivers/ufs/host/ufs-qcom.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index 1b37449fbffc..1024edf36b68 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -1014,13 +1014,14 @@ 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;
- hba->caps |= UFSHCD_CAP_WB_EN;
- hba->caps |= UFSHCD_CAP_AGGR_POWER_COLLAPSE;
- hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND;
-
+ 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_WB_EN;
+ hba->caps |= UFSHCD_CAP_AGGR_POWER_COLLAPSE;
+ hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND;
+ }
ufs_qcom_set_host_caps(hba);
}
--
2.48.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH V1 0/3] Add support to disable UFS LPM
2025-04-17 12:46 [PATCH V1 0/3] Add support to disable UFS LPM Nitin Rawat
` (2 preceding siblings ...)
2025-04-17 12:46 ` [PATCH V1 3/3] scsi: ufs: qcom: Add support to disable UFS LPM Feature Nitin Rawat
@ 2025-04-17 21:36 ` Bart Van Assche
3 siblings, 0 replies; 13+ messages in thread
From: Bart Van Assche @ 2025-04-17 21:36 UTC (permalink / raw)
To: Nitin Rawat, alim.akhtar, avri.altman, krzk+dt, robh, mani,
conor+dt, James.Bottomley, martin.petersen, beanhuo, peter.wang
Cc: linux-arm-msm, linux-scsi, linux-kernel, devicetree
On 4/17/25 5:46 AM, Nitin Rawat wrote:
> Add support to disable UFS Low Power Mode (LPM) for platforms
> that doesn't support LPM.
This patch series looks good to me.
Thanks,
Bart.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH V1 2/3] scsi: ufs: pltfrm: Add parsing support for disable LPM property
2025-04-17 12:46 ` [PATCH V1 2/3] scsi: ufs: pltfrm: Add parsing support for disable " Nitin Rawat
@ 2025-04-18 4:43 ` Mukesh Kumar Savaliya
2025-04-22 12:38 ` Rob Herring
0 siblings, 1 reply; 13+ messages in thread
From: Mukesh Kumar Savaliya @ 2025-04-18 4:43 UTC (permalink / raw)
To: Nitin Rawat, alim.akhtar, avri.altman, bvanassche, krzk+dt, robh,
mani, conor+dt, James.Bottomley, martin.petersen, beanhuo,
peter.wang
Cc: linux-arm-msm, linux-scsi, linux-kernel, devicetree
On 4/17/2025 6:16 PM, Nitin Rawat wrote:
[...]
> +/**
> + * 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");
> + if (hba->disable_lpm)
> + dev_info(hba->dev, "UFS LPM is disabled\n");
How about keeping as debug ?
> +}
> +
[...]
> --
> 2.48.1
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH V1 2/3] scsi: ufs: pltfrm: Add parsing support for disable LPM property
2025-04-18 4:43 ` Mukesh Kumar Savaliya
@ 2025-04-22 12:38 ` Rob Herring
0 siblings, 0 replies; 13+ messages in thread
From: Rob Herring @ 2025-04-22 12:38 UTC (permalink / raw)
To: Mukesh Kumar Savaliya
Cc: Nitin Rawat, alim.akhtar, avri.altman, bvanassche, krzk+dt, mani,
conor+dt, James.Bottomley, martin.petersen, beanhuo, peter.wang,
linux-arm-msm, linux-scsi, linux-kernel, devicetree
On Fri, Apr 18, 2025 at 10:13:46AM +0530, Mukesh Kumar Savaliya wrote:
>
>
> On 4/17/2025 6:16 PM, Nitin Rawat wrote:
> [...]
> > +/**
> > + * 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");
> > + if (hba->disable_lpm)
> > + dev_info(hba->dev, "UFS LPM is disabled\n");
> How about keeping as debug ?
Why print it at all. You can just read the DT from userspace.
Rob
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH V1 3/3] scsi: ufs: qcom: Add support to disable UFS LPM Feature
2025-04-17 12:46 ` [PATCH V1 3/3] scsi: ufs: qcom: Add support to disable UFS LPM Feature Nitin Rawat
@ 2025-04-22 12:45 ` Rob Herring
2025-04-22 19:44 ` Nitin Rawat
2025-04-23 5:00 ` Peter Wang (王信友)
1 sibling, 1 reply; 13+ messages in thread
From: Rob Herring @ 2025-04-22 12:45 UTC (permalink / raw)
To: Nitin Rawat
Cc: alim.akhtar, avri.altman, bvanassche, krzk+dt, mani, conor+dt,
James.Bottomley, martin.petersen, beanhuo, peter.wang,
linux-arm-msm, linux-scsi, linux-kernel, devicetree
On Thu, Apr 17, 2025 at 06:16:45PM +0530, Nitin Rawat wrote:
> 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 <quic_nitirawa@quicinc.com>
> ---
> drivers/ufs/host/ufs-qcom.c | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index 1b37449fbffc..1024edf36b68 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -1014,13 +1014,14 @@ 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;
> - hba->caps |= UFSHCD_CAP_WB_EN;
> - hba->caps |= UFSHCD_CAP_AGGR_POWER_COLLAPSE;
> - hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND;
> -
> + 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_WB_EN;
> + hba->caps |= UFSHCD_CAP_AGGR_POWER_COLLAPSE;
> + hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND;
> + }
Doesn't RuntimePM already have userspace controls? And that's a Linux
feature that shouldn't really be controlled by DT. I think this property
should still to things defined by the UFS spec.
Rob
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH V1 3/3] scsi: ufs: qcom: Add support to disable UFS LPM Feature
2025-04-22 12:45 ` Rob Herring
@ 2025-04-22 19:44 ` Nitin Rawat
2025-04-23 13:56 ` Rob Herring
0 siblings, 1 reply; 13+ messages in thread
From: Nitin Rawat @ 2025-04-22 19:44 UTC (permalink / raw)
To: Rob Herring
Cc: alim.akhtar, avri.altman, bvanassche, krzk+dt, mani, conor+dt,
James.Bottomley, martin.petersen, beanhuo, peter.wang,
linux-arm-msm, linux-scsi, linux-kernel, devicetree
On 4/22/2025 6:15 PM, Rob Herring wrote:
> On Thu, Apr 17, 2025 at 06:16:45PM +0530, Nitin Rawat wrote:
>> 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 <quic_nitirawa@quicinc.com>
>> ---
>> drivers/ufs/host/ufs-qcom.c | 15 ++++++++-------
>> 1 file changed, 8 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
>> index 1b37449fbffc..1024edf36b68 100644
>> --- a/drivers/ufs/host/ufs-qcom.c
>> +++ b/drivers/ufs/host/ufs-qcom.c
>> @@ -1014,13 +1014,14 @@ 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;
>> - hba->caps |= UFSHCD_CAP_WB_EN;
>> - hba->caps |= UFSHCD_CAP_AGGR_POWER_COLLAPSE;
>> - hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND;
>> -
>> + 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_WB_EN;
>> + hba->caps |= UFSHCD_CAP_AGGR_POWER_COLLAPSE;
>> + hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND;
>> + }
>
> Doesn't RuntimePM already have userspace controls? And that's a Linux
> feature that shouldn't really be controlled by DT. I think this property
> should still to things defined by the UFS spec.
Hi Rob,
Yes userspace has runtime PM control but by the time UFS driver probes
completes and userspace is up, there are chances runtime PM may get
kicked in.
Regards,
Nitin
>
> Rob
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH V1 3/3] scsi: ufs: qcom: Add support to disable UFS LPM Feature
2025-04-17 12:46 ` [PATCH V1 3/3] scsi: ufs: qcom: Add support to disable UFS LPM Feature Nitin Rawat
2025-04-22 12:45 ` Rob Herring
@ 2025-04-23 5:00 ` Peter Wang (王信友)
2025-04-23 6:24 ` Nitin Rawat
1 sibling, 1 reply; 13+ messages in thread
From: Peter Wang (王信友) @ 2025-04-23 5:00 UTC (permalink / raw)
To: avri.altman@wdc.com, beanhuo@micron.com,
quic_nitirawa@quicinc.com, robh@kernel.org, bvanassche@acm.org,
alim.akhtar@samsung.com, krzk+dt@kernel.org, conor+dt@kernel.org,
mani@kernel.org, James.Bottomley@HansenPartnership.com,
martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-arm-msm@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
On Thu, 2025-04-17 at 18:16 +0530, Nitin Rawat wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>
>
> 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 <quic_nitirawa@quicinc.com>
> ---
> drivers/ufs/host/ufs-qcom.c | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-
> qcom.c
> index 1b37449fbffc..1024edf36b68 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -1014,13 +1014,14 @@ 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;
> - hba->caps |= UFSHCD_CAP_WB_EN;
> - hba->caps |= UFSHCD_CAP_AGGR_POWER_COLLAPSE;
> - hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND;
> -
> + 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_WB_EN;
>
Hi, Nitin,
If hba->disable_lpm is true, WB should enable?
Normally, you don't care about low power, so why wouldn't you enable
WB?
Thanks.
Peter
> + hba->caps |= UFSHCD_CAP_AGGR_POWER_COLLAPSE;
> + hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND;
> + }
> ufs_qcom_set_host_caps(hba);
> }
>
> --
> 2.48.1
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH V1 3/3] scsi: ufs: qcom: Add support to disable UFS LPM Feature
2025-04-23 5:00 ` Peter Wang (王信友)
@ 2025-04-23 6:24 ` Nitin Rawat
0 siblings, 0 replies; 13+ messages in thread
From: Nitin Rawat @ 2025-04-23 6:24 UTC (permalink / raw)
To: Peter Wang (王信友), avri.altman@wdc.com,
beanhuo@micron.com, robh@kernel.org, bvanassche@acm.org,
alim.akhtar@samsung.com, krzk+dt@kernel.org, conor+dt@kernel.org,
mani@kernel.org, James.Bottomley@HansenPartnership.com,
martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-arm-msm@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
On 4/23/2025 10:30 AM, Peter Wang (王信友) wrote:
> On Thu, 2025-04-17 at 18:16 +0530, Nitin Rawat wrote:
>>
>> External email : Please do not click links or open attachments until
>> you have verified the sender or the content.
>>
>>
>> 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 <quic_nitirawa@quicinc.com>
>> ---
>> drivers/ufs/host/ufs-qcom.c | 15 ++++++++-------
>> 1 file changed, 8 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-
>> qcom.c
>> index 1b37449fbffc..1024edf36b68 100644
>> --- a/drivers/ufs/host/ufs-qcom.c
>> +++ b/drivers/ufs/host/ufs-qcom.c
>> @@ -1014,13 +1014,14 @@ 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;
>> - hba->caps |= UFSHCD_CAP_WB_EN;
>> - hba->caps |= UFSHCD_CAP_AGGR_POWER_COLLAPSE;
>> - hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND;
>> -
>> + 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_WB_EN;
>>
>
> Hi, Nitin,
>
> If hba->disable_lpm is true, WB should enable?
> Normally, you don't care about low power, so why wouldn't you enable
> WB?
>
Hi Peter,
Thanks for review. Agree with you.
I will update this in next patchset.
Regards,
Nitin
> Thanks.
> Peter
>
>
>
>> + hba->caps |= UFSHCD_CAP_AGGR_POWER_COLLAPSE;
>> + hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND;
>> + }
>> ufs_qcom_set_host_caps(hba);
>> }
>>
>> --
>> 2.48.1
>>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH V1 3/3] scsi: ufs: qcom: Add support to disable UFS LPM Feature
2025-04-22 19:44 ` Nitin Rawat
@ 2025-04-23 13:56 ` Rob Herring
2025-04-25 20:22 ` Nitin Rawat
0 siblings, 1 reply; 13+ messages in thread
From: Rob Herring @ 2025-04-23 13:56 UTC (permalink / raw)
To: Nitin Rawat
Cc: alim.akhtar, avri.altman, bvanassche, krzk+dt, mani, conor+dt,
James.Bottomley, martin.petersen, beanhuo, peter.wang,
linux-arm-msm, linux-scsi, linux-kernel, devicetree
On Wed, Apr 23, 2025 at 01:14:27AM +0530, Nitin Rawat wrote:
>
>
> On 4/22/2025 6:15 PM, Rob Herring wrote:
> > On Thu, Apr 17, 2025 at 06:16:45PM +0530, Nitin Rawat wrote:
> > > 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 <quic_nitirawa@quicinc.com>
> > > ---
> > > drivers/ufs/host/ufs-qcom.c | 15 ++++++++-------
> > > 1 file changed, 8 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> > > index 1b37449fbffc..1024edf36b68 100644
> > > --- a/drivers/ufs/host/ufs-qcom.c
> > > +++ b/drivers/ufs/host/ufs-qcom.c
> > > @@ -1014,13 +1014,14 @@ 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;
> > > - hba->caps |= UFSHCD_CAP_WB_EN;
> > > - hba->caps |= UFSHCD_CAP_AGGR_POWER_COLLAPSE;
> > > - hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND;
> > > -
> > > + 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_WB_EN;
> > > + hba->caps |= UFSHCD_CAP_AGGR_POWER_COLLAPSE;
> > > + hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND;
> > > + }
> >
> > Doesn't RuntimePM already have userspace controls? And that's a Linux
> > feature that shouldn't really be controlled by DT. I think this property
> > should still to things defined by the UFS spec.
>
> Hi Rob,
> Yes userspace has runtime PM control but by the time UFS driver probes
> completes and userspace is up, there are chances runtime PM may get kicked
> in.
That sounds like a problem more than 1 device would have...
Rob
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH V1 3/3] scsi: ufs: qcom: Add support to disable UFS LPM Feature
2025-04-23 13:56 ` Rob Herring
@ 2025-04-25 20:22 ` Nitin Rawat
0 siblings, 0 replies; 13+ messages in thread
From: Nitin Rawat @ 2025-04-25 20:22 UTC (permalink / raw)
To: Rob Herring
Cc: alim.akhtar, avri.altman, bvanassche, krzk+dt, mani, conor+dt,
James.Bottomley, martin.petersen, beanhuo, peter.wang,
linux-arm-msm, linux-scsi, linux-kernel, devicetree
On 4/23/2025 7:26 PM, Rob Herring wrote:
> On Wed, Apr 23, 2025 at 01:14:27AM +0530, Nitin Rawat wrote:
>>
>>
>> On 4/22/2025 6:15 PM, Rob Herring wrote:
>>> On Thu, Apr 17, 2025 at 06:16:45PM +0530, Nitin Rawat wrote:
>>>> 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 <quic_nitirawa@quicinc.com>
>>>> ---
>>>> drivers/ufs/host/ufs-qcom.c | 15 ++++++++-------
>>>> 1 file changed, 8 insertions(+), 7 deletions(-)
>>>>
>>>> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
>>>> index 1b37449fbffc..1024edf36b68 100644
>>>> --- a/drivers/ufs/host/ufs-qcom.c
>>>> +++ b/drivers/ufs/host/ufs-qcom.c
>>>> @@ -1014,13 +1014,14 @@ 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;
>>>> - hba->caps |= UFSHCD_CAP_WB_EN;
>>>> - hba->caps |= UFSHCD_CAP_AGGR_POWER_COLLAPSE;
>>>> - hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND;
>>>> -
>>>> + 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_WB_EN;
>>>> + hba->caps |= UFSHCD_CAP_AGGR_POWER_COLLAPSE;
>>>> + hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND;
>>>> + }
>>>
>>> Doesn't RuntimePM already have userspace controls? And that's a Linux
>>> feature that shouldn't really be controlled by DT. I think this property
>>> should still to things defined by the UFS spec.
>>
>> Hi Rob,
>> Yes userspace has runtime PM control but by the time UFS driver probes
>> completes and userspace is up, there are chances runtime PM may get kicked
>> in.
>
> That sounds like a problem more than 1 device would have...
Yes, Rob, since there's a possibility that runtime suspend might be
triggered for some devices before probe completes and userspace is up,
IMO it's better to disable the runtime PM capability during
initialization based on the device tree for specific FPGA platforms that
don't support LPM.
What's your opinion on this?"
Regards,
Nitin
>
> Rob
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2025-04-25 20:23 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-17 12:46 [PATCH V1 0/3] Add support to disable UFS LPM Nitin Rawat
2025-04-17 12:46 ` [PATCH V1 1/3] scsi: ufs: dt-bindings: Document UFS Disable LPM property Nitin Rawat
2025-04-17 12:46 ` [PATCH V1 2/3] scsi: ufs: pltfrm: Add parsing support for disable " Nitin Rawat
2025-04-18 4:43 ` Mukesh Kumar Savaliya
2025-04-22 12:38 ` Rob Herring
2025-04-17 12:46 ` [PATCH V1 3/3] scsi: ufs: qcom: Add support to disable UFS LPM Feature Nitin Rawat
2025-04-22 12:45 ` Rob Herring
2025-04-22 19:44 ` Nitin Rawat
2025-04-23 13:56 ` Rob Herring
2025-04-25 20:22 ` Nitin Rawat
2025-04-23 5:00 ` Peter Wang (王信友)
2025-04-23 6:24 ` Nitin Rawat
2025-04-17 21:36 ` [PATCH V1 0/3] Add support to disable UFS LPM Bart Van Assche
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).