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 6/7] net: ftgmac100: Add AST2700 upper DMA address support
Date: Mon, 23 Nov 2026 10:13:20 +0000 [thread overview]
Message-ID: <179542880047.3135.13258165085711599944@kernel.org> (raw)
In-Reply-To: <20261119-support_ast2700-v7-6-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] When FTGMAC100_QUIRK_DMA_35BIT is set (AST2700),
ftgmac100_rx_packet() (drivers/net/ethernet/faraday/ftgmac100.c lines…
- [Low] This patch gives txdes2 and rxdes2 a new role: on AST2700, bits
18:16 (FTGMAC100_TXDES2_TXBUF_BADR_HI /…
--
net: ftgmac100: Add AST2700 upper DMA address support
This commit adds 35-bit DMA address support for AST2700. It programs the
high RX/TX ring base registers and stores buffer address bits 34:32 in
bits 18:16 of txdes2/rxdes2. It also rebuilds the full address before
unmapping and sets a 35-bit DMA mask, all gated by the new
FTGMAC100_QUIRK_DMA_35BIT quirk.
> diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
> index 5a578a62df673..263594de0e072 100644
> --- a/drivers/net/ethernet/faraday/ftgmac100.c
> +++ b/drivers/net/ethernet/faraday/ftgmac100.c
[ ... ]
> @@ -601,6 +612,9 @@ static bool ftgmac100_rx_packet(struct ftgmac100 *priv, int *processed)
>
> /* Tear down DMA mapping, do necessary cache management */
> 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;
[Severity: Medium]
Is it safe to rebuild the unmap address from rxdes2 after the hardware
has completed the descriptor?
Before this patch the driver never wrote rxdes2, and the header describes
it as a word the hardware writes:
__le32 rxdes2; /* length/type on AST2500 */
Suppose the AST2700 RX engine writes rxdes2 back on completion and does
not preserve bits 18:16. Then map would end up with the wrong bits 34:32.
AST2700 DRAM is above 4 GiB, so those bits are non-zero for every
buffer. dma_unmap_single() would then sync and unmap the wrong address.
ftgmac100_free_buffers() rebuilds the address the same way.
The drop path in ftgmac100_rx_packet() also hands the descriptor back to
the hardware by rewriting only rxdes0:
drop:
/* Clean rxdes0 (which resets own bit) */
rxdes->rxdes0 = cpu_to_le32(status & priv->rxdes0_edorr_mask);
If rxdes2[18:16] was changed, would the next DMA into that slot go to
the wrong physical address? Frames with RX errors or missing FRS/LRS
take this path, and they can come from the network.
Does the AST2700 documentation guarantee that the MAC never writes
rxdes2[18:16]? If it doesn't, two changes would avoid relying on that:
- keep a per-slot software copy of the dma_addr_t and use it for
unmapping
- rewrite rxdes2 on the drop path
>
> #if defined(CONFIG_ARM) && !defined(CONFIG_ARM_DMA_USE_IOMMU)
> /* When we don't have an iommu, we can save cycles by not
[ ... ]
> diff --git a/drivers/net/ethernet/faraday/ftgmac100.h b/drivers/net/ethernet/faraday/ftgmac100.h
> index 8c35c895b1465..0c244b1c0a351 100644
> --- a/drivers/net/ethernet/faraday/ftgmac100.h
> +++ b/drivers/net/ethernet/faraday/ftgmac100.h
[ ... ]
> @@ -226,6 +229,7 @@ struct ftgmac100_txdes {
> #define FTGMAC100_TXDES1_TX2FIC (1 << 30)
> #define FTGMAC100_TXDES1_TXIC (1 << 31)
>
> +#define FTGMAC100_TXDES2_TXBUF_BADR_HI GENMASK(18, 16)
> /*
> * Receive descriptor, aligned to 16 bytes
> */
> @@ -272,4 +276,6 @@ struct ftgmac100_rxdes {
> #define FTGMAC100_RXDES1_UDP_CHKSUM_ERR (1 << 26)
> #define FTGMAC100_RXDES1_IP_CHKSUM_ERR (1 << 27)
>
> +#define FTGMAC100_RXDES2_RXBUF_BADR_HI GENMASK(18, 16)
[Severity: Low]
This isn't a bug, but the struct comments for these words weren't
updated:
struct ftgmac100_txdes {
...
__le32 txdes2; /* Reserved */
...
struct ftgmac100_rxdes {
...
__le32 rxdes2; /* length/type on AST2500 */
...
With this patch, bits 18:16 of both words hold buffer address bits 34:32
on AST2700. Could these comments be updated to say so?
> +
> #endif /* __FTGMAC100_H */
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119-support_ast2700-v7-0-33c8ca2d0dd7%40aspeedtech.com
next prev parent 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 [this message]
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
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=179542880047.3135.13258165085711599944@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