netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net] net: ethernet: mtk-star-emac: set mac_managed_pm when probing
@ 2024-07-08  6:52 Jian Hui Lee
  2024-07-10 21:56 ` Jacob Keller
  2024-07-11  8:31 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Jian Hui Lee @ 2024-07-08  6:52 UTC (permalink / raw)
  To: Felix Fietkau, Sean Wang, Mark Lee, Lorenzo Bianconi,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Matthias Brugger, AngeloGioacchino Del Regno, Florian Fainelli,
	netdev, linux-kernel, linux-arm-kernel, linux-mediatek

The below commit introduced a warning message when phy state is not in
the states: PHY_HALTED, PHY_READY, and PHY_UP.
commit 744d23c71af3 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state")

mtk-star-emac doesn't need mdiobus suspend/resume. To fix the warning
message during resume, indicate the phy resume/suspend is managed by the
mac when probing.

Fixes: 744d23c71af3 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state")
Signed-off-by: Jian Hui Lee <jianhui.lee@canonical.com>
---
v2: apply reverse x-mas tree order declaration

v1: https://lore.kernel.org/netdev/20240703061840.3137496-1-jianhui.lee@canonical.com/

 drivers/net/ethernet/mediatek/mtk_star_emac.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/mediatek/mtk_star_emac.c b/drivers/net/ethernet/mediatek/mtk_star_emac.c
index 31aebeb2e285..25989c79c92e 100644
--- a/drivers/net/ethernet/mediatek/mtk_star_emac.c
+++ b/drivers/net/ethernet/mediatek/mtk_star_emac.c
@@ -1524,6 +1524,7 @@ static int mtk_star_probe(struct platform_device *pdev)
 {
 	struct device_node *of_node;
 	struct mtk_star_priv *priv;
+	struct phy_device *phydev;
 	struct net_device *ndev;
 	struct device *dev;
 	void __iomem *base;
@@ -1649,6 +1650,12 @@ static int mtk_star_probe(struct platform_device *pdev)
 	netif_napi_add(ndev, &priv->rx_napi, mtk_star_rx_poll);
 	netif_napi_add_tx(ndev, &priv->tx_napi, mtk_star_tx_poll);
 
+	phydev = of_phy_find_device(priv->phy_node);
+	if (phydev) {
+		phydev->mac_managed_pm = true;
+		put_device(&phydev->mdio.dev);
+	}
+
 	return devm_register_netdev(dev, ndev);
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 net] net: ethernet: mtk-star-emac: set mac_managed_pm when probing
  2024-07-08  6:52 [PATCH v2 net] net: ethernet: mtk-star-emac: set mac_managed_pm when probing Jian Hui Lee
@ 2024-07-10 21:56 ` Jacob Keller
  2024-07-11  8:31 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Jacob Keller @ 2024-07-10 21:56 UTC (permalink / raw)
  To: Jian Hui Lee, Felix Fietkau, Sean Wang, Mark Lee,
	Lorenzo Bianconi, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Matthias Brugger, AngeloGioacchino Del Regno,
	Florian Fainelli, netdev, linux-kernel, linux-arm-kernel,
	linux-mediatek



On 7/7/2024 11:52 PM, Jian Hui Lee wrote:
> The below commit introduced a warning message when phy state is not in
> the states: PHY_HALTED, PHY_READY, and PHY_UP.
> commit 744d23c71af3 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state")
> 
> mtk-star-emac doesn't need mdiobus suspend/resume. To fix the warning
> message during resume, indicate the phy resume/suspend is managed by the
> mac when probing.
> 
> Fixes: 744d23c71af3 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state")
> Signed-off-by: Jian Hui Lee <jianhui.lee@canonical.com>
> ---
> v2: apply reverse x-mas tree order declaration
> 

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

> v1: https://lore.kernel.org/netdev/20240703061840.3137496-1-jianhui.lee@canonical.com/
> 
>  drivers/net/ethernet/mediatek/mtk_star_emac.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/ethernet/mediatek/mtk_star_emac.c b/drivers/net/ethernet/mediatek/mtk_star_emac.c
> index 31aebeb2e285..25989c79c92e 100644
> --- a/drivers/net/ethernet/mediatek/mtk_star_emac.c
> +++ b/drivers/net/ethernet/mediatek/mtk_star_emac.c
> @@ -1524,6 +1524,7 @@ static int mtk_star_probe(struct platform_device *pdev)
>  {
>  	struct device_node *of_node;
>  	struct mtk_star_priv *priv;
> +	struct phy_device *phydev;
>  	struct net_device *ndev;
>  	struct device *dev;
>  	void __iomem *base;
> @@ -1649,6 +1650,12 @@ static int mtk_star_probe(struct platform_device *pdev)
>  	netif_napi_add(ndev, &priv->rx_napi, mtk_star_rx_poll);
>  	netif_napi_add_tx(ndev, &priv->tx_napi, mtk_star_tx_poll);
>  
> +	phydev = of_phy_find_device(priv->phy_node);
> +	if (phydev) {
> +		phydev->mac_managed_pm = true;
> +		put_device(&phydev->mdio.dev);
> +	}
> +
>  	return devm_register_netdev(dev, ndev);
>  }
>  

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 net] net: ethernet: mtk-star-emac: set mac_managed_pm when probing
  2024-07-08  6:52 [PATCH v2 net] net: ethernet: mtk-star-emac: set mac_managed_pm when probing Jian Hui Lee
  2024-07-10 21:56 ` Jacob Keller
@ 2024-07-11  8:31 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-07-11  8:31 UTC (permalink / raw)
  To: Jian Hui Lee
  Cc: nbd, sean.wang, Mark-MC.Lee, lorenzo, davem, edumazet, kuba,
	pabeni, matthias.bgg, angelogioacchino.delregno, f.fainelli,
	netdev, linux-kernel, linux-arm-kernel, linux-mediatek

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Mon,  8 Jul 2024 14:52:09 +0800 you wrote:
> The below commit introduced a warning message when phy state is not in
> the states: PHY_HALTED, PHY_READY, and PHY_UP.
> commit 744d23c71af3 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state")
> 
> mtk-star-emac doesn't need mdiobus suspend/resume. To fix the warning
> message during resume, indicate the phy resume/suspend is managed by the
> mac when probing.
> 
> [...]

Here is the summary with links:
  - [v2,net] net: ethernet: mtk-star-emac: set mac_managed_pm when probing
    https://git.kernel.org/netdev/net/c/8c6790b5c25d

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] 3+ messages in thread

end of thread, other threads:[~2024-07-11  8:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-08  6:52 [PATCH v2 net] net: ethernet: mtk-star-emac: set mac_managed_pm when probing Jian Hui Lee
2024-07-10 21:56 ` Jacob Keller
2024-07-11  8:31 ` 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).