From: Jerome Brunet <jbrunet@baylibre.com>
To: sashiko-bot@kernel.org
Cc: sashiko-reviews@lists.linux.dev, conor+dt@kernel.org,
devicetree@vger.kernel.org, robh@kernel.org,
linux-sunxi@lists.linux.dev
Subject: Re: [PATCH RFC/RFT 2/2] net: stmmac: Add support for Allwinner A733 GMAC210
Date: Sun, 02 Aug 2026 17:24:27 +0200 [thread overview]
Message-ID: <1jv79slf4k.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <20260801163100.639F21F00AC4@smtp.kernel.org> (sashiko-bot@kernel.org's message of "Sat, 01 Aug 2026 16:30:59 +0000")
On sam. 01 août 2026 at 16:30, sashiko-bot@kernel.org wrote:
>
>> + if (!plat->stmmac_rst || !plat->stmmac_ahb_rst) {
>> + dev_err(dev, "missing required reset controls\n");
>> + return ERR_PTR(-EINVAL);
>> + }
>> +
>> + /*
>> + * The configuration registers are inside the controller
>> + * reset domain, so the reset must happen before any write to them
>> + * and should not be done again by stmmac or the configuration will
>> + * be lost.
>> + */
>> + ret = reset_control_assert(plat->stmmac_rst);
>> + if (!ret)
>> + ret = reset_control_deassert(plat->stmmac_rst);
>
> [Severity: High]
> Will this cause a bus hang when writing to the MMIO registers?
>
No it does not. I've checked.
Actually touching the ahb reset here has negative effect. stmmac does
not properly detect the link type then (GMII instead of RGMII)
> The code checks that plat->stmmac_ahb_rst is present earlier in this
> function, but only toggles the main mac reset here.
>
> When sun55i_gmac200_setup() later calls regmap_write(), accessing an IP
> block over the AHB bus while its AHB interface is still held in reset
> typically causes a synchronous external abort or bus hang.
>
>> +
>> + if (ret) {
>> + dev_err_probe(dev, ret, "device reset failed\n");
>
> [ ... ]
>
>> static int sun55i_gmac200_setup(struct platform_device *pdev,
>> struct plat_stmmacenet_data *plat,
>> const struct sun55i_gmac_data *data)
>> {
>
> [ ... ]
>
>> - ret = regmap_write(regmap, SYSCON_REG, reg);
>> + ret = regmap_write(regmap, data->offset, reg);
>> if (ret < 0)
>> return dev_err_probe(dev, ret, "Failed to write to syscon\n");
>>
>> + plat->flags |= data->flags;
>> + plat->host_dma_width = 32;
>> +
>> return 0;
>> }
>
> [Severity: High]
> Are these custom hardware settings lost after a system suspend?
>
> The driver configures critical hardware properties like TX/RX delays and
> PHY interface modes in the MAC's internal glue configuration registers
> here, but does not appear to assign a plat->resume callback to the
> plat_stmmacenet_data structure.
>
> If the MAC loses power during suspend, won't these registers revert to
> their default states on resume, leaving the network broken because the
> generic stmmac_resume() has no way to invoke this glue logic?
Assuming there is an issue here, it would be a pre-existing one for this
driver, same as the sun55i-a523.
Let's not get ahead of ourselves. Support for this chip is still in the
very early phase. I don't think we have the means to test suspend
yet.
--
Jerome
prev parent reply other threads:[~2026-08-02 15:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 16:30 [PATCH RFC/RFT 0/2] net: stmmac: Add support for Allwinner A733 GMAC210 Jerome Brunet
2026-07-31 16:30 ` [PATCH RFC/RFT 1/2] dt-bindings: net: sun8i-emac: Add A733 GMAC210 compatible Jerome Brunet
2026-07-31 16:30 ` [PATCH RFC/RFT 2/2] net: stmmac: Add support for Allwinner A733 GMAC210 Jerome Brunet
2026-08-01 16:30 ` sashiko-bot
2026-08-02 15:24 ` Jerome Brunet [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=1jv79slf4k.fsf@starbuckisacylon.baylibre.com \
--to=jbrunet@baylibre.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=robh@kernel.org \
--cc=sashiko-bot@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