struct s5p_mfc_dump_ops supports the information dump function by call-back.
This is for maintain the layer of the driver.
Function of any layer can call the dump function using "call_dop()" macro,
because it exists in the lowest layer.
Change-Id: Ic452aa316d10ddb6194444fe7aa3f707080d49ae
Signed-off-by: Ayoung Sim <a.sim@samsung.com>
S5P_FIMV_R2H_CMD_CLOSE_INSTANCE_RET)) {
mfc_err_ctx("waiting once more but timed out\n");
dev->logging_data->cause |= (1 << MFC_CAUSE_FAIL_CLOSE_INST);
- s5p_mfc_dump_info_and_stop_hw(dev);
+ call_dop(dev, dump_and_stop_always, dev);
}
}
dev->logging_data->fault_addr = (unsigned int)addr;
s5p_mfc_dump_buffer_info(dev, addr);
- s5p_mfc_dump_info_and_stop_hw(dev);
+ call_dop(dev, dump_and_stop_always, dev);
return 0;
}
}
INIT_WORK(&dev->butler_work, s5p_mfc_butler_worker);
+ /* dump information call-back function */
+ dev->dump_ops = &mfc_dump_ops;
+
#ifdef CONFIG_MFC_USE_BUS_DEVFREQ
atomic_set(&dev->qos_req_cur, 0);
(((c)->c_ops->op) ? \
((c)->c_ops->op(args)) : 0)
+#define call_dop(d, op, args...) \
+ (((d)->dump_ops->op) ? \
+ ((d)->dump_ops->op(args)) : 0)
+
#define MFC_CTRL_TYPE_GET (MFC_CTRL_TYPE_GET_SRC | MFC_CTRL_TYPE_GET_DST)
#define MFC_CTRL_TYPE_SRC (MFC_CTRL_TYPE_SET | MFC_CTRL_TYPE_GET_SRC)
#define MFC_CTRL_TYPE_DST (MFC_CTRL_TYPE_GET_DST)
#include "s5p_mfc_hwlock.h"
#include "s5p_mfc_nal_q.h"
-#include "s5p_mfc_watchdog.h"
#include "s5p_mfc_sync.h"
#include "s5p_mfc_pm.h"
if (s5p_mfc_wait_for_done_dev(dev, S5P_FIMV_R2H_CMD_SLEEP_RET)) {
mfc_err_dev("Failed to SLEEP\n");
dev->logging_data->cause |= (1 << MFC_CAUSE_FAIL_SLEEP);
- s5p_mfc_dump_info_and_stop_hw(dev);
+ call_dop(dev, dump_and_stop_always, dev);
return -EIO;
}
if (s5p_mfc_wait_for_done_dev(dev, S5P_FIMV_R2H_CMD_FW_STATUS_RET)) {
mfc_err_dev("Failed to RISC_ON\n");
dev->logging_data->cause |= (1 << MFC_CAUSE_FAIL_RISC_ON);
- s5p_mfc_dump_info_and_stop_hw(dev);
+ call_dop(dev, dump_and_stop_always, dev);
return -EIO;
}
if (s5p_mfc_wait_for_done_dev(dev, S5P_FIMV_R2H_CMD_WAKEUP_RET)) {
mfc_err_dev("Failed to WAKEUP\n");
dev->logging_data->cause |= (1 << MFC_CAUSE_FAIL_WAKEUP);
- s5p_mfc_dump_info_and_stop_hw(dev);
+ call_dop(dev, dump_and_stop_always, dev);
return -EIO;
}
int drv_margin;
};
+extern struct s5p_mfc_dump_ops mfc_dump_ops;
+struct s5p_mfc_dump_ops {
+ void (*dump_and_stop_always)(struct s5p_mfc_dev *dev);
+};
+
/**
* struct s5p_mfc_dev - The struct containing driver internal parameters.
*/
#endif
struct s5p_mfc_debugfs debugfs;
+ struct s5p_mfc_dump_ops *dump_ops;
struct s5p_mfc_perf perf;
};
#include "s5p_mfc_hwlock.h"
#include "s5p_mfc_nal_q.h"
-#include "s5p_mfc_watchdog.h"
#include "s5p_mfc_opr.h"
#include "s5p_mfc_sync.h"
-#include "s5p_mfc_pm.h"
-
#include "s5p_mfc_queue.h"
#include "s5p_mfc_utils.h"
#include "s5p_mfc_buf.h"
if (s5p_mfc_wait_for_done_ctx(ctx, S5P_FIMV_R2H_CMD_DPB_FLUSH_RET)) {
mfc_err_ctx("time out during DPB flush\n");
dev->logging_data->cause |= (1 << MFC_CAUSE_FAIL_DPB_FLUSH);
- s5p_mfc_dump_info_and_stop_hw(dev);
+ call_dop(dev, dump_and_stop_always, dev);
}
s5p_mfc_change_state(ctx, prev_state);
#include "s5p_mfc_opr.h"
#include "s5p_mfc_sync.h"
-#include "s5p_mfc_pm.h"
-
#include "s5p_mfc_qos.h"
#include "s5p_mfc_queue.h"
#include "s5p_mfc_utils.h"
#include "s5p_mfc_nal_q.h"
#include "s5p_mfc_otf.h"
-#include "s5p_mfc_watchdog.h"
#include "s5p_mfc_opr.h"
#include "s5p_mfc_sync.h"
if (s5p_mfc_wait_for_done_dev(dev, S5P_FIMV_R2H_CMD_CACHE_FLUSH_RET)) {
mfc_err_dev("Failed to CACHE_FLUSH\n");
dev->logging_data->cause |= (1 << MFC_CAUSE_FAIL_CHACHE_FLUSH);
- s5p_mfc_dump_info_and_stop_hw(dev);
+ call_dop(dev, dump_and_stop_always, dev);
}
s5p_mfc_pm_clock_off(dev);
S5P_FIMV_R2H_CMD_COMPLETE_QUEUE_RET)) {
mfc_err_dev("NAL Q: Failed to stop queue.\n");
dev->logging_data->cause |= (1 << MFC_CAUSE_FAIL_STOP_NAL_Q);
- s5p_mfc_dump_info_and_stop_hw(dev);
+ call_dop(dev, dump_and_stop_always, dev);
}
nal_q_handle->nal_q_exception = 0;
ret = 1;
#include "s5p_mfc_hwlock.h"
#include "s5p_mfc_nal_q.h"
#include "s5p_mfc_otf.h"
-#include "s5p_mfc_watchdog.h"
#include "s5p_mfc_opr.h"
#include "s5p_mfc_sync.h"
#include "s5p_mfc_nal_q.h"
-#include "s5p_mfc_watchdog.h"
#include "s5p_mfc_sync.h"
#include "s5p_mfc_pm.h"
S5P_FIMV_R2H_CMD_COMPLETE_QUEUE_RET)) {
mfc_err_dev("NAL Q: Failed to stop qeueue during get hwlock\n");
dev->logging_data->cause |= (1 << MFC_CAUSE_FAIL_STOP_NAL_Q_FOR_OTHER);
- s5p_mfc_dump_info_and_stop_hw(dev);
+ call_dop(dev, dump_and_stop_always, dev);
}
mfc_debug_leave();
#include "s5p_mfc_otf.h"
#include "s5p_mfc_hwfc_internal.h"
-#include "s5p_mfc_watchdog.h"
#include "s5p_mfc_sync.h"
#include "s5p_mfc_inst.h"
#include "s5p_mfc_reg.h"
-#include "s5p_mfc_mem.h"
-
void s5p_mfc_dbg_enable(struct s5p_mfc_dev *dev)
{
mfc_debug(2, "MFC debug info enable\n");
#include "s5p_mfc_utils.h"
-#include "s5p_mfc_mem.h"
-
int s5p_mfc_check_vb_with_fmt(struct s5p_mfc_fmt *fmt, struct vb2_buffer *vb)
{
if (!fmt)
}
}
-void s5p_mfc_dump_info_and_stop_hw(struct s5p_mfc_dev *dev)
+static void mfc_dump_info_and_stop_hw(struct s5p_mfc_dev *dev)
{
MFC_TRACE_DEV("** mfc will stop!!!\n");
mfc_display_state(dev);
atomic_set(&dev->watchdog_tick_cnt, 0);
/* Stop after dumping information */
- s5p_mfc_dump_info_and_stop_hw(dev);
+ mfc_dump_info_and_stop_hw(dev);
}
+
+struct s5p_mfc_dump_ops mfc_dump_ops = {
+ .dump_and_stop_always = mfc_dump_info_and_stop_hw,
+};
#include "s5p_mfc_common.h"
void s5p_mfc_dump_buffer_info(struct s5p_mfc_dev *dev, unsigned long addr);
-void s5p_mfc_dump_info_and_stop_hw(struct s5p_mfc_dev *dev);
void s5p_mfc_watchdog_worker(struct work_struct *work);
#endif /* __S5P_MFC_WATCHDOG_H */