Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ee3d4ce authored by Arun Kumar Neelakantam's avatar Arun Kumar Neelakantam Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: smp2p: Fix simultaneous access of global loopback data



Running SMP2P tests from multiple threads causes simultaneous access to
the global loopback data and resulting into unexpected behavior.

Protect the global loopback data by synchronizing the SMP2P tests.

CRs-Fixed: 2041374
Change-Id: Ifb0e7ce5198af27602881a9132afb353f1a4fc2f
Signed-off-by: default avatarArun Kumar Neelakantam <aneela@codeaurora.org>
parent 9ca28587
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
/* drivers/soc/qcom/smp2p_test.c
 *
 * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2015, 2017 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
@@ -16,6 +16,7 @@
#include <linux/jiffies.h>
#include <linux/delay.h>
#include <linux/completion.h>
#include <linux/mutex.h>
#include <soc/qcom/subsystem_restart.h>
#include "smp2p_private.h"
#include "smp2p_test_common.h"
@@ -1238,12 +1239,15 @@ static void smp2p_ut_remote_ssr_ack(struct seq_file *s)
}

static struct dentry *dent;
static DEFINE_MUTEX(show_lock);

static int debugfs_show(struct seq_file *s, void *data)
{
	void (*show)(struct seq_file *) = s->private;

	mutex_lock(&show_lock);
	show(s);
	mutex_unlock(&show_lock);

	return 0;
}