Loading arch/arm/mach-msm/smp2p_debug.c +4 −5 Original line number Diff line number Diff line /* arch/arm/mach-msm/smp2p_debug.c * * Copyright (c) 2013, The Linux Foundation. All rights reserved. * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -32,16 +32,15 @@ static void smp2p_int_stats(struct seq_file *s) if (!int_cfg) return; seq_printf(s, "| Processor | Incoming Id | Incoming # |"); seq_printf(s, " Outgoing # | Base Ptr | Mask |\n"); seq_puts(s, "| Processor | Incoming Id | Incoming # |"); seq_puts(s, " Outgoing # | Base Ptr | Mask |\n"); for (pid = 0; pid < SMP2P_NUM_PROCS; ++pid) { if (!int_cfg[pid].is_configured && pid != SMP2P_REMOTE_MOCK_PROC) continue; seq_printf(s, "| %5s (%d) | %11u | %10u | %10u | %p | %08x |\n", seq_printf(s, "| %5s (%d) | %11u | %10u | %10u | %p | %08x |\n", int_cfg[pid].name, pid, int_cfg[pid].in_int_id, int_cfg[pid].in_interrupt_count, Loading arch/arm/mach-msm/smp2p_gpio_test.c +14 −14 Original line number Diff line number Diff line /* arch/arm/mach-msm/smp2p_gpio_test.c * * Copyright (c) 2013, The Linux Foundation. All rights reserved. * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -204,12 +204,12 @@ static void smp2p_ut_local_gpio_out(struct seq_file *s) if (failed) break; seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); } smp2p_gpio_open_test_entry("smp2p", Loading Loading @@ -389,12 +389,12 @@ static void smp2p_ut_local_gpio_in(struct seq_file *s) if (failed) break; seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); } /* unregister for interrupts */ Loading Loading @@ -478,18 +478,18 @@ static void smp2p_ut_local_gpio_in_update_open(struct seq_file *s) if (0x1 & (0xDEADDEAD >> id)) { /* rising edge should have been triggered */ if (!test_bit(id, cb_info->triggered_irqs)) { seq_printf(s, "%s:%d bit %d clear, expected set\n", seq_printf(s, "%s:%d bit %d clear, ", __func__, __LINE__, id); seq_puts(s, "expected set\n"); failed = 1; break; } } else { /* edge should not have been triggered */ if (test_bit(id, cb_info->triggered_irqs)) { seq_printf(s, "%s:%d bit %d set, expected clear\n", seq_printf(s, "%s:%d bit %d set, ", __func__, __LINE__, id); seq_puts(s, "expected clear\n"); failed = 1; break; } Loading @@ -498,12 +498,12 @@ static void smp2p_ut_local_gpio_in_update_open(struct seq_file *s) if (failed) break; seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); } /* unregister for interrupts */ Loading Loading @@ -664,12 +664,12 @@ static void smp2p_ut_remote_inout_core(struct seq_file *s, int remote_pid, UT_ASSERT_HEX(request, ==, response); UT_ASSERT_INT(24, ==, cb_in->cb_count); seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", name); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); } /* unregister for interrupts */ Loading Loading @@ -697,7 +697,7 @@ static void smp2p_ut_remote_inout(struct seq_file *s) int_cfg = smp2p_get_interrupt_config(); if (!int_cfg) { seq_printf(s, "Remote processor config unavailable\n"); seq_puts(s, "Remote processor config unavailable\n"); return; } Loading arch/arm/mach-msm/smp2p_spinlock_test.c +23 −22 Original line number Diff line number Diff line /* arch/arm/mach-msm/smp2p_spinlock_test.c * * Copyright (c) 2013, The Linux Foundation. All rights reserved. * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -141,9 +141,9 @@ static void smp2p_ut_remote_spinlock_core(struct seq_file *s, int remote_pid, /* Run spinlock test */ if (use_trylock) seq_printf(s, "\tUsing remote_spin_trylock\n"); seq_puts(s, "\tUsing remote_spin_trylock\n"); else seq_printf(s, "\tUsing remote_spin_lock\n"); seq_puts(s, "\tUsing remote_spin_lock\n"); flags = 0; have_lock = false; Loading @@ -152,10 +152,12 @@ static void smp2p_ut_remote_spinlock_core(struct seq_file *s, int remote_pid, test_request = 0x0; SMP2P_SET_RMT_CMD_TYPE_REQ(test_request); 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", if (ut_remote_spinlock_run_time < 300) { seq_printf(s, "\tRunning test for %u seconds; ", ut_remote_spinlock_run_time); seq_puts(s, "on physical hardware please run >= 300 seconds by doing 'echo 300 > ut_remote_spinlock_time'\n"); } while (time_is_after_jiffies(end)) { /* try to acquire spinlock */ if (use_trylock) { Loading @@ -164,7 +166,7 @@ static void smp2p_ut_remote_spinlock_core(struct seq_file *s, int remote_pid, smem_spinlock, flags)) { if (jiffies_to_msecs(jiffies - j_start) > 1000) { seq_printf(s, seq_puts(s, "\tFail: Timeout trying to get the lock\n"); timeout = true; break; Loading @@ -191,8 +193,8 @@ static void smp2p_ut_remote_spinlock_core(struct seq_file *s, int remote_pid, remote_spin_owner(smem_spinlock); if (spinlock_owner != REMOTE_SPIN_PID) { /* lock stolen by remote side */ seq_printf(s, "\tFail: Remote side (%d) stole lock (pid %d)\n", seq_puts(s, "\tFail: Remote side: "); seq_printf(s, "%d stole lock pid: %d\n", remote_pid, spinlock_owner); failed = true; break; Loading Loading @@ -246,20 +248,20 @@ static void smp2p_ut_remote_spinlock_core(struct seq_file *s, int remote_pid, failed = failed_tmp; test_response = SMP2P_GET_RMT_DATA(test_response); seq_printf(s, "\tLocked spinlock local %u times; remote %u times", seq_puts(s, "\tLocked spinlock "); seq_printf(s, "local %u times; remote %u times", lock_count, test_response & ((1 << RS_END_THIEF_PID_BIT) - 1) ); if (test_response & RS_END_THIEF_MASK) { seq_printf(s, "Remote side reporting lock stolen by pid %d.\n", seq_puts(s, "Remote side reporting lock stolen by "); seq_printf(s, "pid %d.\n", SMP2P_GET_BITS(test_response, RS_END_THIEF_MASK, RS_END_THIEF_PID_BIT)); failed = 1; } seq_printf(s, "\n"); seq_puts(s, "\n"); /* Cleanup */ ret = msm_smp2p_out_close(&handle); Loading @@ -270,7 +272,7 @@ static void smp2p_ut_remote_spinlock_core(struct seq_file *s, int remote_pid, UT_ASSERT_INT(ret, ==, 0); if (!failed && !timeout) seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { Loading @@ -286,7 +288,7 @@ static void smp2p_ut_remote_spinlock_core(struct seq_file *s, int remote_pid, SMP2P_RLPB_ENTRY_NAME, &cb_in.nb); pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); } } Loading @@ -305,7 +307,7 @@ static void smp2p_ut_remote_spinlock_pid(struct seq_file *s, int pid, int_cfg = smp2p_get_interrupt_config(); if (!int_cfg) { seq_printf(s, "Remote processor config unavailable\n"); seq_puts(s, "Remote processor config unavailable\n"); return; } Loading Loading @@ -397,7 +399,7 @@ static void smp2p_ut_remote_spinlock_rpm(struct seq_file *s) writel_relaxed(0, &data_ptr->apps_lock_count); writel_relaxed(RPM_CMD_START, &data_ptr->apps_cmd); seq_printf(s, "\tWaiting for RPM to start test\n"); seq_puts(s, "\tWaiting for RPM to start test\n"); for (n = 0; n < 1000; ++n) { if (readl_relaxed(&data_ptr->rpm_cmd) != RPM_CMD_INVALID) Loading Loading @@ -449,18 +451,17 @@ static void smp2p_ut_remote_spinlock_rpm(struct seq_file *s) /* End test */ writel_relaxed(RPM_CMD_INVALID, &data_ptr->apps_cmd); seq_printf(s, "\tLocked spinlock local %u remote %u\n", seq_printf(s, "\tLocked spinlock local %u remote %u\n", readl_relaxed(&data_ptr->apps_lock_count), readl_relaxed(&data_ptr->rpm_lock_count)); if (!failed) seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); } } Loading arch/arm/mach-msm/smp2p_test.c +19 −21 Original line number Diff line number Diff line /* arch/arm/mach-msm/smp2p_test.c * * Copyright (c) 2013, The Linux Foundation. All rights reserved. * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -106,12 +106,12 @@ static void smp2p_ut_local_basic(struct seq_file *s) UT_ASSERT_INT(ret, ==, 0); UT_ASSERT_PTR(smp2p_obj, ==, 0); seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); (void)msm_smp2p_out_close(&smp2p_obj); } } Loading Loading @@ -195,12 +195,12 @@ static void smp2p_ut_local_late_open(struct seq_file *s) UT_ASSERT_INT(ret, ==, 0); UT_ASSERT_PTR(smp2p_obj, ==, 0); seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); (void)msm_smp2p_out_close(&smp2p_obj); } } Loading Loading @@ -316,12 +316,12 @@ static void smp2p_ut_local_early_open(struct seq_file *s) UT_ASSERT_INT(ret, ==, 0); UT_ASSERT_PTR(smp2p_obj, ==, 0); seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); (void)msm_smp2p_out_close(&smp2p_obj); } } Loading Loading @@ -455,12 +455,12 @@ static void smp2p_ut_mock_loopback(struct seq_file *s) ret = msm_smp2p_deinit_rmt_lpb_proc(SMP2P_REMOTE_MOCK_PROC); UT_ASSERT_INT(ret, ==, 0); seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); msm_smp2p_deinit_rmt_lpb_proc(SMP2P_REMOTE_MOCK_PROC); } } Loading Loading @@ -613,7 +613,7 @@ static void smp2p_ut_remote_inout_core(struct seq_file *s, int remote_pid) ret = msm_smp2p_in_unregister(remote_pid, "smp2p", &cb_in.nb); UT_ASSERT_INT(ret, ==, 0); seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { Loading @@ -622,7 +622,7 @@ static void smp2p_ut_remote_inout_core(struct seq_file *s, int remote_pid) (void)msm_smp2p_in_unregister(remote_pid, "smp2p", &cb_in.nb); pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); } } Loading @@ -641,8 +641,7 @@ static void smp2p_ut_remote_inout(struct seq_file *s) int_cfg = smp2p_get_interrupt_config(); if (!int_cfg) { seq_printf(s, "Remote processor config unavailable\n"); seq_puts(s, "Remote processor config unavailable\n"); return; } Loading Loading @@ -704,12 +703,12 @@ static void smp2p_ut_remote_out_max_entries_core(struct seq_file *s, UT_ASSERT_INT(num_created, <=, SMP2P_MAX_ENTRY); UT_ASSERT_INT(num_created, >, 0); seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); } /* cleanup */ Loading @@ -732,8 +731,7 @@ static void smp2p_ut_remote_out_max_entries(struct seq_file *s) int_cfg = smp2p_get_interrupt_config(); if (!int_cfg) { seq_printf(s, "Remote processor config unavailable\n"); seq_puts(s, "Remote processor config unavailable\n"); return; } Loading Loading @@ -830,12 +828,12 @@ static void smp2p_ut_local_in_max_entries(struct seq_file *s) } UT_ASSERT_INT(j, ==, SMP2P_MAX_ENTRY); seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); for (j = 0; j < SMP2P_MAX_ENTRY; j++) ret = msm_smp2p_in_unregister(SMP2P_REMOTE_MOCK_PROC, Loading Loading @@ -937,12 +935,12 @@ static void smp2p_ut_local_in_multiple(struct seq_file *s) &(cb_in_2.nb)); UT_ASSERT_INT(ret, ==, 0); seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); ret = msm_smp2p_in_unregister(SMP2P_REMOTE_MOCK_PROC, rmp->remote_item.entries[0].name, Loading arch/arm/mach-msm/smp2p_test_common.h +6 −11 Original line number Diff line number Diff line /* arch/arm/mach-msm/smp2p_test_common.h * * Copyright (c) 2013, The Linux Foundation. All rights reserved. * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -36,8 +36,7 @@ int a_tmp = (a); \ int b_tmp = (b); \ if (!((a_tmp)cmp(b_tmp))) { \ seq_printf(s, \ "%s:%d Fail: " #a "(%d) " #cmp " " #b "(%d)\n", \ seq_printf(s, "%s:%d Fail: " #a "(%d) " #cmp " " #b "(%d)\n", \ __func__, __LINE__, \ a_tmp, b_tmp); \ failed = 1; \ Loading @@ -50,8 +49,7 @@ void *a_tmp = (a); \ void *b_tmp = (b); \ if (!((a_tmp)cmp(b_tmp))) { \ seq_printf(s, \ "%s:%d Fail: " #a "(%p) " #cmp " " #b "(%p)\n", \ seq_printf(s, "%s:%d Fail: " #a "(%p) " #cmp " " #b "(%p)\n", \ __func__, __LINE__, \ a_tmp, b_tmp); \ failed = 1; \ Loading @@ -64,8 +62,7 @@ unsigned a_tmp = (a); \ unsigned b_tmp = (b); \ if (!((a_tmp)cmp(b_tmp))) { \ seq_printf(s, \ "%s:%d Fail: " #a "(%u) " #cmp " " #b "(%u)\n", \ seq_printf(s, "%s:%d Fail: " #a "(%u) " #cmp " " #b "(%u)\n", \ __func__, __LINE__, \ a_tmp, b_tmp); \ failed = 1; \ Loading @@ -78,8 +75,7 @@ unsigned a_tmp = (a); \ unsigned b_tmp = (b); \ if (!((a_tmp)cmp(b_tmp))) { \ seq_printf(s, \ "%s:%d Fail: " #a "(%x) " #cmp " " #b "(%x)\n", \ seq_printf(s, "%s:%d Fail: " #a "(%x) " #cmp " " #b "(%x)\n", \ __func__, __LINE__, \ a_tmp, b_tmp); \ failed = 1; \ Loading Loading @@ -109,8 +105,7 @@ int minv_tmp = (minv); \ int maxv_tmp = (maxv); \ if (((a_tmp) < (minv_tmp)) || ((a_tmp) > (maxv_tmp))) { \ seq_printf(s, \ "%s:%d Fail: " #a "(%d) < " #minv "(%d) or " \ seq_printf(s, "%s:%d Fail: " #a "(%d) < " #minv "(%d) or " \ #a "(%d) > " #maxv "(%d)\n", \ __func__, __LINE__, \ a_tmp, minv_tmp, a_tmp, maxv_tmp); \ Loading Loading
arch/arm/mach-msm/smp2p_debug.c +4 −5 Original line number Diff line number Diff line /* arch/arm/mach-msm/smp2p_debug.c * * Copyright (c) 2013, The Linux Foundation. All rights reserved. * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -32,16 +32,15 @@ static void smp2p_int_stats(struct seq_file *s) if (!int_cfg) return; seq_printf(s, "| Processor | Incoming Id | Incoming # |"); seq_printf(s, " Outgoing # | Base Ptr | Mask |\n"); seq_puts(s, "| Processor | Incoming Id | Incoming # |"); seq_puts(s, " Outgoing # | Base Ptr | Mask |\n"); for (pid = 0; pid < SMP2P_NUM_PROCS; ++pid) { if (!int_cfg[pid].is_configured && pid != SMP2P_REMOTE_MOCK_PROC) continue; seq_printf(s, "| %5s (%d) | %11u | %10u | %10u | %p | %08x |\n", seq_printf(s, "| %5s (%d) | %11u | %10u | %10u | %p | %08x |\n", int_cfg[pid].name, pid, int_cfg[pid].in_int_id, int_cfg[pid].in_interrupt_count, Loading
arch/arm/mach-msm/smp2p_gpio_test.c +14 −14 Original line number Diff line number Diff line /* arch/arm/mach-msm/smp2p_gpio_test.c * * Copyright (c) 2013, The Linux Foundation. All rights reserved. * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -204,12 +204,12 @@ static void smp2p_ut_local_gpio_out(struct seq_file *s) if (failed) break; seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); } smp2p_gpio_open_test_entry("smp2p", Loading Loading @@ -389,12 +389,12 @@ static void smp2p_ut_local_gpio_in(struct seq_file *s) if (failed) break; seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); } /* unregister for interrupts */ Loading Loading @@ -478,18 +478,18 @@ static void smp2p_ut_local_gpio_in_update_open(struct seq_file *s) if (0x1 & (0xDEADDEAD >> id)) { /* rising edge should have been triggered */ if (!test_bit(id, cb_info->triggered_irqs)) { seq_printf(s, "%s:%d bit %d clear, expected set\n", seq_printf(s, "%s:%d bit %d clear, ", __func__, __LINE__, id); seq_puts(s, "expected set\n"); failed = 1; break; } } else { /* edge should not have been triggered */ if (test_bit(id, cb_info->triggered_irqs)) { seq_printf(s, "%s:%d bit %d set, expected clear\n", seq_printf(s, "%s:%d bit %d set, ", __func__, __LINE__, id); seq_puts(s, "expected clear\n"); failed = 1; break; } Loading @@ -498,12 +498,12 @@ static void smp2p_ut_local_gpio_in_update_open(struct seq_file *s) if (failed) break; seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); } /* unregister for interrupts */ Loading Loading @@ -664,12 +664,12 @@ static void smp2p_ut_remote_inout_core(struct seq_file *s, int remote_pid, UT_ASSERT_HEX(request, ==, response); UT_ASSERT_INT(24, ==, cb_in->cb_count); seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", name); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); } /* unregister for interrupts */ Loading Loading @@ -697,7 +697,7 @@ static void smp2p_ut_remote_inout(struct seq_file *s) int_cfg = smp2p_get_interrupt_config(); if (!int_cfg) { seq_printf(s, "Remote processor config unavailable\n"); seq_puts(s, "Remote processor config unavailable\n"); return; } Loading
arch/arm/mach-msm/smp2p_spinlock_test.c +23 −22 Original line number Diff line number Diff line /* arch/arm/mach-msm/smp2p_spinlock_test.c * * Copyright (c) 2013, The Linux Foundation. All rights reserved. * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -141,9 +141,9 @@ static void smp2p_ut_remote_spinlock_core(struct seq_file *s, int remote_pid, /* Run spinlock test */ if (use_trylock) seq_printf(s, "\tUsing remote_spin_trylock\n"); seq_puts(s, "\tUsing remote_spin_trylock\n"); else seq_printf(s, "\tUsing remote_spin_lock\n"); seq_puts(s, "\tUsing remote_spin_lock\n"); flags = 0; have_lock = false; Loading @@ -152,10 +152,12 @@ static void smp2p_ut_remote_spinlock_core(struct seq_file *s, int remote_pid, test_request = 0x0; SMP2P_SET_RMT_CMD_TYPE_REQ(test_request); 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", if (ut_remote_spinlock_run_time < 300) { seq_printf(s, "\tRunning test for %u seconds; ", ut_remote_spinlock_run_time); seq_puts(s, "on physical hardware please run >= 300 seconds by doing 'echo 300 > ut_remote_spinlock_time'\n"); } while (time_is_after_jiffies(end)) { /* try to acquire spinlock */ if (use_trylock) { Loading @@ -164,7 +166,7 @@ static void smp2p_ut_remote_spinlock_core(struct seq_file *s, int remote_pid, smem_spinlock, flags)) { if (jiffies_to_msecs(jiffies - j_start) > 1000) { seq_printf(s, seq_puts(s, "\tFail: Timeout trying to get the lock\n"); timeout = true; break; Loading @@ -191,8 +193,8 @@ static void smp2p_ut_remote_spinlock_core(struct seq_file *s, int remote_pid, remote_spin_owner(smem_spinlock); if (spinlock_owner != REMOTE_SPIN_PID) { /* lock stolen by remote side */ seq_printf(s, "\tFail: Remote side (%d) stole lock (pid %d)\n", seq_puts(s, "\tFail: Remote side: "); seq_printf(s, "%d stole lock pid: %d\n", remote_pid, spinlock_owner); failed = true; break; Loading Loading @@ -246,20 +248,20 @@ static void smp2p_ut_remote_spinlock_core(struct seq_file *s, int remote_pid, failed = failed_tmp; test_response = SMP2P_GET_RMT_DATA(test_response); seq_printf(s, "\tLocked spinlock local %u times; remote %u times", seq_puts(s, "\tLocked spinlock "); seq_printf(s, "local %u times; remote %u times", lock_count, test_response & ((1 << RS_END_THIEF_PID_BIT) - 1) ); if (test_response & RS_END_THIEF_MASK) { seq_printf(s, "Remote side reporting lock stolen by pid %d.\n", seq_puts(s, "Remote side reporting lock stolen by "); seq_printf(s, "pid %d.\n", SMP2P_GET_BITS(test_response, RS_END_THIEF_MASK, RS_END_THIEF_PID_BIT)); failed = 1; } seq_printf(s, "\n"); seq_puts(s, "\n"); /* Cleanup */ ret = msm_smp2p_out_close(&handle); Loading @@ -270,7 +272,7 @@ static void smp2p_ut_remote_spinlock_core(struct seq_file *s, int remote_pid, UT_ASSERT_INT(ret, ==, 0); if (!failed && !timeout) seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { Loading @@ -286,7 +288,7 @@ static void smp2p_ut_remote_spinlock_core(struct seq_file *s, int remote_pid, SMP2P_RLPB_ENTRY_NAME, &cb_in.nb); pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); } } Loading @@ -305,7 +307,7 @@ static void smp2p_ut_remote_spinlock_pid(struct seq_file *s, int pid, int_cfg = smp2p_get_interrupt_config(); if (!int_cfg) { seq_printf(s, "Remote processor config unavailable\n"); seq_puts(s, "Remote processor config unavailable\n"); return; } Loading Loading @@ -397,7 +399,7 @@ static void smp2p_ut_remote_spinlock_rpm(struct seq_file *s) writel_relaxed(0, &data_ptr->apps_lock_count); writel_relaxed(RPM_CMD_START, &data_ptr->apps_cmd); seq_printf(s, "\tWaiting for RPM to start test\n"); seq_puts(s, "\tWaiting for RPM to start test\n"); for (n = 0; n < 1000; ++n) { if (readl_relaxed(&data_ptr->rpm_cmd) != RPM_CMD_INVALID) Loading Loading @@ -449,18 +451,17 @@ static void smp2p_ut_remote_spinlock_rpm(struct seq_file *s) /* End test */ writel_relaxed(RPM_CMD_INVALID, &data_ptr->apps_cmd); seq_printf(s, "\tLocked spinlock local %u remote %u\n", seq_printf(s, "\tLocked spinlock local %u remote %u\n", readl_relaxed(&data_ptr->apps_lock_count), readl_relaxed(&data_ptr->rpm_lock_count)); if (!failed) seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); } } Loading
arch/arm/mach-msm/smp2p_test.c +19 −21 Original line number Diff line number Diff line /* arch/arm/mach-msm/smp2p_test.c * * Copyright (c) 2013, The Linux Foundation. All rights reserved. * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -106,12 +106,12 @@ static void smp2p_ut_local_basic(struct seq_file *s) UT_ASSERT_INT(ret, ==, 0); UT_ASSERT_PTR(smp2p_obj, ==, 0); seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); (void)msm_smp2p_out_close(&smp2p_obj); } } Loading Loading @@ -195,12 +195,12 @@ static void smp2p_ut_local_late_open(struct seq_file *s) UT_ASSERT_INT(ret, ==, 0); UT_ASSERT_PTR(smp2p_obj, ==, 0); seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); (void)msm_smp2p_out_close(&smp2p_obj); } } Loading Loading @@ -316,12 +316,12 @@ static void smp2p_ut_local_early_open(struct seq_file *s) UT_ASSERT_INT(ret, ==, 0); UT_ASSERT_PTR(smp2p_obj, ==, 0); seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); (void)msm_smp2p_out_close(&smp2p_obj); } } Loading Loading @@ -455,12 +455,12 @@ static void smp2p_ut_mock_loopback(struct seq_file *s) ret = msm_smp2p_deinit_rmt_lpb_proc(SMP2P_REMOTE_MOCK_PROC); UT_ASSERT_INT(ret, ==, 0); seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); msm_smp2p_deinit_rmt_lpb_proc(SMP2P_REMOTE_MOCK_PROC); } } Loading Loading @@ -613,7 +613,7 @@ static void smp2p_ut_remote_inout_core(struct seq_file *s, int remote_pid) ret = msm_smp2p_in_unregister(remote_pid, "smp2p", &cb_in.nb); UT_ASSERT_INT(ret, ==, 0); seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { Loading @@ -622,7 +622,7 @@ static void smp2p_ut_remote_inout_core(struct seq_file *s, int remote_pid) (void)msm_smp2p_in_unregister(remote_pid, "smp2p", &cb_in.nb); pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); } } Loading @@ -641,8 +641,7 @@ static void smp2p_ut_remote_inout(struct seq_file *s) int_cfg = smp2p_get_interrupt_config(); if (!int_cfg) { seq_printf(s, "Remote processor config unavailable\n"); seq_puts(s, "Remote processor config unavailable\n"); return; } Loading Loading @@ -704,12 +703,12 @@ static void smp2p_ut_remote_out_max_entries_core(struct seq_file *s, UT_ASSERT_INT(num_created, <=, SMP2P_MAX_ENTRY); UT_ASSERT_INT(num_created, >, 0); seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); } /* cleanup */ Loading @@ -732,8 +731,7 @@ static void smp2p_ut_remote_out_max_entries(struct seq_file *s) int_cfg = smp2p_get_interrupt_config(); if (!int_cfg) { seq_printf(s, "Remote processor config unavailable\n"); seq_puts(s, "Remote processor config unavailable\n"); return; } Loading Loading @@ -830,12 +828,12 @@ static void smp2p_ut_local_in_max_entries(struct seq_file *s) } UT_ASSERT_INT(j, ==, SMP2P_MAX_ENTRY); seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); for (j = 0; j < SMP2P_MAX_ENTRY; j++) ret = msm_smp2p_in_unregister(SMP2P_REMOTE_MOCK_PROC, Loading Loading @@ -937,12 +935,12 @@ static void smp2p_ut_local_in_multiple(struct seq_file *s) &(cb_in_2.nb)); UT_ASSERT_INT(ret, ==, 0); seq_printf(s, "\tOK\n"); seq_puts(s, "\tOK\n"); } while (0); if (failed) { pr_err("%s: Failed\n", __func__); seq_printf(s, "\tFailed\n"); seq_puts(s, "\tFailed\n"); ret = msm_smp2p_in_unregister(SMP2P_REMOTE_MOCK_PROC, rmp->remote_item.entries[0].name, Loading
arch/arm/mach-msm/smp2p_test_common.h +6 −11 Original line number Diff line number Diff line /* arch/arm/mach-msm/smp2p_test_common.h * * Copyright (c) 2013, The Linux Foundation. All rights reserved. * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -36,8 +36,7 @@ int a_tmp = (a); \ int b_tmp = (b); \ if (!((a_tmp)cmp(b_tmp))) { \ seq_printf(s, \ "%s:%d Fail: " #a "(%d) " #cmp " " #b "(%d)\n", \ seq_printf(s, "%s:%d Fail: " #a "(%d) " #cmp " " #b "(%d)\n", \ __func__, __LINE__, \ a_tmp, b_tmp); \ failed = 1; \ Loading @@ -50,8 +49,7 @@ void *a_tmp = (a); \ void *b_tmp = (b); \ if (!((a_tmp)cmp(b_tmp))) { \ seq_printf(s, \ "%s:%d Fail: " #a "(%p) " #cmp " " #b "(%p)\n", \ seq_printf(s, "%s:%d Fail: " #a "(%p) " #cmp " " #b "(%p)\n", \ __func__, __LINE__, \ a_tmp, b_tmp); \ failed = 1; \ Loading @@ -64,8 +62,7 @@ unsigned a_tmp = (a); \ unsigned b_tmp = (b); \ if (!((a_tmp)cmp(b_tmp))) { \ seq_printf(s, \ "%s:%d Fail: " #a "(%u) " #cmp " " #b "(%u)\n", \ seq_printf(s, "%s:%d Fail: " #a "(%u) " #cmp " " #b "(%u)\n", \ __func__, __LINE__, \ a_tmp, b_tmp); \ failed = 1; \ Loading @@ -78,8 +75,7 @@ unsigned a_tmp = (a); \ unsigned b_tmp = (b); \ if (!((a_tmp)cmp(b_tmp))) { \ seq_printf(s, \ "%s:%d Fail: " #a "(%x) " #cmp " " #b "(%x)\n", \ seq_printf(s, "%s:%d Fail: " #a "(%x) " #cmp " " #b "(%x)\n", \ __func__, __LINE__, \ a_tmp, b_tmp); \ failed = 1; \ Loading Loading @@ -109,8 +105,7 @@ int minv_tmp = (minv); \ int maxv_tmp = (maxv); \ if (((a_tmp) < (minv_tmp)) || ((a_tmp) > (maxv_tmp))) { \ seq_printf(s, \ "%s:%d Fail: " #a "(%d) < " #minv "(%d) or " \ seq_printf(s, "%s:%d Fail: " #a "(%d) < " #minv "(%d) or " \ #a "(%d) > " #maxv "(%d)\n", \ __func__, __LINE__, \ a_tmp, minv_tmp, a_tmp, maxv_tmp); \ Loading