ANDROID: ufs: Improve MCQ err handling

- Add android vendor hook:
 android_vh_ufs_mcq_abort
 android_vh_ufs_use_mcq_hooks

Bug: 280041543
Change-Id: I9cd4372c20fc179804e26391e2cb758fb02e5b72
Signed-off-by: SEO HOYOUNG <hy50.seo@samsung.com>
This commit is contained in:
SEO HOYOUNG 2023-04-29 11:50:59 +09:00 committed by Sandeep Dhavale
parent 0dec547282
commit e5b77cd49a
3 changed files with 25 additions and 0 deletions

View file

@ -133,6 +133,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_send_tm_command);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_check_int_errors);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_update_sdev);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_clock_scaling);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_use_mcq_hooks);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_mcq_abort);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cgroup_attach);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_iommu_setup_dma_ops);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_iommu_alloc_insert_iova);

View file

@ -310,6 +310,15 @@ static void ufshcd_wb_toggle_buf_flush_during_h8(struct ufs_hba *hba,
static void ufshcd_hba_vreg_set_lpm(struct ufs_hba *hba);
static void ufshcd_hba_vreg_set_hpm(struct ufs_hba *hba);
static inline int ufshcd_use_mcq_hooks(struct ufs_hba *hba)
{
bool mcq_hooks = false;
trace_android_vh_ufs_use_mcq_hooks(hba, &mcq_hooks);
return mcq_hooks;
}
static inline void ufshcd_enable_irq(struct ufs_hba *hba)
{
if (!hba->is_irq_enabled) {
@ -7476,6 +7485,11 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
WARN_ONCE(tag < 0, "Invalid tag %d\n", tag);
if (ufshcd_use_mcq_hooks(hba)) {
trace_android_vh_ufs_mcq_abort(hba, cmd, &err);
return err;
}
ufshcd_hold(hba, false);
reg = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL);
/* If command is already aborted/completed, return FAILED. */

View file

@ -57,6 +57,15 @@ 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_use_mcq_hooks,
TP_PROTO(struct ufs_hba *hba, bool *use_mcq),
TP_ARGS(hba, use_mcq));
struct scsi_cmnd;
DECLARE_HOOK(android_vh_ufs_mcq_abort,
TP_PROTO(struct ufs_hba *hba, struct scsi_cmnd *cmd, int *ret),
TP_ARGS(hba, cmd, ret));
#endif /* _TRACE_HOOK_UFSHCD_H */
/* This part must be outside protection */
#include <trace/define_trace.h>