diff options
| author | Ram Kumar Dwivedi <ram.dwivedi@oss.qualcomm.com> | 2026-01-13 13:30:45 +0530 |
|---|---|---|
| committer | Martin K. Petersen <martin.petersen@oracle.com> | 2026-01-23 22:04:32 -0500 |
| commit | 26c06d0baeb7999e44cf6717fc12d58a359eba99 (patch) | |
| tree | bd1023496c70ae56fd09a5e5fe2f4f41128e9199 /include | |
| parent | e2725ed2a7fb5f5f468020a52bd9ffc54caa7c8c (diff) | |
scsi: ufs: core: Enforce minimum PM level for sysfs configuration
Some UFS platforms only support a limited subset of power levels.
Currently, the sysfs interface allows users to set any PM level without
validating the minimum supported value. If an unsupported level is
selected, suspend may fail.
Introduce an pm_lvl_min field in the ufs_hba structure and use it to
clamp the PM level requested via sysfs so that only supported levels are
accepted. Platforms that require a minimum PM level can set this field
during probe.
Signed-off-by: Ram Kumar Dwivedi <ram.dwivedi@oss.qualcomm.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20260113080046.284089-4-ram.dwivedi@oss.qualcomm.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/ufs/ufshcd.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index 19154228780b..a64c19563b03 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -834,6 +834,7 @@ enum ufshcd_mcq_opr { * @uic_link_state: active state of the link to the UFS device. * @rpm_lvl: desired UFS power management level during runtime PM. * @spm_lvl: desired UFS power management level during system PM. + * @pm_lvl_min: minimum supported power management level. * @pm_op_in_progress: whether or not a PM operation is in progress. * @ahit: value of Auto-Hibernate Idle Timer register. * @outstanding_tasks: Bits representing outstanding task requests @@ -972,6 +973,7 @@ struct ufs_hba { enum ufs_pm_level rpm_lvl; /* Desired UFS power management level during system PM */ enum ufs_pm_level spm_lvl; + enum ufs_pm_level pm_lvl_min; int pm_op_in_progress; /* Auto-Hibernate Idle Timer register value */ |
