From: sashiko-bot@kernel.org
To: "A. Sverdlin" <alexander.sverdlin@siemens.com>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org,
Frank.Li@kernel.org, imx@lists.linux.dev, robh@kernel.org
Subject: Re: [PATCH net-next 2/2] net: fec: support receive flushing via fsl,rx-flush-queues
Date: Sat, 15 Aug 2026 09:19:31 +0000 [thread overview]
Message-ID: <20260815091932.1DA5C1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260814090906.2225075-3-alexander.sverdlin@siemens.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The driver fails to clear bootloader-configured RX flush settings when `fsl,rx-flush-queues` is not specified, potentially inheriting a vulnerable hardware state.
- [High] The newly introduced `FEC_QUIRK_HAS_MULTI_RX_FLUSH` collides with the existing `FEC_QUIRK_HAS_MDIO_C45` bitmask, defeating the ERR050395 erratum safety check.
--
--- Patch [2]: [PATCH net-next 2/2] net: fec: support receive flushing via fsl,rx-flush-queues ---
commit ccf669baa787206c1aada126a00677e049b4714b
Author: Alexander Sverdlin <alexander.sverdlin@siemens.com>
net: fec: support receive flushing via fsl,rx-flush-queues
This commit adds support for flushing frames stuck at the head of the RX FIFO
via the FEC_QOS_SCHEME register. It parses the fsl,rx-flush-queues device tree
property and ensures erratum ERR050395 is respected by restricting multi-queue
flushes to hardware that advertises support.
> diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
> index 7176803146f3d..4af3ae286895f 100644
> --- a/drivers/net/ethernet/freescale/fec.h
> +++ b/drivers/net/ethernet/freescale/fec.h
[ ... ]
> @@ -499,6 +504,12 @@ struct bufdesc_ex {
> /* Jumbo Frame support */
> #define FEC_QUIRK_JUMBO_FRAME BIT(25)
>
> +/* Receive flushing (QOS Scheme register RX_FLUSHn) may be enabled on more than
> + * one RX queue at a time. Parts without this quirk are subject to erratum
> + * ERR050395 and must limit RX flushing to a single queue.
> + */
> +#define FEC_QUIRK_HAS_MULTI_RX_FLUSH BIT(24)
[Severity: High]
Does this new quirk collide with an existing one?
It appears FEC_QUIRK_HAS_MDIO_C45 is already defined as BIT(24) in this
header file (though outside the context of this patch).
Because of this collision, controllers with MDIO C45 support will mistakenly
evaluate as having the multi-rx-flush quirk, completely bypassing the erratum
safety check added in fec_probe() and allowing lock-ups on vulnerable
hardware.
> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> index ced4dbf8cd90f..a4fe8423630b5 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
[ ... ]
> @@ -1090,6 +1090,15 @@ static void fec_enet_enable_ring(struct net_device *ndev)
> fep->hwp + FEC_RCMR(i));
> }
>
> + /* Enable receive flushing for the selected queues */
> + if (fep->rx_flush_mask) {
> + u32 val = readl(fep->hwp + FEC_QOS_SCHEME);
> +
> + val &= ~QOS_RX_FLUSH_MASK;
> + val |= fep->rx_flush_mask;
> + writel(val, fep->hwp + FEC_QOS_SCHEME);
> + }
[Severity: High]
Can this leave vulnerable bootloader configurations active if the device tree
omits the fsl,rx-flush-queues property?
If fep->rx_flush_mask is 0, this register update is skipped entirely.
Meanwhile, controllers with FEC_QUIRK_HAS_MULTI_QUEUES skip the hardware
reset in fec_ctrl_reset().
If a bootloader (or prior kernel via kexec) enabled RX flushing on multiple
queues, and the current device tree doesn't specify the property, the old
configuration will persist. This could inherit a dangerous hardware state
and trigger the ERR050395 RX path lock-up.
Should the FEC_QOS_SCHEME register always be updated to clear the mask if
fep->rx_flush_mask is 0?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260814090906.2225075-1-alexander.sverdlin@siemens.com?part=2
next prev parent reply other threads:[~2026-08-15 9:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-14 9:08 [PATCH net-next 0/2] net: fec: support RX flushing via fsl,rx-flush-queues A. Sverdlin
2026-08-14 9:09 ` [PATCH net-next 1/2] dt-bindings: net: fsl,fec: add fsl,rx-flush-queues A. Sverdlin
2026-08-14 9:09 ` [PATCH net-next 2/2] net: fec: support receive flushing via fsl,rx-flush-queues A. Sverdlin
2026-08-14 10:31 ` Sverdlin, Alexander
2026-08-15 9:19 ` sashiko-bot [this message]
2026-08-14 13:56 ` [PATCH net-next 0/2] net: fec: support RX " Andrew Lunn
2026-08-14 14:21 ` Sverdlin, Alexander
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=20260815091932.1DA5C1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=alexander.sverdlin@siemens.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=imx@lists.linux.dev \
--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