Commit 12915174 authored by David S. Miller's avatar David S. Miller

Merge branch 'bcmgenet-WAKE_FILTER'

Doug Berger says:

====================
net: bcmgenet: fix WAKE_FILTER resume from deep sleep

The WAKE_FILTER logic can only wake the system from the standby
power state. However, some systems that include the GENET IP
support deeper power saving states and the driver should suspend
and resume correctly from those states as well.

This commit set squashes a few issues uncovered while testing
suspend and resume from these deep sleep states.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents aba69d49 a8c64542
...@@ -696,7 +696,6 @@ struct bcmgenet_priv { ...@@ -696,7 +696,6 @@ struct bcmgenet_priv {
u32 wolopts; u32 wolopts;
u8 sopass[SOPASS_MAX]; u8 sopass[SOPASS_MAX];
bool wol_active; bool wol_active;
u32 hfb_en[3];
struct bcmgenet_mib_counters mib; struct bcmgenet_mib_counters mib;
......
...@@ -217,20 +217,28 @@ void bcmgenet_wol_power_up_cfg(struct bcmgenet_priv *priv, ...@@ -217,20 +217,28 @@ void bcmgenet_wol_power_up_cfg(struct bcmgenet_priv *priv,
priv->wol_active = 0; priv->wol_active = 0;
clk_disable_unprepare(priv->clk_wol); clk_disable_unprepare(priv->clk_wol);
priv->crc_fwd_en = 0;
/* Disable Magic Packet Detection */ /* Disable Magic Packet Detection */
reg = bcmgenet_umac_readl(priv, UMAC_MPD_CTRL); if (priv->wolopts & (WAKE_MAGIC | WAKE_MAGICSECURE)) {
reg &= ~(MPD_EN | MPD_PW_EN); reg = bcmgenet_umac_readl(priv, UMAC_MPD_CTRL);
bcmgenet_umac_writel(priv, reg, UMAC_MPD_CTRL); if (!(reg & MPD_EN))
return; /* already reset so skip the rest */
reg &= ~(MPD_EN | MPD_PW_EN);
bcmgenet_umac_writel(priv, reg, UMAC_MPD_CTRL);
}
/* Disable WAKE_FILTER Detection */ /* Disable WAKE_FILTER Detection */
reg = bcmgenet_hfb_reg_readl(priv, HFB_CTRL); if (priv->wolopts & WAKE_FILTER) {
reg &= ~(RBUF_HFB_EN | RBUF_ACPI_EN); reg = bcmgenet_hfb_reg_readl(priv, HFB_CTRL);
bcmgenet_hfb_reg_writel(priv, reg, HFB_CTRL); if (!(reg & RBUF_ACPI_EN))
return; /* already reset so skip the rest */
reg &= ~(RBUF_HFB_EN | RBUF_ACPI_EN);
bcmgenet_hfb_reg_writel(priv, reg, HFB_CTRL);
}
/* Disable CRC Forward */ /* Disable CRC Forward */
reg = bcmgenet_umac_readl(priv, UMAC_CMD); reg = bcmgenet_umac_readl(priv, UMAC_CMD);
reg &= ~CMD_CRC_FWD; reg &= ~CMD_CRC_FWD;
bcmgenet_umac_writel(priv, reg, UMAC_CMD); bcmgenet_umac_writel(priv, reg, UMAC_CMD);
priv->crc_fwd_en = 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment