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

Commit 8cdc99ce authored by Lior Barenboim's avatar Lior Barenboim
Browse files

QBT1000: avoid wait in suspend callback



Use mutex_trylock in qbt1000_suspend to avoid entering
wait if called during a long TZ call.

Signed-off-by: default avatarLior Barenboim <liorb@codeaurora.org>
Change-Id: I33d599836164b565719d84567c3ffdfebfb8efcc
parent 72ee5cb1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1268,7 +1268,8 @@ static int qbt1000_suspend(struct platform_device *pdev, pm_message_t state)
	 * while making a TZ call. Hence the clock check to determine if the
	 * driver will allow suspend to occur.
	 */
	mutex_lock(&drvdata->mutex);
	if (!mutex_trylock(&drvdata->mutex))
		return -EBUSY;
	if (((drvdata->sensor_conn_type == SPI) && (drvdata->clock_state)) ||
	    ((drvdata->sensor_conn_type == SSC_SPI) && (drvdata->ssc_state)))
		rc = -EBUSY;