summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Wang <peter.wang@mediatek.com>2024-11-22 05:49:43 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-12-14 21:59:54 +0300
commit1e30b52edf175eee6bd096bd5d38de37ba98a871 (patch)
treea0c1d9d278c25b41e9c50c0d03eede7d1e42c4db /include
parent0069928727c2e95ca26c738fbe6e4b241aeaaf08 (diff)
downloadlinux-1e30b52edf175eee6bd096bd5d38de37ba98a871.tar.xz
scsi: ufs: core: Add missing post notify for power mode change
commit 7f45ed5f0cd5ccbbec79adc6c48a67d6a85fba56 upstream. When the power mode change is successful but the power mode hasn't actually changed, the post notification was missed. Similar to the approach with hibernate/clock scale/hce enable, having pre/post notifications in the same function will make it easier to maintain. Additionally, supplement the description of power parameters for the pwr_change_notify callback. Fixes: 7eb584db73be ("ufs: refactor configuring power mode") Cc: stable@vger.kernel.org #6.11.x Signed-off-by: Peter Wang <peter.wang@mediatek.com> Link: https://lore.kernel.org/r/20241122024943.30589-1-peter.wang@mediatek.com Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/ufs/ufshcd.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index 2a7d6f269d9e..b751969a3ebd 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -304,7 +304,9 @@ struct ufs_pwr_mode_info {
* to allow variant specific Uni-Pro initialization.
* @pwr_change_notify: called before and after a power mode change
* is carried out to allow vendor spesific capabilities
- * to be set.
+ * to be set. PRE_CHANGE can modify final_params based
+ * on desired_pwr_mode, but POST_CHANGE must not alter
+ * the final_params parameter
* @setup_xfer_req: called before any transfer request is issued
* to set some things
* @setup_task_mgmt: called before any task management request is issued
@@ -341,9 +343,9 @@ struct ufs_hba_variant_ops {
int (*link_startup_notify)(struct ufs_hba *,
enum ufs_notify_change_status);
int (*pwr_change_notify)(struct ufs_hba *,
- enum ufs_notify_change_status status,
- struct ufs_pa_layer_attr *,
- struct ufs_pa_layer_attr *);
+ enum ufs_notify_change_status status,
+ struct ufs_pa_layer_attr *desired_pwr_mode,
+ struct ufs_pa_layer_attr *final_params);
void (*setup_xfer_req)(struct ufs_hba *hba, int tag,
bool is_scsi_cmd);
void (*setup_task_mgmt)(struct ufs_hba *, int, u8);