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

Commit 35afa3f3 authored by Vipin Deep Kaur's avatar Vipin Deep Kaur
Browse files

i2c: i2c-qcom-geni: Wait for abort command completion



After giving an abort command, wait for interrupt to
mark the command completion else log it as a failure scenario.

Change-Id: I59aa84a579a839966e3e4b3c7364ae7a8b39e7bb
Signed-off-by: default avatarVipin Deep Kaur <vkaur@codeaurora.org>
parent 13cde485
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -870,8 +870,14 @@ static int geni_i2c_xfer(struct i2c_adapter *adap,
			timeout = wait_for_completion_timeout(&gi2c->xfer, HZ);
			if (!timeout) {
				GENI_SE_ERR(gi2c->ipcl, true, gi2c->dev,
					"Abort\n");
					"Cancel failed\n");
				reinit_completion(&gi2c->xfer);
				geni_abort_m_cmd(gi2c->base);
				timeout =
				wait_for_completion_timeout(&gi2c->xfer, HZ);
				if (!timeout)
					GENI_SE_ERR(gi2c->ipcl, true, gi2c->dev,
						"Abort failed\n");
			}
		}
		gi2c->cur_wr = 0;