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

Commit fdc9e0ee authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "regulator: qpnp-lcdb: fix race between SC interrupt and lcdb enable"

parents 566edd21 a89bff05
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1010,7 +1010,9 @@ static irqreturn_t qpnp_lcdb_sc_irq_handler(int irq, void *data)
	int rc;
	u8 val, val2[2] = {0};

	mutex_lock(&lcdb->lcdb_mutex);
	rc = qpnp_lcdb_read(lcdb, lcdb->base + INT_RT_STATUS_REG, &val, 1);
	mutex_unlock(&lcdb->lcdb_mutex);
	if (rc < 0)
		goto irq_handled;

@@ -1050,8 +1052,15 @@ static irqreturn_t qpnp_lcdb_sc_irq_handler(int irq, void *data)
			/* blanking time */
			usleep_range(2000, 2100);
			/* Read the SC status again to confirm true SC */
			mutex_lock(&lcdb->lcdb_mutex);
			/*
			 * Wait for the completion of LCDB module enable,
			 * which could be initiated in a previous SC event,
			 * to avoid multiple module disable/enable calls.
			 */
			rc = qpnp_lcdb_read(lcdb,
				lcdb->base + INT_RT_STATUS_REG, &val, 1);
			mutex_unlock(&lcdb->lcdb_mutex);
			if (rc < 0)
				goto irq_handled;