Skip to content

Commit 80f8dea

Browse files
ffainellidavem330
authored andcommitted
net: systemport: Restore Broadcom tag match filters upon resume
Some of the system suspend states that we support wipe out entirely the HW contents. If we had a Wake-on-LAN filter programmed prior to going into suspend, but we did not actually wake-up from Wake-on-LAN and instead used a deeper suspend state, make sure we restore the CID number that we need to match against. Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1c60c7f commit 80f8dea

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

drivers/net/ethernet/broadcom/bcmsysport.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,7 @@ static void mpd_enable_set(struct bcm_sysport_priv *priv, bool enable)
10681068

10691069
static void bcm_sysport_resume_from_wol(struct bcm_sysport_priv *priv)
10701070
{
1071+
unsigned int index;
10711072
u32 reg;
10721073

10731074
/* Disable RXCHK, active filters and Broadcom tag matching */
@@ -1076,6 +1077,15 @@ static void bcm_sysport_resume_from_wol(struct bcm_sysport_priv *priv)
10761077
RXCHK_BRCM_TAG_MATCH_SHIFT | RXCHK_EN | RXCHK_BRCM_TAG_EN);
10771078
rxchk_writel(priv, reg, RXCHK_CONTROL);
10781079

1080+
/* Make sure we restore correct CID index in case HW lost
1081+
* its context during deep idle state
1082+
*/
1083+
for_each_set_bit(index, priv->filters, RXCHK_BRCM_TAG_MAX) {
1084+
rxchk_writel(priv, priv->filters_loc[index] <<
1085+
RXCHK_BRCM_TAG_CID_SHIFT, RXCHK_BRCM_TAG(index));
1086+
rxchk_writel(priv, 0xff00ffff, RXCHK_BRCM_TAG_MASK(index));
1087+
}
1088+
10791089
/* Clear the MagicPacket detection logic */
10801090
mpd_enable_set(priv, false);
10811091

@@ -2189,6 +2199,7 @@ static int bcm_sysport_rule_set(struct bcm_sysport_priv *priv,
21892199
rxchk_writel(priv, reg, RXCHK_BRCM_TAG(index));
21902200
rxchk_writel(priv, 0xff00ffff, RXCHK_BRCM_TAG_MASK(index));
21912201

2202+
priv->filters_loc[index] = nfc->fs.location;
21922203
set_bit(index, priv->filters);
21932204

21942205
return 0;
@@ -2208,6 +2219,7 @@ static int bcm_sysport_rule_del(struct bcm_sysport_priv *priv,
22082219
* be taken care of during suspend time by bcm_sysport_suspend_to_wol
22092220
*/
22102221
clear_bit(index, priv->filters);
2222+
priv->filters_loc[index] = 0;
22112223

22122224
return 0;
22132225
}

drivers/net/ethernet/broadcom/bcmsysport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,7 @@ struct bcm_sysport_priv {
786786
/* Ethtool */
787787
u32 msg_enable;
788788
DECLARE_BITMAP(filters, RXCHK_BRCM_TAG_MAX);
789+
u32 filters_loc[RXCHK_BRCM_TAG_MAX];
789790

790791
struct bcm_sysport_stats64 stats64;
791792

0 commit comments

Comments
 (0)