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

Commit 1550bdd0 authored by Manoj Prabhu B's avatar Manoj Prabhu B
Browse files

diag: Update the read buffers status properly



The patch checks for the logging mode status
to mark the buffer status properly.

CRs-Fixed: 2033760
Change-Id: I29a13e2fecaecacc1a0f46358ae7d4db1d2b3786
Signed-off-by: default avatarManoj Prabhu B <bmanoj@codeaurora.org>
parent f5075bad
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -1137,10 +1137,20 @@ static void __diag_fwd_open(struct diagfwd_info *fwd_info)
	if (!fwd_info->inited)
		return;

	/*
	 * Logging mode here is reflecting previous mode
	 * status and will be updated to new mode later.
	 *
	 * Keeping the buffers busy for Memory Device Mode.
	 */

	if ((driver->logging_mode != DIAG_USB_MODE) ||
		driver->usb_connected) {
		if (fwd_info->buf_1)
			atomic_set(&fwd_info->buf_1->in_busy, 0);
		if (fwd_info->buf_2)
			atomic_set(&fwd_info->buf_2->in_busy, 0);
	}

	if (fwd_info->p_ops && fwd_info->p_ops->open)
		fwd_info->p_ops->open(fwd_info->ctxt);