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

Commit 46c4dbc8 authored by Katish Paran's avatar Katish Paran Committed by Gerrit - the friendly Code Review server
Browse files

diag: Remove spinlock protection while releasing wake source



Currently, apps diag is holding a spinlock while releasing
wake source. This may lead to spinlock contention in case
multiple zero size packets are received over smd thus leading
to lockout. This patch removes the spinlock protection while
releasing wake source.

Change-Id: I73f2b6f584bfbc259cd534c59aedbacd4cc59381
Signed-off-by: default avatarKatish Paran <kparan@codeaurora.org>
parent d3846f3c
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -541,7 +541,6 @@ struct diagchar_dev {
	/* Power related variables */
	struct diag_ws_ref_t dci_ws;
	struct diag_ws_ref_t md_ws;
	spinlock_t ws_lock;
	/* Pointers to Diag Masks */
	struct diag_mask_info *msg_mask;
	struct diag_mask_info *log_mask;
+0 −6
Original line number Diff line number Diff line
@@ -2523,8 +2523,6 @@ void diag_ws_init()
	driver->md_ws.ref_count = 0;
	driver->md_ws.copy_count = 0;
	spin_lock_init(&driver->md_ws.lock);

	spin_lock_init(&driver->ws_lock);
}

static void diag_stats_init(void)
@@ -2687,12 +2685,8 @@ void diag_ws_reset(int type)

void diag_ws_release()
{
	unsigned long flags;

	spin_lock_irqsave(&driver->ws_lock, flags);
	if (driver->dci_ws.ref_count == 0 && driver->md_ws.ref_count == 0)
		pm_relax(driver->diag_dev);
	spin_unlock_irqrestore(&driver->ws_lock, flags);
}

#ifdef DIAG_DEBUG