Article View: linux.kernel.netdev
Article #18059Re: [PATCH net v2 11/12] net: au1000: keep the MAC stopped until the PHY link is ready
From: Florian Fainelli
Date: Tue, 17 Nov 2026 19:18
Date: Tue, 17 Nov 2026 19:18
123 lines
15619 bytes
15619 bytes
On 11/16/26 05:50, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found more severe
> issue(s) in other patches of this series. This mail is only an FYI, in case
> you want to address the nit picks below when you respin.
>
> Low priority / nit picks for your consideration:
>
> - [Low] The commit message and comments in this patch don't match the
> code.
>
> --
>
> net: au1000: keep the MAC stopped until the PHY link is ready
>
> This patch stops the MAC when the PHY reports link-down. On open, it now
> calls phy_resume() before au1000_init(). It also keeps MAC RX/TX disabled
> in au1000_init() until au1000_adjust_link() has seen a link-up.
>
>> diff --git a/drivers/net/ethernet/amd/au1000_eth.c b/drivers/net/ethernet/amd/au1000_eth.c
>> index 8b7a88ceb3c5e..d60430a3795ed 100644
>> --- a/drivers/net/ethernet/amd/au1000_eth.c
>> +++ b/drivers/net/ethernet/amd/au1000_eth.c
>
> [ ... ]
>
>> @@ -691,8 +692,8 @@ static u32 au1000_rx_mode(struct net_device *dev, u32 reg);
>> * When the device powers up, the clocks are disabled and the
>> * mac is in reset state. When the interface is closed, we
>> * do the same -- reset the device and disable the clocks to
>> - * conserve power. Thus, whenever au1000_init() is called,
>> - * the device should already be in reset state.
>> + * conserve power. The device must be stopped before au1000_init() is
>> + * called, but may be out of reset for MDIO accesses while resuming the PHY.
>> */
>> static int au1000_init(struct net_device *dev)
>> {
>
> [ ... ]
>
>> @@ -928,11 +934,25 @@ static int au1000_open(struct net_device *dev)
>> return retval;
>> }
>>
>
> [ ... ]
>
>> + /* Restore the MII clocks without starting the PHY state machine. */
>> + if (dev->phydev) {
>> + retval = phy_resume(dev->phydev);
>> + if (retval)
>> + goto err_reset;
>> + }
>> +
>> retval = au1000_init(dev);
>> if (retval) {
>> netdev_err(dev, "error in au1000_init\n");
>> - free_irq(dev->irq, dev);
>> - return retval;
>> + if (dev->phydev)
>> + phy_suspend(dev->phydev);
>> + goto err_reset;
>> }
>
> [Severity: Low]
>
> Can this error branch in au1000_open() ever run? au1000_init() has only
> one return statement:
>
> drivers/net/ethernet/amd/au1000_eth.c:au1000_init() {
> ...
> spin_unlock_irqrestore(&aup->lock, flags);
> netif_addr_unlock_bh(dev);
> return 0;
> }
>
> au1000_enable_mac() returns void, so nothing in au1000_init() can fail.
> That makes the new phy_suspend() rollback look like dead code, even
> though the commit message describes it as:
>
> if initialization fails, suspend the PHY again before cleanup.
>
> The commit message also says:
>
> Initialize the MAC before phy_start() so the PHY worker cannot access
> MDIO or enable traffic during setup.
>
> Didn't au1000_open() already call au1000_init() before phy_start() before
> this patch? The diff shows that order as unchanged context.
>
> The actual changes seem to be the new phy_resume() call before
> au1000_init(), and making RX/TX depend on aup->old_link. Could the commit
> message describe those changes instead?
>
> Separately, the au1000_init() header comment now says the device "may be
> out of reset for MDIO accesses while resuming the PHY". The comment in
> au1000_probe() was not changed and still says:
>
> /*
> * The boot code uses the ethernet controller, so reset it to start
> * fresh. au1000_init() expects that the device is in reset state.
> */
>
> Should these two comments be reconciled? They now give conflicting
> preconditions for au1000_init(). Neither is strictly accurate, because
> au1000_init() always forces a reset itself through
> au1000_enable_mac(dev, 1).
Agreed on all three points. In the respin I have:
• Removed the unreachable initialization-error branch, including the new
phy_suspend() rollback, since au1000_init() always returns zero.
• Updated the commit message to describe the new synchronous
phy_resume() before MAC initialization, while preserving the existing
initialization-before-phy_start() ordering.
• Reconciled the comments to explain that au1000_init() forces a reset
itself and that preceding MDIO accesses may already have enabled the MAC.
pw-bot: cr
--
Florian
Technical Details
Message-ID:
<ddf29c30-de9f-486e-b6f1-42f06200eb55@gmail.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365548-linux-kernel-netdev=dewy.ruReferences:
<20261112045301.3669532-12-f.fainelli@gmail.com> <179483704995.3136.5707920157509018990@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365548-linux-kernel-netdev=dewy.ru
From: f.fainelli@gmail.com (Florian Fainelli)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2 11/12] net: au1000: keep the MAC stopped until the
PHY link is ready
Date: Tue, 17 Nov 2026 11:18:13 -0800
Organization: Usenet Network
Message-ID: <ddf29c30-de9f-486e-b6f1-42f06200eb55@gmail.com>
References: <20261112045301.3669532-12-f.fainelli@gmail.com>
<179483704995.3136.5707920157509018990@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="2407835"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:NJ3Th7PcwRLvtA7dNH1S8Mhr9PY= sha256:Z442/iye+w9vO/fzu1XRXhGMVDKBvNlmUdL+WzobgQU=
sha1:E8vVxdgMFLRf/HSjjeue0iqhwCY= sha256:rwIN6is3hgGgbfftHy8GpAqYlsq49sNAxuoGOAey3S0=
Content-Language: en-US, fr-FR
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 86A9D11504F; Tue, 17 Nov 2026 22:18:42 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id 5ccekMQ4jovF;
Tue, 17 Nov 2026 22:18:39 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-365548-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id CA4EC115040; Tue, 17 Nov 2026 22:18:28 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id 29493330D4; Tue, 17 Nov 2026 19:18:25 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1794943104;
b=N4Wp8+HY5RpysIZoWkc7MiIKr6RUAuY3hoewFUU4iSAnsKFePrA5aI7fuxOX3rivUv/o
gZcYl7qooNHj423WxIPNnwKmyM/fQI7gVxRcFmz0QQBI/Csu/HwPFtRZMDA1PvzBzgKrY
vTMLSqdXJv9NgQKb2l9sgRQH0ivLF8lLzFIRGektvHGqW+LZ5Zya158Ol9SyPd+V0JZgS
69lKJcdiWBGMgJFQP6ZmyQYwP+haxBapKct0SWW/LVpXB3VVyBkXFSyDcRDR7CvdyOoOD
yMXQm0ZoQ63+rOysg/YvO36z4QgYPT3Scrk1qw0AsFAAlNvmtoiWyTylSpF8ghT9cJw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794943104;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:Message-ID:Date:X-Mailing-List:List-Id:List-Post:List-Help:
List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To:
Content-Type:Content-Transfer-Encoding;
bh=1Edwp1EcAjO2ABx/cNirsINggYhI4Q4uIjqMsRIaK2c=;
b=gJRb7Y8rBbP0CY/FM4I0qDypOPdlDIipzT5p1KpEbvQOE4MXSnj7Yt+JbOyN/XykOFYB
4KR2cGleZWREHORqZDWBPr/ZXsSQYqKt4MxQabqCFXMKTVE/bZY4PUM2A/3s00jBMoRWM
lYIdlPJvt7dpc+l4fdCH7B/hXEdax1j2fjbx0xZmXsvY1NUbpTIfLUcvTuT9OcJzsj5zr
tvFknZXQjM5f6YQXTQ83K1YaNWqau8mYtbsXF1bocHhgCvBYZTbZkmmIR4Sm/dHoYnDWB
NQJKWigIHf3SX46ca/HCexWeOaMpchqW+0GN9Qq/0tIq9s6xqBe4T3ynrC9+kkH4hZA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=0R2MqpIx;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 55667606A33B;
Tue, 17 Nov 2026 19:18:24 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=0R2MqpIx
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.219.41
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1794943103;
b=2+H+077S7NM/OMjRfV10U+Io5BUXbQ+NE3jV31L+V4pMSsR/pCMGuxpvjpi2aOQeOE0J
5GDmXMv9XGQoN10Ci8Qm53SmWbKMDAwXvr+qJn6JVnIRGCeKqryMNybMQELpXduRTZnbw
EWYldW/iQaxHkMZSMpToP99sK68MgJMwyhGInz9dVagEMhRrkzkC7pZiAJ4ZEs7ziCBMX
gS/6ZQ2G1QFh6oxnjbymRhnjRCHTUklrZdvT2eWbUNfYk4GnWkc/ancf5DTnFBRz2iG87
z6HRI2otsdtJp4CG5VDkPxTIrF4yV1mw265j9zdlJBMbeSFnSBwyeASxx31iWF8oIuQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794943103;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Message-ID:Date:
MIME-Version:User-Agent:Subject:To:Cc:References:Content-Language:
From:In-Reply-To:Content-Type:Content-Transfer-Encoding;
bh=1Edwp1EcAjO2ABx/cNirsINggYhI4Q4uIjqMsRIaK2c=;
b=EfuX9qMiq41TNY2H5psCxdpIkqv5nV2srjDFyAWeYmZ/IHlREWXcoeRmBVXEtNeQtQoI
8HQTrMX6gm8I6Iww1iO20bvQ9thQ8dQHwlCAC4bPoVFVSpOwXFvvYJ4x4SK3EBbvR2sct
B+jmEN1/tp3YbeHQLhO+oxBh3mvZfbdONGRlbQgDxPumcE0siD3iutwQqeD0diYt6Xaip
SuNovnYqlUktfw1c2t4bCdCp4SNOULy7dvx/gCyruM3ctI1pYJaBKlwScTcKPDKBxK87M
jPihBy73RT9Q5EqTxObICzNcxxfJ3n0My4NvHQeIrIcerH1n22DfNXvSVV9aRPy0M6g==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=0R2MqpIx;
arc=none smtp.remote-ip=209.85.219.41
X-Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 27875606A32C
for <netdev@vger.kernel.org>; Tue, 17 Nov 2026 19:18:22 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 27875606A32C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-qv1-f41.google.com with SMTP id 6a1803df08f44-91e7af9a67fso160626d6.2
for <netdev@vger.kernel.org>; Tue, 17 Nov 2026 11:18:22 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1794943102; x=1795547902; darn=vger.kernel.org;
h=content-transfer-encoding:content-type:in-reply-to:from
:content-language:references:cc:to:subject:user-agent:mime-version
:date:message-id:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=1Edwp1EcAjO2ABx/cNirsINggYhI4Q4uIjqMsRIaK2c=;
b=0R2MqpIxgKWqnVxLLFLn7f6a2ORR8Dlv9evj2spHbYLhN3X7ypfC7lit78GwvNKuKV
Z7JZXNqmgi47OuXI4o7OQyKFepcm17OwfCiHpagjtQqlvHXZLN2+qpsklhAP40svnczE
Wj4a50d5bPswncfHYVt2Qv/FHhoWt6aZCt+a7PRKA2nOiPlT1kjfnuBJhzuHKQ1GEB4Y
YtcgYMEgM2wGHw+lYgajxFRNNgoZrsbhB9pXLZbybKdR6l4/p2Kb8o4UWo6CCBdMqUjV
iIok+k+oUjzZyN7AhxqphHIdt/Lxlv+SqvXRCb3XCNSkkejRyQoqkByLu8O8xczC57IY
G9Eg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1794943102; x=1795547902;
h=content-transfer-encoding:content-type:in-reply-to:from
:content-language:references:cc:to:subject:user-agent:mime-version
:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=1Edwp1EcAjO2ABx/cNirsINggYhI4Q4uIjqMsRIaK2c=;
b=0NbWVV6w6hRF6VPWxgrs1Pb182MsivAZ5H4zh8zkAVXkhuHdbKrC84hySU064Y5U0C
JtyYooCYjhGsLIUKlptJ19sy057A5FV7rHyoneIT+1bl3lZ8Et0WAQXC0NnlVJSnr4U3
NWN7H36mfrQhpiLH+xlNFjIEJLfzk8cWGcoAEJ+XXcA11p3cc2lnCn1pC/maL29daufZ
oEixafN94YV7q8F1FOjyPRFJfs02hfcmP6xlRhitqjmC1a2I/Q3524nhsmFeKJMSBV5c
+pY2lpK21gTdmtYBXmwks1ty/MZ8biNQXaOi2VFW/O0eHbYfktASD9csVSm/Mb6t2vK/
aQkA==
X-Gm-Message-State: APuU4Z+prScrxFgmsPm5ZBKGrD+P3kb4PNeVTnGtwiK8lcjbdqQ6hK+c
rwi/VToNY5LLywJShv0FDNM41TJUTZryNvnyPzutydUOQu5elVQW4NS6
X-Gm-Gg: AZFdTZePixeK7Uf/8zlQSlbWW0VYwcZHne0jijWc5OrXTQhtxdIZ4PUS14rcMUK8UFm
Wgys3Wbp9E82AoJFWgYCkTY0Gh9cgivET7VcMuWcyKO7pVor49R/m0WRqFnZLNLdr8DpVivzo+G
HdHluK7biVzO0EkgaCG3r86SVLIVcTt4EOvfzMgCNhZyAFHGG256E7V7cXXzAvtFe7/cnt7cmDc
WbZPBIr3O3kY9XzrgQaZ63umx+hIJpja7m2qtfrFX1qqkcHnJVKO4cZQEA3/e0peScjQnI2uI+Y
sM5yHN8suZVP5hM6/T7w+kTXCZYhwhoh/FFK06IAUmqwSaMkWxcpvnPIpUVo2BErFI9vNunlHla
GCAsW7+LiiPY7LkGg8JbI73NlKQe6LeGYaarCoX3bMzmScs7dEoS3MVp+AHGQ5m98TlQa5vLkbN
HDqznFF5+3vaNoZQZlVk7GlLSqsWlQV+3kD0WMZREXMhgANv6P/fyWBv0C2bC6MsQoTzaE/xfDj
u1NFavRyN+w3BwN3l+os2TYDsUK66dt4Eg3KJqU6sKGZaf03esUVgFyvscxY7FQ4dtdCL5IL0Ya
Vh3hADjIpvMymgcsyBAYf7vyIfjLjM+x3uYjhhfzL3ztqYEjXzwThMqysg==
X-Received: by 2002:a05:6214:1bc8:b0:91b:9536:21af with SMTP id 6a1803df08f44-92114eabcfcmr2276646d6.46.1794943101894;
Tue, 17 Nov 2026 11:18:21 -0800 (PST)
X-Received: from [10.67.48.245] ([192.19.223.252])
by smtp.gmail.com with ESMTPSA id 6a1803df08f44-92114d537bcsm1263596d6.24.2026.11.17.11.18.14
(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
Tue, 17 Nov 2026 11:18:17 -0800 (PST)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-User-Agent: Mozilla Thunderbird
X-Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net,
edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
hkallweit1@gmail.com, linux@armlinux.org.uk, shaojijie@huawei.com,
horms@kernel.org, runyu.xiao@seu.edu.cn, mmyangfl@gmail.com, hvr@gnu.org,
jeff@garzik.org, danny.kukawka@bisect.de, mugunthanvnm@ti.com,
sebastian.hesselbarth@gmail.com, linux-kernel@vger.kernel.org,
manuel.lauss@gmail.com
X-In-Reply-To: <179483704995.3136.5707920157509018990@kernel.org>