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

Commit 58ddf789 authored by Bhalchandra Gajare's avatar Bhalchandra Gajare Committed by Gerrit - the friendly Code Review server
Browse files

mfd: wcd9xxx-slimslave: Return error to caller if buffer timeout happens



For the apps-owned data port (master port), in order to receive the data
on the channel, buffers are queued to slimbus/BAM pipe. Under unexpected
error scenarios, like SSR for example, the buffer is never returned,
which causes timeout on the wait for buffer completion. Fix to add error
return under such case so that the caller can take necessary action and
not queue any more buffers as the underlying driver/hardware is in
erroneous state.

CRs-fixed: 667678
Change-Id: Ia69b05be67660c93ae41b12cec632ad38d171655
Signed-off-by: default avatarBhalchandra Gajare <gajare@codeaurora.org>
parent dbd2b72e
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -765,6 +765,18 @@ int wcd9xxx_slim_ch_master_status(struct wcd9xxx *wcd9xxx, void *handle,
		pr_err("%s: Get Xfer status rc %x, len %x\n",
		       __func__, rc, *(len));
	}

	if (!rc && *len == 0) {
		/*
		 * If timeout occurred and the length of
		 * buffer returned is 0, then there is a
		 * error on the bus, return error to caller
		 * to avoid queuing more buffers.
		 */
		pr_err("%s: no buffer returned after timeout\n",
			__func__);
		rc = -EIO;
	}
	mutex_unlock(&tx_master->lock);
return rc;
}