[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251104221348.4163417-3-florian.fainelli@broadcom.com>
Date: Tue, 4 Nov 2025 14:13:48 -0800
From: Florian Fainelli <florian.fainelli@...adcom.com>
To: netdev@...r.kernel.org
Cc: bcm-kernel-feedback-list@...adcom.com,
Florian Fainelli <florian.fainelli@...adcom.com>,
Doug Berger <opendmb@...il.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>,
Stanislav Fomichev <sdf@...ichev.me>,
Antoine Tenart <atenart@...nel.org>,
Kuniyuki Iwashima <kuniyu@...gle.com>,
Yajun Deng <yajun.deng@...ux.dev>,
linux-kernel@...r.kernel.org (open list)
Subject: [PATCH net-next v2 2/2] net: bcmgenet: Add support for set_pauseparam_panic
Avoid making sleeping calls that would in not being able to complete the
MMIO writes ignoring pause frame reception and generation at the
Ethernet MAC controller level.
Signed-off-by: Florian Fainelli <florian.fainelli@...adcom.com>
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 8 ++++++++
drivers/net/ethernet/broadcom/genet/bcmgenet.h | 1 +
drivers/net/ethernet/broadcom/genet/bcmmii.c | 10 ++++++++++
3 files changed, 19 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index d99ef92feb82..323bf119c2af 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -966,6 +966,13 @@ static int bcmgenet_set_pauseparam(struct net_device *dev,
return 0;
}
+static void bcmgenet_set_pauseparam_panic(struct net_device *dev)
+{
+ struct bcmgenet_priv *priv = netdev_priv(dev);
+
+ bcmgenet_set_pause_panic(priv);
+}
+
/* standard ethtool support functions. */
enum bcmgenet_stat_type {
BCMGENET_STAT_RTNL = -1,
@@ -1702,6 +1709,7 @@ static const struct ethtool_ops bcmgenet_ethtool_ops = {
.set_rxnfc = bcmgenet_set_rxnfc,
.get_pauseparam = bcmgenet_get_pauseparam,
.set_pauseparam = bcmgenet_set_pauseparam,
+ .set_pauseparam_panic = bcmgenet_set_pauseparam_panic,
};
/* Power down the unimac, based on mode. */
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.h b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
index 5ec3979779ec..faf0d2406e9a 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
@@ -738,6 +738,7 @@ int bcmgenet_mii_config(struct net_device *dev, bool init);
int bcmgenet_mii_probe(struct net_device *dev);
void bcmgenet_mii_exit(struct net_device *dev);
void bcmgenet_phy_pause_set(struct net_device *dev, bool rx, bool tx);
+void bcmgenet_set_pause_panic(struct bcmgenet_priv *priv);
void bcmgenet_phy_power_set(struct net_device *dev, bool enable);
void bcmgenet_mii_setup(struct net_device *dev);
diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
index 38f854b94a79..a9a1d06032fa 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
@@ -147,6 +147,16 @@ void bcmgenet_phy_pause_set(struct net_device *dev, bool rx, bool tx)
mutex_unlock(&phydev->lock);
}
+void bcmgenet_set_pause_panic(struct bcmgenet_priv *priv)
+{
+ u32 reg;
+
+ /* Disable pause frame generation and reception */
+ reg = bcmgenet_umac_readl(priv, UMAC_CMD);
+ reg |= CMD_RX_PAUSE_IGNORE | CMD_TX_PAUSE_IGNORE;
+ bcmgenet_umac_writel(priv, reg, UMAC_CMD);
+}
+
void bcmgenet_phy_power_set(struct net_device *dev, bool enable)
{
struct bcmgenet_priv *priv = netdev_priv(dev);
--
2.34.1
Powered by blists - more mailing lists