From: Guenter Roeck <linux@roeck-us.net>
To: sashiko-reviews@lists.linux.dev,
Petar Stepanovic <pstepanovic@axiado.com>
Cc: devicetree@vger.kernel.org, linux-hwmon@vger.kernel.org,
robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 2/2] hwmon: add Axiado AX3000 and AX3005 PWM fan controller driver
Date: Fri, 11 Sep 2026 07:52:56 -0700 [thread overview]
Message-ID: <518aea33-277a-4d8f-8bf7-7469879f6f56@roeck-us.net> (raw)
In-Reply-To: <20260903084844.D1CC11F000E9@smtp.kernel.org>
Petar,
On 9/3/26 01:48, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] The interrupt handler incorrectly returns IRQ_HANDLED for unhandled device interrupts, potentially causing an IRQ storm.
> --
>
> commit ac0edffb2c72d464c05c340c5df147fdcf10b0f4
> Author: Petar Stepanovic <pstepanovic@axiado.com>
>
> hwmon: add Axiado AX3000 and AX3005 PWM fan controller driver
>
> This commit adds support for the PWM fan controller found on the Axiado AX3000
> and AX3005 SoCs. It measures fan speed via a hardware tachometer interrupt and
> controls the fan via an external PWM signal.
>
>> diff --git a/drivers/hwmon/axiado-pwm-fan.c b/drivers/hwmon/axiado-pwm-fan.c
>> new file mode 100644
>> index 0000000000000..ac153afded47a
>> --- /dev/null
>> +++ b/drivers/hwmon/axiado-pwm-fan.c
> [ ... ]
>> +static irqreturn_t axiado_tach_irq_handler(int irq, void *dev)
>> +{
>> + struct axiado_pwm_fan_ctx *ctx = dev;
>> + u32 status;
>> +
>> + status = ioread32(ctx->tach_base + AX_TACH_INT_STATUS_REG);
>> +
>> + if (!status)
>> + return IRQ_NONE;
>
> [Severity: High]
> Will this handler cause an IRQ storm if the hardware asserts an interrupt
> where the status is non-zero but AX_TACH_INT_PENDING is not set?
>
> Since the condition only checks if status is zero, an unexpected bit could
> bypass the IRQ_NONE return path. The handler would then proceed to clear only
> the AX_TACH_INT_PENDING bit and return IRQ_HANDLED, leaving the actual
> hardware interrupt active and bypassing the kernel's spurious IRQ protection.
>
> Should this explicitly check if the AX_TACH_INT_PENDING bit is set before
> processing the interrupt?
>
Please address this problem, or explain why it does not apply.
Thanks,
Guenter
>> +
>> + scoped_guard(spinlock_irqsave, &ctx->tach_lock) {
>> + ctx->tach.count = ioread32(ctx->tach_base + AX_TACH_COUNT_REG);
>> + }
>> +
>> + iowrite32(AX_TACH_INT_PENDING, ctx->tach_base + AX_TACH_INT_STATUS_REG);
>> +
>> + return IRQ_HANDLED;
>> +}
>
prev parent reply other threads:[~2026-09-11 14:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 8:38 [PATCH v2 0/2] hwmon: add Axiado AX3000 and AX3005 PWM fan support Petar Stepanovic
2026-09-03 8:38 ` [PATCH v2 1/2] dt-bindings: hwmon: add Axiado AX3000 and AX3005 PWM fan controller Petar Stepanovic
2026-09-03 8:43 ` sashiko-bot
2026-09-11 7:03 ` Krzysztof Kozlowski
2026-09-03 8:38 ` [PATCH v2 2/2] hwmon: add Axiado AX3000 and AX3005 PWM fan controller driver Petar Stepanovic
2026-09-03 8:48 ` sashiko-bot
2026-09-11 14:52 ` Guenter Roeck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=518aea33-277a-4d8f-8bf7-7469879f6f56@roeck-us.net \
--to=linux@roeck-us.net \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=pstepanovic@axiado.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox