Devicetree
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: jacky_chou@aspeedtech.com
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org,
	pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, ratbert@faraday-tech.com,
	edumazet@kernel.org, hkallweit1@gmail.com, linux@armlinux.org.uk,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, andrew@lunn.ch
Subject: Re: [PATCH net-next v7 7/7] net: ftgmac100: Allow building on ARM64
Date: Mon, 23 Nov 2026 10:13:22 +0000	[thread overview]
Message-ID: <179542880231.3135.3272879516767831505@kernel.org> (raw)
In-Reply-To: <20261119-support_ast2700-v7-7-33c8ca2d0dd7@aspeedtech.com>

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

Critical: 0 · High: 0 · Medium: 1 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] This commit removes `depends on !64BIT || BROKEN` from
  FTGMAC100.
- [Low] The new MDIO_ASPEED help text in drivers/net/mdio/Kconfig reads
  like a changelog and is imprecise.

--

net: ftgmac100: Allow building on ARM64

This commit lets the Faraday vendor menu and the FTGMAC100 driver be
selected on ARM64 for AST2700, and drops the !64BIT || BROKEN dependency.
It also changes the MDIO_ASPEED select condition from MACH_ASPEED_G6 to
ARCH_ASPEED and updates the MDIO_ASPEED help text.

> diff --git a/drivers/net/ethernet/faraday/Kconfig b/drivers/net/ethernet/faraday/Kconfig
> index 474073c7f94d7..9acc2d260c1f9 100644
> --- a/drivers/net/ethernet/faraday/Kconfig
> +++ b/drivers/net/ethernet/faraday/Kconfig

[ ... ]

> @@ -28,11 +28,10 @@ config FTMAC100
>  
>  config FTGMAC100
>  	tristate "Faraday FTGMAC100 Gigabit Ethernet support"
> -	depends on ARM || COMPILE_TEST
> -	depends on !64BIT || BROKEN
> +	depends on ARM || ARM64 || COMPILE_TEST

[Severity: Medium]
Without the BROKEN gate, RX buffers on AST2700 (FTGMAC100_QUIRK_DMA_35BIT,
35-bit DMA mask) can be mapped above 4 GiB. Has it been confirmed that the
MAC never writes RXDES2[18:16] when it completes an RX descriptor?

The driver header says that RXDES2 is written by hardware on an earlier
Aspeed MAC:

drivers/net/ethernet/faraday/ftgmac100.h:
struct ftgmac100_rxdes {
	...
	__le32	rxdes2; /* length/type on AST2500 */
	...
};

After the MAC hands the descriptor back, ftgmac100_rx_packet() rebuilds the
unmap address from RXDES2:

	map = le32_to_cpu(rxdes->rxdes3);
	if (priv->quirks & FTGMAC100_QUIRK_DMA_35BIT)
		map |= (u64)FIELD_GET(FTGMAC100_RXDES2_RXBUF_BADR_HI,
				     le32_to_cpu(rxdes->rxdes2)) << 32;

ftgmac100_free_buffers() does the same thing at teardown.

Fragmented (FRS/LRS) or errored frames take the drop path in
ftgmac100_rx_packet(). That path gives the descriptor back to hardware but
only rewrites RXDES0:

drop:
	/* Clean rxdes0 (which resets own bit) */
	rxdes->rxdes0 = cpu_to_le32(status & priv->rxdes0_edorr_mask);

The upper address bits are only programmed in ftgmac100_alloc_rx_buf() and
during ring init.

Suppose the AST2700 MAC writes length/type, or anything else, into RXDES2
bits 18:16 on completion. Could dma_unmap_single() then be called with the
wrong address? And after a dropped frame, could the MAC DMA the next frame
on that recycled descriptor into the wrong physical memory?

If the hardware can change those bits, would it be safer to keep each
entry's full dma_addr_t in software? RXDES2/RXDES3 could then be rewritten
every time a descriptor goes back to hardware, including on the drop path.

