Skip to content

Commit

Permalink
Merge branch 'bcmasp-fixes'
Browse files Browse the repository at this point in the history
Justin Chen says:

====================
net: bcmasp: bug fixes for bcmasp

Fix two bugs.

- Indicate that PM is managed by mac to prevent double pm calls. This
  doesn't lead to a crash, but waste a noticable amount of time
  suspending/resuming.

- Sanity check for OOB write was off by one. Leading to a false error
  when using the full array.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Feb 18, 2024
2 parents 398b7c3 + f120e62 commit ee710bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/ethernet/broadcom/asp2/bcmasp.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,6 @@ int bcmasp_netfilt_get_all_active(struct bcmasp_intf *intf, u32 *rule_locs,
int j = 0, i;

for (i = 0; i < NUM_NET_FILTERS; i++) {
if (j == *rule_cnt)
return -EMSGSIZE;

if (!priv->net_filters[i].claimed ||
priv->net_filters[i].port != intf->port)
continue;
Expand All @@ -547,6 +544,9 @@ int bcmasp_netfilt_get_all_active(struct bcmasp_intf *intf, u32 *rule_locs,
priv->net_filters[i - 1].wake_filter)
continue;

if (j == *rule_cnt)
return -EMSGSIZE;

rule_locs[j++] = priv->net_filters[i].fs.location;
}

Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,9 @@ static int bcmasp_netif_init(struct net_device *dev, bool phy_connect)
netdev_err(dev, "could not attach to PHY\n");
goto err_phy_disable;
}

/* Indicate that the MAC is responsible for PHY PM */
phydev->mac_managed_pm = true;
} else if (!intf->wolopts) {
ret = phy_resume(dev->phydev);
if (ret)
Expand Down

0 comments on commit ee710bb

Please sign in to comment.