[PATCH] hwmon: (gpio-fan) return IRQ_HANDLED from the shared alarm IRQ handler

Cong Nguyen posted 1 patch 3 weeks, 3 days ago
There is a newer version of this series
drivers/hwmon/gpio-fan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] hwmon: (gpio-fan) return IRQ_HANDLED from the shared alarm IRQ handler
Posted by Cong Nguyen 3 weeks, 3 days ago
fan_alarm_irq_handler() is IRQF_SHARED but unconditionally returns
IRQ_NONE, even though it always schedules work in response. Enough
"unhandled" reports on a shared line trips the kernel's spurious-
interrupt detection and disables it, taking every device sharing it
down too.

Return IRQ_HANDLED, matching what the handler actually does.

Fixes: d6fe1360f42e ("hwmon: add generic GPIO fan driver")
Reported-by: Sashiko AI review <sashiko-bot@kernel.org>
Link: https://lore.kernel.org/r/20260830152150.27F5F1F000E9@smtp.kernel.org
Assisted-by: Claude:claude-opus-4
Signed-off-by: Cong Nguyen <congnt264@gmail.com>
---
 drivers/hwmon/gpio-fan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
index 084828e1e281..a55a7ea07fc0 100644
--- a/drivers/hwmon/gpio-fan.c
+++ b/drivers/hwmon/gpio-fan.c
@@ -67,7 +67,7 @@ static irqreturn_t fan_alarm_irq_handler(int irq, void *dev_id)
 
 	schedule_work(&fan_data->alarm_work);
 
-	return IRQ_NONE;
+	return IRQ_HANDLED;
 }
 
 static ssize_t fan1_alarm_show(struct device *dev,
-- 
2.25.1
Re: [PATCH] hwmon: (gpio-fan) return IRQ_HANDLED from the shared alarm IRQ handler
Posted by Guenter Roeck 3 weeks, 3 days ago
On 9/1/26 08:56, Cong Nguyen wrote:
> fan_alarm_irq_handler() is IRQF_SHARED but unconditionally returns
> IRQ_NONE, even though it always schedules work in response. Enough
> "unhandled" reports on a shared line trips the kernel's spurious-
> interrupt detection and disables it, taking every device sharing it
> down too.
> 
> Return IRQ_HANDLED, matching what the handler actually does.
> 
> Fixes: d6fe1360f42e ("hwmon: add generic GPIO fan driver")
> Reported-by: Sashiko AI review <sashiko-bot@kernel.org>
> Link: https://lore.kernel.org/r/20260830152150.27F5F1F000E9@smtp.kernel.org
> Assisted-by: Claude:claude-opus-4
> Signed-off-by: Cong Nguyen <congnt264@gmail.com>
> ---
>   drivers/hwmon/gpio-fan.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
> index 084828e1e281..a55a7ea07fc0 100644
> --- a/drivers/hwmon/gpio-fan.c
> +++ b/drivers/hwmon/gpio-fan.c
> @@ -67,7 +67,7 @@ static irqreturn_t fan_alarm_irq_handler(int irq, void *dev_id)
>   
>   	schedule_work(&fan_data->alarm_work);
>   
> -	return IRQ_NONE;
> +	return IRQ_HANDLED;
>   }
>   

That makes me wonder if IRQF_SHARED is appropriate for this driver's
interrupt handler. I think that should be dropped as well.

Thanks,
Guenter

>   static ssize_t fan1_alarm_show(struct device *dev,