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

Commit 2788a8c1 authored by Ram Chandrasekar's avatar Ram Chandrasekar
Browse files

thermal: tsens: Mask tsens interrupt in IRQ handler



During suspend entry or exit, when an interrupt occurs, thermal framework
will ignore the interrupt notification sent from the sensor drivers. It
wont compute a new threshold and send it back. Not disabling the
interrupt in the IRQ handler in this case will lead to interrupt storm.

Mask the particular sensor in IRQ handler and rely on thermal
framework set_trips callback to mask or unmask the sensor interrupt
based on the threshold.

Change-Id: I96ed9f0a8f755dbe751bbb28ff0e0ad7b8772f6e
Signed-off-by: default avatarRam Chandrasekar <rkumbako@codeaurora.org>
parent 4c314540
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -227,8 +227,8 @@ static int tsens2xxx_set_trip_temp(struct tsens_sensor *tm_sensor,
	if (!tmdev)
		return -EINVAL;

	pr_debug("%s:low_temp(mdegC):%d, high_temp(mdegC):%d\n", __func__,
							low_temp, high_temp);
	pr_debug("%s: sensor:%d low_temp(mdegC):%d, high_temp(mdegC):%d\n",
			__func__, tm_sensor->hw_id, low_temp, high_temp);

	spin_lock_irqsave(&tmdev->tsens_upp_low_lock, flags);

@@ -437,6 +437,10 @@ static irqreturn_t tsens_tm_irq_thread(int irq, void *data)
			int_mask = readl_relaxed(sensor_int_mask_addr);
			int_mask_val = TSENS_TM_UPPER_INT_SET(
					tm->sensor[i].hw_id);
			/* Mask the corresponding interrupt for the sensors */
			writel_relaxed(int_mask | int_mask_val,
					TSENS_TM_UPPER_LOWER_INT_MASK(
						tm->tsens_tm_addr));
			/* Clear the corresponding sensors interrupt */
			writel_relaxed(int_mask_val,
				TSENS_TM_UPPER_LOWER_INT_CLEAR(
@@ -465,6 +469,10 @@ static irqreturn_t tsens_tm_irq_thread(int irq, void *data)
				(1 << tm->sensor[i].hw_id))) {
			int_mask = readl_relaxed(sensor_int_mask_addr);
			int_mask_val = (1 << tm->sensor[i].hw_id);
			/* Mask the corresponding interrupt for the sensors */
			writel_relaxed(int_mask | int_mask_val,
					TSENS_TM_UPPER_LOWER_INT_MASK(
						tm->tsens_tm_addr));
			/* Clear the corresponding sensors interrupt */
			writel_relaxed(int_mask_val,
				TSENS_TM_UPPER_LOWER_INT_CLEAR(