bcmgenet_wol_power_down_cfg() forces CMD_CRC_FWD on so that the UniMAC can match magic packets, and bcmgenet_wol_power_up_cfg() unconditionally turns it back off and clears priv->crc_fwd_en. That is fine as long as the driver never forwards the FCS on its own, but a following change makes this depend on NETIF_F_RXFCS. On a successful WoL exit bcmgenet_resume() does not re-apply the features, so clearing the state here would silently drop the user's setting. Derive priv->crc_fwd_en from dev->features when leaving WoL and only clear CMD_CRC_FWD when the FCS is not wanted. Since NETIF_F_RXFCS is not advertised yet, there is no functional change. Signed-off-by: Florian Fainelli --- drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c index 984432952963..ff34c4df4f4a 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c @@ -223,7 +223,8 @@ int bcmgenet_wol_power_up_cfg(struct bcmgenet_priv *priv, } clk_disable_unprepare(priv->clk_wol); - priv->crc_fwd_en = 0; + /* Keep forwarding the FCS if the user asked for it */ + priv->crc_fwd_en = !!(dev->features & NETIF_F_RXFCS); bcmgenet_intrl2_0_writel(priv, UMAC_IRQ_WAKE_EVENT, INTRL2_CPU_MASK_SET); @@ -248,10 +249,11 @@ int bcmgenet_wol_power_up_cfg(struct bcmgenet_priv *priv, reg &= ~RBUF_ACPI_EN; bcmgenet_hfb_reg_writel(priv, reg, HFB_CTRL); - /* Disable CRC Forward */ + /* Disable CRC Forward unless NETIF_F_RXFCS needs it */ spin_lock_bh(&priv->reg_lock); reg = bcmgenet_umac_readl(priv, UMAC_CMD); - reg &= ~CMD_CRC_FWD; + if (!priv->crc_fwd_en) + reg &= ~CMD_CRC_FWD; bcmgenet_umac_writel(priv, reg, UMAC_CMD); /* -- 2.56.1