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 v6 7/7] net: ftgmac100: Allow building on ARM64
Date: Mon, 16 Nov 2026 13:54:23 +0000 [thread overview]
Message-ID: <179483726335.3136.9821414113172154468@kernel.org> (raw)
In-Reply-To: <20261112-support_ast2700-v6-7-238020bf46cf@aspeedtech.com>
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 2
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] On AST2700 (FTGMAC100_QUIRK_DMA_35BIT) the driver keeps no
software copy of buffer DMA addresses.
- [Low] The commit message gives the wrong reason for dropping `depends
on !64BIT || BROKEN` from FTGMAC100…
- [Low] The new MDIO_ASPEED help text in drivers/net/mdio/Kconfig (lines
58-62) reads like a changelog, not like help text that stays in the…
--
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 restriction.
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: Low]
The commit message says:
The driver now programs the upper DMA address fields, so it no longer
needs to be marked BROKEN for 64-bit builds.
Is that why the restriction was there in the first place? The
!64BIT || BROKEN dependency arrived in eac8173e7b99 ("net: faraday add
nds32 support."), together with COMPILE_TEST, on both FTMAC100 and
FTGMAC100. It looks like a general "not 64-bit clean" marker and has
nothing to do with DMA address width.
The upper address programming is also only done under
FTGMAC100_QUIRK_DMA_35BIT, and only the AST2700 match data sets that
quirk. For example, ftgmac100_init_hw():
if (priv->quirks & FTGMAC100_QUIRK_DMA_35BIT)
iowrite32(upper_32_bits(priv->rxdes_dma),
priv->base + FTGMAC100_OFFSET_RXR_BADDR_HIGH);
and ftgmac100_probe():
if (priv->quirks & FTGMAC100_QUIRK_DMA_35BIT) {
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(35));
The other compatibles never program the high fields. They work on a
64-bit kernel only because they keep the default 32-bit DMA mask.
Also, with no 64BIT restriction left, this line lets the driver build on
every 64-bit architecture under COMPILE_TEST (x86_64, riscv64, and so on),
not only on ARM64 as the subject says.
Could the commit message describe both of these points?
[Severity: Medium]
This change makes the 35-bit DMA path reachable on real AST2700 hardware.
On that path the driver keeps no software copy of the buffer DMA
addresses. It stores the upper bits only in the device-owned descriptor,
in ftgmac100_alloc_rx_buf():
if (priv->quirks & FTGMAC100_QUIRK_DMA_35BIT)
rxdes->rxdes2 = cpu_to_le32(FIELD_PREP(FTGMAC100_RXDES2_RXBUF_BADR_HI,
upper_32_bits(map)));
rxdes->rxdes3 = cpu_to_le32(lower_32_bits(map));
After the MAC completes the descriptor, ftgmac100_rx_packet() rebuilds
the handle from rxdes2 and passes it to dma_unmap_single():
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() rebuilds it the same way. ftgmac100_free_tx_packet()
does the same with txdes2.
The header describes rxdes2 as a word the device writes:
__le32 rxdes2; /* length/type on AST2500 */
Does the AST2700 MAC leave bits 18:16 of rxdes2 (and txdes2) untouched
when it writes the descriptor back?
If it rewrites the whole word, every buffer mapped above 4 GiB would be
unmapped with the wrong DMA address. With dma-direct on arm64 that means
cache maintenance on the wrong physical range. With swiotlb or an IOMMU it
means the wrong bounce buffer or IOVA.
Neither the code nor the commit message says whether these bits are
preserved. If that is not guaranteed, would it be safer to keep the DMA
handles in a software array next to rx_skbs and tx_skbs?
> 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
> depends on OF_MDIO && HAS_IOMEM
> help
> This module provides a driver for the independent MDIO bus
> - controllers found in the ASPEED AST2600 SoC. This is a driver for the
> - third revision of the ASPEED MDIO register interface - the first two
> - revisions are the "old" and "new" interfaces found in the AST2400 and
> - AST2500, embedded in the MAC. For legacy reasons, FTGMAC100 driver
> - continues to drive the embedded MDIO controller for the AST2400 and
> - AST2500 SoCs, so say N if AST2600 support is not required.
> + controllers found in the ASPEED AST2600 and AST2700 SoCs. This is a
> + driver for the third revision of the ASPEED MDIO register interface -
> + the first two revisions are the "old" and "new" interfaces found in
> + the AST2400 and AST2500, embedded in the MAC. For legacy reasons,
> + 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 this help text reads like a changelog. The word
"now" only makes sense relative to this patch, and the sentence is about
Kconfig internals rather than what the option does.
"unconditionally" is also not quite accurate. The select is:
select MDIO_ASPEED if ARCH_ASPEED
inside config FTGMAC100, so it only applies when FTGMAC100 is enabled on
an ARCH_ASPEED kernel.
The old advice ("say N if AST2600 support is not required") is removed and
nothing replaces it, even though the prompt is still visible to users.
Could the text say instead that saying N has no effect when FTGMAC100 is
enabled on ARCH_ASPEED, and when N is a sensible answer?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112-support_ast2700-v6-0-238020bf46cf%40aspeedtech.com
prev parent reply other threads:[~2026-11-16 13:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 8:39 [PATCH net-next v6 0/7] net: ftgmac100: Add AST2700 support Jacky Chou
2026-11-12 8:39 ` [PATCH net-next v6 1/7] dt-bindings: net: ftgmac100: Make Aspeed compatibles standalone Jacky Chou
2026-11-12 18:43 ` Conor Dooley
2026-11-16 13:54 ` netdev-bot+sashiko
2026-11-12 8:39 ` [PATCH net-next v6 2/7] dt-bindings: net: ftgmac100: Add AST2700 compatible Jacky Chou
2026-11-12 18:44 ` Conor Dooley
2026-11-16 13:54 ` netdev-bot+sashiko
2026-11-16 14:10 ` Andrew Lunn
2026-11-12 8:39 ` [PATCH net-next v6 3/7] net: ftgmac100: Add AST2700 compatible support Jacky Chou
2026-11-16 13:54 ` netdev-bot+sashiko
2026-11-12 8:39 ` [PATCH net-next v6 4/7] net: ftgmac100: Enable AST2700 RMII support Jacky Chou
2026-11-16 13:54 ` netdev-bot+sashiko
2026-11-12 8:39 ` [PATCH net-next v6 5/7] net: ftgmac100: Require phy-mode for AST2700 Jacky Chou
2026-11-16 13:54 ` netdev-bot+sashiko
2026-11-12 8:39 ` [PATCH net-next v6 6/7] net: ftgmac100: Add AST2700 upper DMA address support Jacky Chou
2026-11-16 13:54 ` netdev-bot+sashiko
2026-11-12 8:39 ` [PATCH net-next v6 7/7] net: ftgmac100: Allow building on ARM64 Jacky Chou
2026-11-16 13:54 ` 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=179483726335.3136.9821414113172154468@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