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

Commit a9c07675 authored by Ajay Agarwal's avatar Ajay Agarwal
Browse files

diag: Fail read_work if HSIC channel is suspended



read_work work function continuously keeps queueing IN URBs to
the USB. In suspend scenario, this can lead to transfer ring
getting exhausted and expansion of ring failing. After this
when the target resumes, meaningful read URB submission fails
leading to diag port loss.
Fix this by not invoking diag_bridge_read if HSIC channel is
suspended.

Change-Id: Ic9b76095a00ae7cebe26cded3d95d4c4cb4fb42c
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 39641649
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012-2014, 2016-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2014, 2016-2020, 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
@@ -297,7 +297,7 @@ static void hsic_read_work_fn(struct work_struct *work)
	unsigned char *buf = NULL;
	struct diag_hsic_info *ch = container_of(work, struct diag_hsic_info,
						 read_work);
	if (!ch || !ch->enabled || !ch->opened)
	if (!ch || !ch->enabled || !ch->opened || ch->suspended)
		return;

	do {