ANDROID: Add vendor hook for ufs perf heuristic and error recovery

Added vendor hook to consider ufs host/device perf heuristic
and error recovery according to different platform/design
Vendor/Platform can take necessary action according to their
design/implementation

Added vendor hook before calling UFS command ops
   - trace_android_vh_ufs_perf_huristic_ctrl
Added vendor hook after sending UFS command to host
   - trace_android_vh_ufs_send_command_post_change
Added vendor hook for abort success case
   - trace_android_vh_ufs_abort_success_ctrl

Added vendor hook for completion response check
 - trace_android_vh_ufs_compl_rsp_check_done
Added vendor hook for vendor specific error handling
 - trace_android_vh_ufs_err_handler
Added vendor hook for err logs printing control
 - trace_android_vh_ufs_err_print_ctrl
Added vendor hook for error checking flow trigger
 - trace_android_vh_ufs_err_check_ctrl

Bug: 312806167
Change-Id: I2190afe62b60da9d47001307f858f10fc8a59986
Signed-off-by: Sanjeev Yadav <sanjeev.y@mediatek.com>
Signed-off-by: Browse Zhang <browse.zhang@mediatek.com>
This commit is contained in:
Browse Zhang 2023-12-11 15:13:19 +08:00 committed by Todd Kjos
parent 7b8b02fa37
commit 85d8fb9163
2 changed files with 41 additions and 0 deletions

View File

@ -505,6 +505,13 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_transaction_received);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_oem_binder_struct);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_special_task);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_free_buf);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_perf_huristic_ctrl);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_send_command_post_change);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_abort_success_ctrl);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_compl_rsp_check_done);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_err_handler);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_err_check_ctrl);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_err_print_ctrl);
/*
* For type visibility
*/

View File

@ -75,6 +75,40 @@ DECLARE_HOOK(android_vh_ufs_update_sdev,
DECLARE_HOOK(android_vh_ufs_clock_scaling,
TP_PROTO(struct ufs_hba *hba, bool *force_out, bool *force_scaling, bool *scale_up),
TP_ARGS(hba, force_out, force_scaling, scale_up));
DECLARE_HOOK(android_vh_ufs_send_command_post_change,
TP_PROTO(struct ufs_hba *hba, struct ufshcd_lrb *lrbp),
TP_ARGS(hba, lrbp));
DECLARE_HOOK(android_vh_ufs_perf_huristic_ctrl,
TP_PROTO(struct ufs_hba *hba,
struct ufshcd_lrb *lrbp, int *err),
TP_ARGS(hba, lrbp, err));
DECLARE_HOOK(android_vh_ufs_abort_success_ctrl,
TP_PROTO(struct ufs_hba *hba,
struct ufshcd_lrb *lrbp),
TP_ARGS(hba, lrbp));
DECLARE_HOOK(android_vh_ufs_err_handler,
TP_PROTO(struct ufs_hba *hba,
bool *err_handled),
TP_ARGS(hba, err_handled));
DECLARE_HOOK(android_vh_ufs_compl_rsp_check_done,
TP_PROTO(struct ufs_hba *hba,
struct ufshcd_lrb *lrbp, bool *done),
TP_ARGS(hba, lrbp, done));
DECLARE_HOOK(android_vh_ufs_err_print_ctrl,
TP_PROTO(struct ufs_hba *hba,
bool *skip),
TP_ARGS(hba, skip));
DECLARE_HOOK(android_vh_ufs_err_check_ctrl,
TP_PROTO(struct ufs_hba *hba,
bool *err_check),
TP_ARGS(hba, err_check));
#endif /* _TRACE_HOOK_UFSHCD_H */
/* This part must be outside protection */
#include <trace/define_trace.h>