Skip to contentSkip to conversation

net: macb: restore cmp registers on resume path

PATCH Applied Claudiu Beznea 3 participants 3 messages Apr 2, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: macb: restore cmp registers on resume path

Restore CMP screener registers on resume path.

Fixes c1e85c6ce57ef ("net: macb: save/restore the remaining registers and features")
---
 drivers/net/ethernet/cadence/macb_main.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/net/ethernet/cadence/macb_main.c +7 -0
index f56f3dbbc015..ffd56a23f8b0 100644
@@ -3269,6 +3269,9 @@ static void gem_prog_cmp_regs(struct macb *bp, struct ethtool_rx_flow_spec *fs)
 	bool cmp_b = false;
 	bool cmp_c = false;
 
+	if (!macb_is_gem(bp))
+		return;
+
 	tp4sp_v = &(fs->h_u.tcp_ip4_spec);
 	tp4sp_m = &(fs->m_u.tcp_ip4_spec);
 
@@ -3637,6 +3640,7 @@ static void macb_restore_features(struct macb *bp)
 {
 	struct net_device *netdev = bp->dev;
 	netdev_features_t features = netdev->features;
+	struct ethtool_rx_fs_item *item;
 
 	/* TX checksum offload */
 	macb_set_txcsum_feature(bp, features);
@@ -3645,6 +3649,9 @@ static void macb_restore_features(struct macb *bp)
 	macb_set_rxcsum_feature(bp, features);
 
 	/* RX Flow Filters */
+	list_for_each_entry(item, &bp->rx_fs_list.list, list)
+		gem_prog_cmp_regs(bp, &item->fs);
+
 	macb_set_rxflow_feature(bp, features);
 }
 
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Claudiu Beznea

Restore CMP screener registers on resume path.

Fixes c1e85c6ce57ef ("net: macb: save/restore the remaining registers and features")

Thanks for this fix Claudiu. Best regards,
Nicolas

Quoted 37 lines
---
  drivers/net/ethernet/cadence/macb_main.c | 7 +++++++
  1 file changed, 7 insertions(+)
drivers/net/ethernet/cadence/macb_main.c +7 -0
index f56f3dbbc015..ffd56a23f8b0 100644
@@ -3269,6 +3269,9 @@ static void gem_prog_cmp_regs(struct macb *bp, struct ethtool_rx_flow_spec *fs)
  	bool cmp_b = false;
  	bool cmp_c = false;
 
+	if (!macb_is_gem(bp))
+		return;
+
  	tp4sp_v = &(fs->h_u.tcp_ip4_spec);
  	tp4sp_m = &(fs->m_u.tcp_ip4_spec);
 
@@ -3637,6 +3640,7 @@ static void macb_restore_features(struct macb *bp)
  {
  	struct net_device *netdev = bp->dev;
  	netdev_features_t features = netdev->features;
+	struct ethtool_rx_fs_item *item;
 
  	/* TX checksum offload */
  	macb_set_txcsum_feature(bp, features);
@@ -3645,6 +3649,9 @@ static void macb_restore_features(struct macb *bp)
  	macb_set_rxcsum_feature(bp, features);
 
  	/* RX Flow Filters */
+	list_for_each_entry(item, &bp->rx_fs_list.list, list)
+		gem_prog_cmp_regs(bp, &item->fs);
+
  	macb_set_rxflow_feature(bp, features);
  }
 
Signature · 1 line
Nicolas Ferre
#2 lore raw
In reply to Claudiu Beznea
This patch was applied to netdev/net.git (refs/heads/master):

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

Quoted 7 lines · On Fri, 2 Apr 2021 15:42:53 +0300 you wrote:

Restore CMP screener registers on resume path.

Fixes c1e85c6ce57ef ("net: macb: save/restore the remaining registers and features")
---
 drivers/net/ethernet/cadence/macb_main.c | 7 +++++++
 1 file changed, 7 insertions(+)

Here is the summary with links:
- [1/1] net: macb: restore cmp registers on resume path

    https://git.kernel.org/netdev/net/c/a14d273ba159

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html