Loading arch/arm/mach-msm/smp2p_spinlock_test.c +11 −2 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ struct rpm_spinlock_test { uint32_t rpm_lock_count; }; static uint32_t ut_remote_spinlock_run_time = 1; /** * smp2p_ut_remote_spinlock_core - Verify remote spinlock. * Loading @@ -64,12 +66,12 @@ static void smp2p_ut_remote_spinlock_core(struct seq_file *s, int remote_pid, struct mock_cb_data cb_in; unsigned long flags; unsigned n; unsigned test_num; bool have_lock; bool timeout; int failed_tmp; int spinlock_owner; remote_spinlock_t *smem_spinlock; unsigned long end; seq_printf(s, "Running %s for '%s' remote pid %d\n", __func__, smp2p_pid_to_name(remote_pid), remote_pid); Loading Loading @@ -149,7 +151,12 @@ static void smp2p_ut_remote_spinlock_core(struct seq_file *s, int remote_pid, spinlock_owner = 0; test_request = 0x0; SMP2P_SET_RMT_CMD_TYPE_REQ(test_request); for (test_num = 0; !failed && test_num < 10000; ++test_num) { end = jiffies + (ut_remote_spinlock_run_time * HZ); if (ut_remote_spinlock_run_time < 300) seq_printf(s, "\tRunning test for %u seconds; on physical hardware please run >= 300 seconds by doing 'echo 300 > ut_remote_spinlock_time'\n", ut_remote_spinlock_run_time); while (time_is_after_jiffies(end)) { /* try to acquire spinlock */ if (use_trylock) { unsigned long j_start = jiffies; Loading Loading @@ -482,6 +489,8 @@ static int __init smp2p_debugfs_init(void) smp2p_ut_remote_spinlock_wcnss); smp2p_debug_create("ut_remote_spinlock_rpm", smp2p_ut_remote_spinlock_rpm); smp2p_debug_create_u32("ut_remote_spinlock_time", &ut_remote_spinlock_run_time); return 0; } Loading arch/arm/mach-msm/smp2p_test.c +9 −0 Original line number Diff line number Diff line Loading @@ -1198,6 +1198,15 @@ void smp2p_debug_create(const char *name, pr_err("%s: unable to create file '%s'\n", __func__, name); } void smp2p_debug_create_u32(const char *name, uint32_t *value) { struct dentry *file; file = debugfs_create_u32(name, S_IRUGO | S_IWUSR, dent, value); if (!file) pr_err("%s: unable to create file '%s'\n", __func__, name); } static int __init smp2p_debugfs_init(void) { dent = debugfs_create_dir("smp2p_test", 0); Loading arch/arm/mach-msm/smp2p_test_common.h +1 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,7 @@ struct mock_cb_data { }; void smp2p_debug_create(const char *name, void (*show)(struct seq_file *)); void smp2p_debug_create_u32(const char *name, uint32_t *value); static inline int smp2p_test_notify(struct notifier_block *self, unsigned long event, void *data); Loading Loading
arch/arm/mach-msm/smp2p_spinlock_test.c +11 −2 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ struct rpm_spinlock_test { uint32_t rpm_lock_count; }; static uint32_t ut_remote_spinlock_run_time = 1; /** * smp2p_ut_remote_spinlock_core - Verify remote spinlock. * Loading @@ -64,12 +66,12 @@ static void smp2p_ut_remote_spinlock_core(struct seq_file *s, int remote_pid, struct mock_cb_data cb_in; unsigned long flags; unsigned n; unsigned test_num; bool have_lock; bool timeout; int failed_tmp; int spinlock_owner; remote_spinlock_t *smem_spinlock; unsigned long end; seq_printf(s, "Running %s for '%s' remote pid %d\n", __func__, smp2p_pid_to_name(remote_pid), remote_pid); Loading Loading @@ -149,7 +151,12 @@ static void smp2p_ut_remote_spinlock_core(struct seq_file *s, int remote_pid, spinlock_owner = 0; test_request = 0x0; SMP2P_SET_RMT_CMD_TYPE_REQ(test_request); for (test_num = 0; !failed && test_num < 10000; ++test_num) { end = jiffies + (ut_remote_spinlock_run_time * HZ); if (ut_remote_spinlock_run_time < 300) seq_printf(s, "\tRunning test for %u seconds; on physical hardware please run >= 300 seconds by doing 'echo 300 > ut_remote_spinlock_time'\n", ut_remote_spinlock_run_time); while (time_is_after_jiffies(end)) { /* try to acquire spinlock */ if (use_trylock) { unsigned long j_start = jiffies; Loading Loading @@ -482,6 +489,8 @@ static int __init smp2p_debugfs_init(void) smp2p_ut_remote_spinlock_wcnss); smp2p_debug_create("ut_remote_spinlock_rpm", smp2p_ut_remote_spinlock_rpm); smp2p_debug_create_u32("ut_remote_spinlock_time", &ut_remote_spinlock_run_time); return 0; } Loading
arch/arm/mach-msm/smp2p_test.c +9 −0 Original line number Diff line number Diff line Loading @@ -1198,6 +1198,15 @@ void smp2p_debug_create(const char *name, pr_err("%s: unable to create file '%s'\n", __func__, name); } void smp2p_debug_create_u32(const char *name, uint32_t *value) { struct dentry *file; file = debugfs_create_u32(name, S_IRUGO | S_IWUSR, dent, value); if (!file) pr_err("%s: unable to create file '%s'\n", __func__, name); } static int __init smp2p_debugfs_init(void) { dent = debugfs_create_dir("smp2p_test", 0); Loading
arch/arm/mach-msm/smp2p_test_common.h +1 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,7 @@ struct mock_cb_data { }; void smp2p_debug_create(const char *name, void (*show)(struct seq_file *)); void smp2p_debug_create_u32(const char *name, uint32_t *value); static inline int smp2p_test_notify(struct notifier_block *self, unsigned long event, void *data); Loading