>  	select PHYLIB
>  	select FIXED_PHY
> -	select MDIO_ASPEED if MACH_ASPEED_G6
> +	select MDIO_ASPEED if ARCH_ASPEED
>  	select CRC32
>  	help
>  	  This driver supports the FTGMAC100 Gigabit Ethernet controller
> diff --git a/drivers/net/mdio/Kconfig b/drivers/net/mdio/Kconfig
> index 6f272fae4bb55..ec1794cc64b09 100644
> --- a/drivers/net/mdio/Kconfig
> +++ b/drivers/net/mdio/Kconfig
> @@ -50,12 +50,16 @@ config MDIO_ASPEED

[ ... ]

> +	  FTGMAC100 driver continues to drive the embedded MDIO controller for
> +	  the AST2400 and AST2500 SoCs. AST2700 has no dedicated MACH_ASPEED_G7
> +	  symbol and is only gated by ARCH_ASPEED, so FTGMAC100 now
> +	  unconditionally selects this driver on every ARCH_ASPEED platform,
> +	  including the older AST2400/AST2500 SoCs where it has no MDIO node to
> +	  bind to.

[Severity: Low]
This isn't a bug, but is "unconditionally selects this driver on every
ARCH_ASPEED platform" accurate? The select in FTGMAC100 is:

	select MDIO_ASPEED if ARCH_ASPEED

That only forces MDIO_ASPEED when FTGMAC100 itself is enabled, and only to
m when FTGMAC100=m. With ARCH_ASPEED=y and FTGMAC100=n, MDIO_ASPEED can
still be N.

The new text also reads like changelog history ("now", "no dedicated
MACH_ASPEED_G7 symbol") rather than guidance for the user. It also drops
the old "say N if AST2600 support is not required" advice.

Could the help text say when to enable the option instead? That would keep
it from going stale if a MACH_ASPEED_G7 symbol is added later.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119-support_ast2700-v7-0-33c8ca2d0dd7%40aspeedtech.com

      reply	other threads:[~2026-11-23 10:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19  9:32 [PATCH net-next v7 0/7] net: ftgmac100: Add AST2700 support Jacky Chou
2026-11-19  9:32 ` [PATCH net-next v7 1/7] dt-bindings: net: ftgmac100: Make Aspeed compatibles standalone Jacky Chou
2026-11-20  9:32   ` sashiko-bot
2026-11-23 10:13   ` netdev-bot+sashiko
2026-11-19  9:32 ` [PATCH net-next v7 2/7] dt-bindings: net: ftgmac100: Add AST2700 compatible Jacky Chou
2026-11-23 10:13   ` netdev-bot+sashiko
2026-11-19  9:32 ` [PATCH net-next v7 3/7] net: ftgmac100: Add AST2700 compatible support Jacky Chou
2026-11-20  9:32   ` sashiko-bot
2026-11-23 10:13   ` netdev-bot+sashiko
2026-11-19  9:32 ` [PATCH net-next v7 4/7] net: ftgmac100: Enable AST2700 RMII support Jacky Chou
2026-11-23 10:13   ` netdev-bot+sashiko
2026-11-19  9:32 ` [PATCH net-next v7 5/7] net: ftgmac100: Require phy-mode for AST2700 Jacky Chou
2026-11-20  9:33   ` sashiko-bot
2026-11-23 10:13   ` netdev-bot+sashiko
2026-11-19  9:32 ` [PATCH net-next v7 6/7] net: ftgmac100: Add AST2700 upper DMA address support Jacky Chou
2026-11-23 10:13   ` netdev-bot+sashiko
2026-11-19  9:32 ` [PATCH net-next v7 7/7] net: ftgmac100: Allow building on ARM64 Jacky Chou
2026-11-23 10:13   ` netdev-bot+sashiko [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=179542880231.3135.3272879516767831505@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=jacky_chou@aspeedtech.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ratbert@faraday-tech.com \
    --cc=robh@kernel.org \
    /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