[RFC PATCH 5/6] hwmon: axi-fan-control: clear the fan fault irq at startup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The core might pull itself out of reset automatically which means it can
run with invalid tacho evaluation parameters for some time. Thus, it will
trigger a FAN FAULT interrupt as soon as we unmask it. Some userland apps
might be sensitive to this and act drastically. Hence, we will clear it
here and if there's something really wrong with the FAN or the evaluation
parameters, we'll get that interrupt again...

Signed-off-by: Nuno Sá <nuno.sa@xxxxxxxxxx>
---
 drivers/hwmon/axi-fan-control.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/hwmon/axi-fan-control.c b/drivers/hwmon/axi-fan-control.c
index d4b62d54375b..59c9babb3850 100644
--- a/drivers/hwmon/axi-fan-control.c
+++ b/drivers/hwmon/axi-fan-control.c
@@ -379,6 +379,15 @@ static int axi_fan_control_init(struct axi_fan_control_data *ctl,
 		      ADI_IRQ_SRC_PWM_CHANGED | ADI_IRQ_SRC_TEMP_INCREASE),
 		    ADI_REG_IRQ_MASK, ctl);
 
+	/*
+	 * The core might pull itself out of reset automatically which means it can run with
+	 * invalid tacho evaluation parameters for some time. Thus, it will trigger a FAN
+	 * FAULT interrupt as soon as we unmask it(and some userland apps might be sensitive to
+	 * this). Hence, we will clear it here and if there's something really wrong with the
+	 * FAN or the evaluation parameters, we'll get that interrupt again...
+	 */
+	axi_iowrite(ADI_IRQ_SRC_TACH_ERR, ADI_REG_IRQ_PENDING, ctl);
+
 	/* bring the device out of reset */
 	axi_iowrite(0x01, ADI_REG_RSTN, ctl);
 
-- 
2.32.0




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux