linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] net: ethernet: hisilicon: set dev->dev.parent before PHY connect
@ 2016-12-12 12:03 Dongpo Li
  2016-12-12 12:03 ` [PATCH 1/2] net: ethernet: hisi_femac: Call SET_NETDEV_DEV() Dongpo Li
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Dongpo Li @ 2016-12-12 12:03 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem
  Cc: f.fainelli, xuejiancheng, benjamin.chenhao, caizhiyong, netdev,
	linux-kernel, Dongpo Li

This patch series builds atop:
ec988ad78ed6d184a7f4ca6b8e962b0e8f1de461 ("phy: Don't increment MDIO bus
refcount unless it's a different owner")

I have checked all the hisilicon ethernet driver and found only two drivers
need to be fixed to make sure set dev->dev.parent before PHY connect.

Dongpo Li (2):
  net: ethernet: hisi_femac: Call SET_NETDEV_DEV()
  net: ethernet: hip04: Call SET_NETDEV_DEV()

 drivers/net/ethernet/hisilicon/hip04_eth.c  | 2 +-
 drivers/net/ethernet/hisilicon/hisi_femac.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.8.2

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

* [PATCH 1/2] net: ethernet: hisi_femac: Call SET_NETDEV_DEV()
  2016-12-12 12:03 [PATCH 0/2] net: ethernet: hisilicon: set dev->dev.parent before PHY connect Dongpo Li
@ 2016-12-12 12:03 ` Dongpo Li
  2016-12-12 16:28   ` Florian Fainelli
  2016-12-12 12:03 ` [PATCH 2/2] net: ethernet: hip04: " Dongpo Li
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Dongpo Li @ 2016-12-12 12:03 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem
  Cc: f.fainelli, xuejiancheng, benjamin.chenhao, caizhiyong, netdev,
	linux-kernel, Dongpo Li

The hisi_femac driver calls into PHYLIB which now checks for
net_device->dev.parent, so make sure we do set it before calling into
any MDIO/PHYLIB related function.

Fixes: ec988ad78ed6 ("phy: Don't increment MDIO bus refcount unless it's a different owner")
Signed-off-by: Dongpo Li <lidongpo@hisilicon.com>
---
 drivers/net/ethernet/hisilicon/hisi_femac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hisi_femac.c b/drivers/net/ethernet/hisilicon/hisi_femac.c
index 4986306..979852d 100644
--- a/drivers/net/ethernet/hisilicon/hisi_femac.c
+++ b/drivers/net/ethernet/hisilicon/hisi_femac.c
@@ -805,6 +805,7 @@ static int hisi_femac_drv_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	platform_set_drvdata(pdev, ndev);
+	SET_NETDEV_DEV(ndev, &pdev->dev);
 
 	priv = netdev_priv(ndev);
 	priv->dev = dev;
@@ -882,7 +883,6 @@ static int hisi_femac_drv_probe(struct platform_device *pdev)
 	ndev->netdev_ops = &hisi_femac_netdev_ops;
 	ndev->ethtool_ops = &hisi_femac_ethtools_ops;
 	netif_napi_add(ndev, &priv->napi, hisi_femac_poll, FEMAC_POLL_WEIGHT);
-	SET_NETDEV_DEV(ndev, &pdev->dev);
 
 	hisi_femac_port_init(priv);
 
-- 
2.8.2

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

* [PATCH 2/2] net: ethernet: hip04: Call SET_NETDEV_DEV()
  2016-12-12 12:03 [PATCH 0/2] net: ethernet: hisilicon: set dev->dev.parent before PHY connect Dongpo Li
  2016-12-12 12:03 ` [PATCH 1/2] net: ethernet: hisi_femac: Call SET_NETDEV_DEV() Dongpo Li
@ 2016-12-12 12:03 ` Dongpo Li
  2016-12-12 16:28   ` Florian Fainelli
  2016-12-12 16:29 ` [PATCH 0/2] net: ethernet: hisilicon: set dev->dev.parent before PHY connect Florian Fainelli
  2016-12-16 18:30 ` David Miller
  3 siblings, 1 reply; 7+ messages in thread
From: Dongpo Li @ 2016-12-12 12:03 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem
  Cc: f.fainelli, xuejiancheng, benjamin.chenhao, caizhiyong, netdev,
	linux-kernel, Dongpo Li

The hip04 driver calls into PHYLIB which now checks for
net_device->dev.parent, so make sure we do set it before calling into
any MDIO/PHYLIB related function.

Fixes: ec988ad78ed6 ("phy: Don't increment MDIO bus refcount unless it's a different owner")
Signed-off-by: Dongpo Li <lidongpo@hisilicon.com>
---
 drivers/net/ethernet/hisilicon/hip04_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c
index 854befd..97b1847 100644
--- a/drivers/net/ethernet/hisilicon/hip04_eth.c
+++ b/drivers/net/ethernet/hisilicon/hip04_eth.c
@@ -828,6 +828,7 @@ static int hip04_mac_probe(struct platform_device *pdev)
 	priv = netdev_priv(ndev);
 	priv->ndev = ndev;
 	platform_set_drvdata(pdev, ndev);
+	SET_NETDEV_DEV(ndev, &pdev->dev);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	priv->base = devm_ioremap_resource(d, res);
@@ -903,7 +904,6 @@ static int hip04_mac_probe(struct platform_device *pdev)
 	ndev->priv_flags |= IFF_UNICAST_FLT;
 	ndev->irq = irq;
 	netif_napi_add(ndev, &priv->napi, hip04_rx_poll, NAPI_POLL_WEIGHT);
-	SET_NETDEV_DEV(ndev, &pdev->dev);
 
 	hip04_reset_ppe(priv);
 	if (priv->phy_mode == PHY_INTERFACE_MODE_MII)
-- 
2.8.2

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

* Re: [PATCH 1/2] net: ethernet: hisi_femac: Call SET_NETDEV_DEV()
  2016-12-12 12:03 ` [PATCH 1/2] net: ethernet: hisi_femac: Call SET_NETDEV_DEV() Dongpo Li
@ 2016-12-12 16:28   ` Florian Fainelli
  0 siblings, 0 replies; 7+ messages in thread
From: Florian Fainelli @ 2016-12-12 16:28 UTC (permalink / raw)
  To: Dongpo Li, yisen.zhuang, salil.mehta, davem
  Cc: xuejiancheng, benjamin.chenhao, caizhiyong, netdev, linux-kernel

On 12/12/2016 04:03 AM, Dongpo Li wrote:
> The hisi_femac driver calls into PHYLIB which now checks for
> net_device->dev.parent, so make sure we do set it before calling into
> any MDIO/PHYLIB related function.
> 
> Fixes: ec988ad78ed6 ("phy: Don't increment MDIO bus refcount unless it's a different owner")
> Signed-off-by: Dongpo Li <lidongpo@hisilicon.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

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

* Re: [PATCH 2/2] net: ethernet: hip04: Call SET_NETDEV_DEV()
  2016-12-12 12:03 ` [PATCH 2/2] net: ethernet: hip04: " Dongpo Li
@ 2016-12-12 16:28   ` Florian Fainelli
  0 siblings, 0 replies; 7+ messages in thread
From: Florian Fainelli @ 2016-12-12 16:28 UTC (permalink / raw)
  To: Dongpo Li, yisen.zhuang, salil.mehta, davem
  Cc: xuejiancheng, benjamin.chenhao, caizhiyong, netdev, linux-kernel

On 12/12/2016 04:03 AM, Dongpo Li wrote:
> The hip04 driver calls into PHYLIB which now checks for
> net_device->dev.parent, so make sure we do set it before calling into
> any MDIO/PHYLIB related function.
> 
> Fixes: ec988ad78ed6 ("phy: Don't increment MDIO bus refcount unless it's a different owner")
> Signed-off-by: Dongpo Li <lidongpo@hisilicon.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

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

* Re: [PATCH 0/2] net: ethernet: hisilicon: set dev->dev.parent before PHY connect
  2016-12-12 12:03 [PATCH 0/2] net: ethernet: hisilicon: set dev->dev.parent before PHY connect Dongpo Li
  2016-12-12 12:03 ` [PATCH 1/2] net: ethernet: hisi_femac: Call SET_NETDEV_DEV() Dongpo Li
  2016-12-12 12:03 ` [PATCH 2/2] net: ethernet: hip04: " Dongpo Li
@ 2016-12-12 16:29 ` Florian Fainelli
  2016-12-16 18:30 ` David Miller
  3 siblings, 0 replies; 7+ messages in thread
From: Florian Fainelli @ 2016-12-12 16:29 UTC (permalink / raw)
  To: Dongpo Li, yisen.zhuang, salil.mehta, davem
  Cc: xuejiancheng, benjamin.chenhao, caizhiyong, netdev, linux-kernel

On 12/12/2016 04:03 AM, Dongpo Li wrote:
> This patch series builds atop:
> ec988ad78ed6d184a7f4ca6b8e962b0e8f1de461 ("phy: Don't increment MDIO bus
> refcount unless it's a different owner")
> 
> I have checked all the hisilicon ethernet driver and found only two drivers
> need to be fixed to make sure set dev->dev.parent before PHY connect.

Thanks for doing this, these two drivers did not show up on my list
because I did not see them calling SET_NETDEV_DEV() so late.
-- 
Florian

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

* Re: [PATCH 0/2] net: ethernet: hisilicon: set dev->dev.parent before PHY connect
  2016-12-12 12:03 [PATCH 0/2] net: ethernet: hisilicon: set dev->dev.parent before PHY connect Dongpo Li
                   ` (2 preceding siblings ...)
  2016-12-12 16:29 ` [PATCH 0/2] net: ethernet: hisilicon: set dev->dev.parent before PHY connect Florian Fainelli
@ 2016-12-16 18:30 ` David Miller
  3 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2016-12-16 18:30 UTC (permalink / raw)
  To: lidongpo
  Cc: yisen.zhuang, salil.mehta, f.fainelli, xuejiancheng,
	benjamin.chenhao, caizhiyong, netdev, linux-kernel

From: Dongpo Li <lidongpo@hisilicon.com>
Date: Mon, 12 Dec 2016 20:03:41 +0800

> This patch series builds atop:
> ec988ad78ed6d184a7f4ca6b8e962b0e8f1de461 ("phy: Don't increment MDIO bus
> refcount unless it's a different owner")
> 
> I have checked all the hisilicon ethernet driver and found only two drivers
> need to be fixed to make sure set dev->dev.parent before PHY connect.

Series applied, thanks.

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

end of thread, other threads:[~2016-12-16 18:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-12 12:03 [PATCH 0/2] net: ethernet: hisilicon: set dev->dev.parent before PHY connect Dongpo Li
2016-12-12 12:03 ` [PATCH 1/2] net: ethernet: hisi_femac: Call SET_NETDEV_DEV() Dongpo Li
2016-12-12 16:28   ` Florian Fainelli
2016-12-12 12:03 ` [PATCH 2/2] net: ethernet: hip04: " Dongpo Li
2016-12-12 16:28   ` Florian Fainelli
2016-12-12 16:29 ` [PATCH 0/2] net: ethernet: hisilicon: set dev->dev.parent before PHY connect Florian Fainelli
2016-12-16 18:30 ` David Miller

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).