* [PATCH net 0/2] net: fixes for stmmac
@ 2021-05-20 12:51 Joakim Zhang
2021-05-20 12:51 ` [PATCH net 1/2] net: stmmac: correct clocks enabled in stmmac_vlan_rx_kill_vid() Joakim Zhang
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Joakim Zhang @ 2021-05-20 12:51 UTC (permalink / raw)
To: peppe.cavallaro, alexandre.torgue, joabreu, davem, kuba,
mcoquelin.stm32, andrew
Cc: netdev, linux-stm32, linux-arm-kernel, linux-kernel, linux-imx
Two clock fixes for stmmac driver.
Joakim Zhang (2):
net: stmmac: correct clocks enabled in stmmac_vlan_rx_kill_vid()
net: stmmac: fix system hang if change mac address after interface
ifdown
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 23 +++++++++++++------
1 file changed, 16 insertions(+), 7 deletions(-)
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net 1/2] net: stmmac: correct clocks enabled in stmmac_vlan_rx_kill_vid()
2021-05-20 12:51 [PATCH net 0/2] net: fixes for stmmac Joakim Zhang
@ 2021-05-20 12:51 ` Joakim Zhang
2021-05-20 12:51 ` [PATCH net 2/2] net: stmmac: fix system hang if change mac address after interface ifdown Joakim Zhang
2021-05-20 23:00 ` [PATCH net 0/2] net: fixes for stmmac patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Joakim Zhang @ 2021-05-20 12:51 UTC (permalink / raw)
To: peppe.cavallaro, alexandre.torgue, joabreu, davem, kuba,
mcoquelin.stm32, andrew
Cc: netdev, linux-stm32, linux-arm-kernel, linux-kernel, linux-imx
This should be a mistake to fix conflicts when removing RFC tag to
repost the patch.
Fixes: 5ec55823438e ("net: stmmac: add clocks management for gmac driver")
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index fea3bf07ae89..df4ce5977fad 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -6191,12 +6191,6 @@ static int stmmac_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid
bool is_double = false;
int ret;
- ret = pm_runtime_get_sync(priv->device);
- if (ret < 0) {
- pm_runtime_put_noidle(priv->device);
- return ret;
- }
-
if (be16_to_cpu(proto) == ETH_P_8021AD)
is_double = true;
@@ -6222,6 +6216,12 @@ static int stmmac_vlan_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vi
bool is_double = false;
int ret;
+ ret = pm_runtime_get_sync(priv->device);
+ if (ret < 0) {
+ pm_runtime_put_noidle(priv->device);
+ return ret;
+ }
+
if (be16_to_cpu(proto) == ETH_P_8021AD)
is_double = true;
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net 2/2] net: stmmac: fix system hang if change mac address after interface ifdown
2021-05-20 12:51 [PATCH net 0/2] net: fixes for stmmac Joakim Zhang
2021-05-20 12:51 ` [PATCH net 1/2] net: stmmac: correct clocks enabled in stmmac_vlan_rx_kill_vid() Joakim Zhang
@ 2021-05-20 12:51 ` Joakim Zhang
2021-05-20 23:00 ` [PATCH net 0/2] net: fixes for stmmac patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Joakim Zhang @ 2021-05-20 12:51 UTC (permalink / raw)
To: peppe.cavallaro, alexandre.torgue, joabreu, davem, kuba,
mcoquelin.stm32, andrew
Cc: netdev, linux-stm32, linux-arm-kernel, linux-kernel, linux-imx
Fix system hang with below sequences:
~# ifconfig ethx down
~# ifconfig ethx hw ether xx:xx:xx:xx:xx:xx
After ethx down, stmmac all clocks gated off and then register access causes
system hang.
Fixes: 5ec55823438e ("net: stmmac: add clocks management for gmac driver")
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index df4ce5977fad..5d956a553434 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5891,12 +5891,21 @@ static int stmmac_set_mac_address(struct net_device *ndev, void *addr)
struct stmmac_priv *priv = netdev_priv(ndev);
int ret = 0;
+ ret = pm_runtime_get_sync(priv->device);
+ if (ret < 0) {
+ pm_runtime_put_noidle(priv->device);
+ return ret;
+ }
+
ret = eth_mac_addr(ndev, addr);
if (ret)
- return ret;
+ goto set_mac_error;
stmmac_set_umac_addr(priv, priv->hw, ndev->dev_addr, 0);
+set_mac_error:
+ pm_runtime_put(priv->device);
+
return ret;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net 0/2] net: fixes for stmmac
2021-05-20 12:51 [PATCH net 0/2] net: fixes for stmmac Joakim Zhang
2021-05-20 12:51 ` [PATCH net 1/2] net: stmmac: correct clocks enabled in stmmac_vlan_rx_kill_vid() Joakim Zhang
2021-05-20 12:51 ` [PATCH net 2/2] net: stmmac: fix system hang if change mac address after interface ifdown Joakim Zhang
@ 2021-05-20 23:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-20 23:00 UTC (permalink / raw)
To: Joakim Zhang
Cc: peppe.cavallaro, alexandre.torgue, joabreu, davem, kuba,
mcoquelin.stm32, andrew, netdev, linux-stm32, linux-arm-kernel,
linux-kernel, linux-imx
Hello:
This series was applied to netdev/net.git (refs/heads/master):
On Thu, 20 May 2021 20:51:15 +0800 you wrote:
> Two clock fixes for stmmac driver.
>
> Joakim Zhang (2):
> net: stmmac: correct clocks enabled in stmmac_vlan_rx_kill_vid()
> net: stmmac: fix system hang if change mac address after interface
> ifdown
>
> [...]
Here is the summary with links:
- [net,1/2] net: stmmac: correct clocks enabled in stmmac_vlan_rx_kill_vid()
https://git.kernel.org/netdev/net/c/b3dcb3127786
- [net,2/2] net: stmmac: fix system hang if change mac address after interface ifdown
https://git.kernel.org/netdev/net/c/4691ffb18ac9
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-05-20 23:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20 12:51 [PATCH net 0/2] net: fixes for stmmac Joakim Zhang
2021-05-20 12:51 ` [PATCH net 1/2] net: stmmac: correct clocks enabled in stmmac_vlan_rx_kill_vid() Joakim Zhang
2021-05-20 12:51 ` [PATCH net 2/2] net: stmmac: fix system hang if change mac address after interface ifdown Joakim Zhang
2021-05-20 23:00 ` [PATCH net 0/2] net: fixes for stmmac patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).