* [PATCH net] net: bcmgenet: if UMAC was suspended in SW_RESET, restore it to SW_RESET
@ 2026-09-29 19:22 Justin Chen
2026-09-29 19:29 ` netdev-bot+sinfo
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Justin Chen @ 2026-09-29 19:22 UTC (permalink / raw)
To: netdev
Cc: pabeni, kuba, edumazet, davem, andrew+netdev,
bcm-kernel-feedback-list, nb, florian.fainelli, opendmb,
Justin Chen
When the revised suspend/resume sequence was introduced this led to an edge
case where the TX is left disabled in the following sequence.
1. phy link is down, so UMAC is held in reset and then network interface
is WoL enabled
2. Enter suspend, bcmgenet_wol_power_down_cfg() enables UMAC_RX since MAC
is in SW_RESET
4. Enter resume, UMAC_RX is left enabled. Since we only enable UMAC_TX
and UMAC_RX in SW_RESET. The UMAC_TX is never enabled again on link up.
Fixes: 254f3239dd07 ("net: bcmgenet: revise suspend/resume")
Fixes: 88f6c8bf1aae ("net: bcmgenet: keep MAC in reset until PHY is up")
Signed-off-by: Justin Chen <justin.chen@broadcom.com>
---
drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
index 96d5d4f7f51f..984432952963 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
@@ -253,6 +253,17 @@ int bcmgenet_wol_power_up_cfg(struct bcmgenet_priv *priv,
reg = bcmgenet_umac_readl(priv, UMAC_CMD);
reg &= ~CMD_CRC_FWD;
bcmgenet_umac_writel(priv, reg, UMAC_CMD);
+
+ /*
+ * Mirror wol_power_down_cfg(). If only UMAC_RX
+ * is enabled, then we must place the UMAC back
+ * into SW_RESET.
+ */
+ reg = bcmgenet_umac_readl(priv, UMAC_CMD);
+ if ((reg & CMD_RX_EN) && !(reg & CMD_TX_EN)) {
+ reg |= CMD_SW_RESET;
+ bcmgenet_umac_writel(priv, reg, UMAC_CMD);
+ }
spin_unlock_bh(&priv->reg_lock);
/* Resume link status tracking */
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH net] net: bcmgenet: if UMAC was suspended in SW_RESET, restore it to SW_RESET
2026-09-29 19:22 [PATCH net] net: bcmgenet: if UMAC was suspended in SW_RESET, restore it to SW_RESET Justin Chen
@ 2026-09-29 19:29 ` netdev-bot+sinfo
2026-09-29 20:12 ` Florian Fainelli
2026-09-29 21:09 ` Nicolai Buchwitz
2 siblings, 0 replies; 5+ messages in thread
From: netdev-bot+sinfo @ 2026-09-29 19:29 UTC (permalink / raw)
To: Justin Chen
Cc: netdev, pabeni, kuba, edumazet, davem, andrew+netdev,
bcm-kernel-feedback-list, nb, florian.fainelli, opendmb
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during
development, syzbot report, manual code inspection, LLM or static
analysis tool scan.
- What hardware the change was tested on. For driver fixes please
mention the device (and if relevant firmware version) used for
testing, or say that the change was not tested on real hardware.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net] net: bcmgenet: if UMAC was suspended in SW_RESET, restore it to SW_RESET
2026-09-29 19:22 [PATCH net] net: bcmgenet: if UMAC was suspended in SW_RESET, restore it to SW_RESET Justin Chen
2026-09-29 19:29 ` netdev-bot+sinfo
@ 2026-09-29 20:12 ` Florian Fainelli
2026-09-29 21:09 ` Nicolai Buchwitz
2 siblings, 0 replies; 5+ messages in thread
From: Florian Fainelli @ 2026-09-29 20:12 UTC (permalink / raw)
To: Justin Chen, netdev
Cc: pabeni, kuba, edumazet, davem, andrew+netdev,
bcm-kernel-feedback-list, nb, opendmb
On 9/29/26 12:22, Justin Chen wrote:
> When the revised suspend/resume sequence was introduced this led to an edge
> case where the TX is left disabled in the following sequence.
>
> 1. phy link is down, so UMAC is held in reset and then network interface
> is WoL enabled
> 2. Enter suspend, bcmgenet_wol_power_down_cfg() enables UMAC_RX since MAC
> is in SW_RESET
> 4. Enter resume, UMAC_RX is left enabled. Since we only enable UMAC_TX
> and UMAC_RX in SW_RESET. The UMAC_TX is never enabled again on link up.
>
> Fixes: 254f3239dd07 ("net: bcmgenet: revise suspend/resume")
> Fixes: 88f6c8bf1aae ("net: bcmgenet: keep MAC in reset until PHY is up")
> Signed-off-by: Justin Chen <justin.chen@broadcom.com>
Excellent catch, thanks!
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH net] net: bcmgenet: if UMAC was suspended in SW_RESET, restore it to SW_RESET
2026-09-29 19:22 [PATCH net] net: bcmgenet: if UMAC was suspended in SW_RESET, restore it to SW_RESET Justin Chen
2026-09-29 19:29 ` netdev-bot+sinfo
2026-09-29 20:12 ` Florian Fainelli
@ 2026-09-29 21:09 ` Nicolai Buchwitz
2026-09-29 22:47 ` Justin Chen
2 siblings, 1 reply; 5+ messages in thread
From: Nicolai Buchwitz @ 2026-09-29 21:09 UTC (permalink / raw)
To: Justin Chen
Cc: netdev, pabeni, kuba, edumazet, davem, andrew+netdev,
bcm-kernel-feedback-list, florian.fainelli, opendmb
Hi Justin
On 29.9.2026 21:22, Justin Chen wrote:
> When the revised suspend/resume sequence was introduced this led to an
> edge
> case where the TX is left disabled in the following sequence.
>
> 1. phy link is down, so UMAC is held in reset and then network
> interface
> is WoL enabled
> 2. Enter suspend, bcmgenet_wol_power_down_cfg() enables UMAC_RX since
> MAC
> is in SW_RESET
> 4. Enter resume, UMAC_RX is left enabled. Since we only enable UMAC_TX
> and UMAC_RX in SW_RESET. The UMAC_TX is never enabled again on link
> up.
>
> Fixes: 254f3239dd07 ("net: bcmgenet: revise suspend/resume")
> Fixes: 88f6c8bf1aae ("net: bcmgenet: keep MAC in reset until PHY is
> up")
AFAIU before 254f3239dd07 resume always went through init_umac(), so
older
kernels shouldn't be affected. If we drop the tag for, it would save
some
backports to the older LTS kernels.
> Signed-off-by: Justin Chen <justin.chen@broadcom.com>
> ---
> drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
> b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
> index 96d5d4f7f51f..984432952963 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
> @@ -253,6 +253,17 @@ int bcmgenet_wol_power_up_cfg(struct bcmgenet_priv
> *priv,
> reg = bcmgenet_umac_readl(priv, UMAC_CMD);
> reg &= ~CMD_CRC_FWD;
> bcmgenet_umac_writel(priv, reg, UMAC_CMD);
> +
> + /*
> + * Mirror wol_power_down_cfg(). If only UMAC_RX
> + * is enabled, then we must place the UMAC back
> + * into SW_RESET.
> + */
> + reg = bcmgenet_umac_readl(priv, UMAC_CMD);
> + if ((reg & CMD_RX_EN) && !(reg & CMD_TX_EN)) {
> + reg |= CMD_SW_RESET;
> + bcmgenet_umac_writel(priv, reg, UMAC_CMD);
> + }
> spin_unlock_bh(&priv->reg_lock);
>
> /* Resume link status tracking */
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Thanks,
Nicolai
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH net] net: bcmgenet: if UMAC was suspended in SW_RESET, restore it to SW_RESET
2026-09-29 21:09 ` Nicolai Buchwitz
@ 2026-09-29 22:47 ` Justin Chen
0 siblings, 0 replies; 5+ messages in thread
From: Justin Chen @ 2026-09-29 22:47 UTC (permalink / raw)
To: Nicolai Buchwitz
Cc: netdev, pabeni, kuba, edumazet, davem, andrew+netdev,
bcm-kernel-feedback-list, florian.fainelli, opendmb
On 9/29/26 2:09 PM, Nicolai Buchwitz wrote:
> Hi Justin
>
> On 29.9.2026 21:22, Justin Chen wrote:
>> When the revised suspend/resume sequence was introduced this led to an
>> edge
>> case where the TX is left disabled in the following sequence.
>>
>> 1. phy link is down, so UMAC is held in reset and then network interface
>> is WoL enabled
>> 2. Enter suspend, bcmgenet_wol_power_down_cfg() enables UMAC_RX since MAC
>> is in SW_RESET
>> 4. Enter resume, UMAC_RX is left enabled. Since we only enable UMAC_TX
>> and UMAC_RX in SW_RESET. The UMAC_TX is never enabled again on link
>> up.
>>
>> Fixes: 254f3239dd07 ("net: bcmgenet: revise suspend/resume")
>> Fixes: 88f6c8bf1aae ("net: bcmgenet: keep MAC in reset until PHY is up")
>
> AFAIU before 254f3239dd07 resume always went through init_umac(), so older
> kernels shouldn't be affected. If we drop the tag for, it would save some
> backports to the older LTS kernels.
>
That's a good point. I will drop the 88f6c8bf1aae Fixes tag in v2.
Thanks,
Justin
>> Signed-off-by: Justin Chen <justin.chen@broadcom.com>
>> ---
>> drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c b/
>> drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
>> index 96d5d4f7f51f..984432952963 100644
>> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
>> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
>> @@ -253,6 +253,17 @@ int bcmgenet_wol_power_up_cfg(struct
>> bcmgenet_priv *priv,
>> reg = bcmgenet_umac_readl(priv, UMAC_CMD);
>> reg &= ~CMD_CRC_FWD;
>> bcmgenet_umac_writel(priv, reg, UMAC_CMD);
>> +
>> + /*
>> + * Mirror wol_power_down_cfg(). If only UMAC_RX
>> + * is enabled, then we must place the UMAC back
>> + * into SW_RESET.
>> + */
>> + reg = bcmgenet_umac_readl(priv, UMAC_CMD);
>> + if ((reg & CMD_RX_EN) && !(reg & CMD_TX_EN)) {
>> + reg |= CMD_SW_RESET;
>> + bcmgenet_umac_writel(priv, reg, UMAC_CMD);
>> + }
>> spin_unlock_bh(&priv->reg_lock);
>>
>> /* Resume link status tracking */
>
> Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
>
> Thanks,
> Nicolai
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-09-29 22:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-29 19:22 [PATCH net] net: bcmgenet: if UMAC was suspended in SW_RESET, restore it to SW_RESET Justin Chen
2026-09-29 19:29 ` netdev-bot+sinfo
2026-09-29 20:12 ` Florian Fainelli
2026-09-29 21:09 ` Nicolai Buchwitz
2026-09-29 22:47 ` Justin Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox