Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Selvamani Rajagopal" <Selvamani.Rajagopal@onsemi.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH net v2 2/2] dt-bindings: net: updated interrupt type to be active low, level triggered
Date: Sat, 30 May 2026 20:05:05 +0000	[thread overview]
Message-ID: <20260530200506.1FE141F00893@smtp.kernel.org> (raw)
In-Reply-To: <CY8PR02MB92497E67D5AB4C72E7A4C12683162@CY8PR02MB9249.namprd02.prod.outlook.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] The DT binding correctly updates the interrupt type to active low, level-triggered (`IRQ_TYPE_LEVEL_LOW`), but the `oa_tc6` driver hardcodes `IRQF_TRIGGER_FALLING` in its IRQ request. This mismatch causes dropped interrupts, and attempting to fix the driver to use level-triggered interrupts would currently result in an interrupt storm.
--

commit 50f6d43fc72305690796fcff8249a6220cbe4714
Author: Selvamani Rajagopal <Selvamani.Rajagopal@onsemi.com>

dt-bindings: net: updated interrupt type to be active low, level triggered

This commit updates the LAN8650 device tree binding to specify an active
low, level-triggered interrupt, aligning with the hardware specification.

> diff --git a/Documentation/devicetree/bindings/net/microchip,lan8650.yaml b/Documentation/devicetree/bindings/net/microchip,lan8650.yaml
> --- a/Documentation/devicetree/bindings/net/microchip,lan8650.yaml
> +++ b/Documentation/devicetree/bindings/net/microchip,lan8650.yaml
> @@ -67,7 +67,7 @@ examples:
>          pinctrl-names = "default";
>          pinctrl-0 = <&eth0_pins>;
>          interrupt-parent = <&gpio>;
> -        interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
> +        interrupts = <6 IRQ_TYPE_LEVEL_LOW>;

[Severity: High]
This is a pre-existing issue, but this DT binding update highlights a
mismatch with the driver implementation. The hardware uses an active-low
level-triggered interrupt, but the driver currently hardcodes an
edge-triggered configuration:

drivers/net/ethernet/oa_tc6.c:oa_tc6_init() {
    ...
    ret = devm_request_irq(&tc6->spi->dev, tc6->spi->irq, oa_tc6_macphy_isr,
                           IRQF_TRIGGER_FALLING, dev_name(&tc6->spi->dev),
                           tc6);
    ...
}

Does the driver need to be updated to respect the device tree's interrupt
trigger configuration instead of hardcoding IRQF_TRIGGER_FALLING?

If the driver is updated to use level-triggered interrupts, could this
cause an interrupt storm? Looking at the current hardirq handler:

drivers/net/ethernet/oa_tc6.c:oa_tc6_macphy_isr() {
    struct oa_tc6 *tc6 = data;

    tc6->int_flag = true;
    /* Wake spi kthread to perform spi transfer */
    wake_up_interruptible(&tc6->spi_wq);

    return IRQ_HANDLED;
}

Since oa_tc6_macphy_isr() returns IRQ_HANDLED without clearing the hardware
interrupt condition (which requires a slow SPI transaction), wouldn't the
IRQ core immediately fire the interrupt again if it were configured as
level-triggered?

Would it be safer to migrate this driver to use devm_request_threaded_irq()
with IRQF_ONESHOT so the interrupt remains masked until the threaded handler
can clear it, properly supporting the level-triggered configuration defined
in this binding?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/CY8PR02MB92497E67D5AB4C72E7A4C12683162@CY8PR02MB9249.namprd02.prod.outlook.com?part=2

      parent reply	other threads:[~2026-05-30 20:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-29 20:04 [PATCH net v2 2/2] dt-bindings: net: updated interrupt type to be active low, level triggered Selvamani Rajagopal
2026-05-30 10:33 ` Krzysztof Kozlowski
2026-05-30 20:05 ` sashiko-bot [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=20260530200506.1FE141F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Selvamani.Rajagopal@onsemi.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --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