All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 RESEND] net: phy: call phy_disable_interrupts() in phy_attach_direct() instead
@ 2020-09-09  5:43 Yoshihiro Shimoda
  2020-09-10 19:57 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Yoshihiro Shimoda @ 2020-09-09  5:43 UTC (permalink / raw)
  To: andrew, hkallweit1, linux, davem, kuba, Jisheng.Zhang
  Cc: netdev, linux-renesas-soc, Yoshihiro Shimoda

Since the micrel phy driver calls phy_init_hw() as a workaround,
the commit 9886a4dbd2aa ("net: phy: call phy_disable_interrupts()
in phy_init_hw()") disables the interrupt unexpectedly. So,
call phy_disable_interrupts() in phy_attach_direct() instead.
Otherwise, the phy cannot link up after the ethernet cable was
disconnected.

Note that other drivers (like at803x.c) also calls phy_init_hw().
So, perhaps, the driver caused a similar issue too.

Fixes: 9886a4dbd2aa ("net: phy: call phy_disable_interrupts() in phy_init_hw()")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 Changes from v1:
 - Fix build failure. I used two PCs: PC 1) for testing, PC 2) for
   submitting patches. I tested on the PC 1. But, after that, I wrote
   a patch on the PC2 again, and it seemed I didn't do a compile...
   Today, I got some emails from kernel test bot. So, I realized
   I had submitted an awful patch. To avoid such failure, I'll use
   one PC only from now on.

 drivers/net/phy/phy_device.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 8adfbad..b93b40c 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1143,10 +1143,6 @@ int phy_init_hw(struct phy_device *phydev)
 	if (ret < 0)
 		return ret;
 
-	ret = phy_disable_interrupts(phydev);
-	if (ret)
-		return ret;
-
 	if (phydev->drv->config_init)
 		ret = phydev->drv->config_init(phydev);
 
@@ -1423,6 +1419,10 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
 	if (err)
 		goto error;
 
+	err = phy_disable_interrupts(phydev);
+	if (err)
+		return err;
+
 	phy_resume(phydev);
 	phy_led_triggers_register(phydev);
 
-- 
2.7.4


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

* Re: [PATCH v2 RESEND] net: phy: call phy_disable_interrupts() in phy_attach_direct() instead
  2020-09-09  5:43 [PATCH v2 RESEND] net: phy: call phy_disable_interrupts() in phy_attach_direct() instead Yoshihiro Shimoda
@ 2020-09-10 19:57 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-09-10 19:57 UTC (permalink / raw)
  To: yoshihiro.shimoda.uh
  Cc: andrew, hkallweit1, linux, kuba, Jisheng.Zhang, netdev,
	linux-renesas-soc

From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: Wed,  9 Sep 2020 14:43:14 +0900

> Since the micrel phy driver calls phy_init_hw() as a workaround,
> the commit 9886a4dbd2aa ("net: phy: call phy_disable_interrupts()
> in phy_init_hw()") disables the interrupt unexpectedly. So,
> call phy_disable_interrupts() in phy_attach_direct() instead.
> Otherwise, the phy cannot link up after the ethernet cable was
> disconnected.
> 
> Note that other drivers (like at803x.c) also calls phy_init_hw().
> So, perhaps, the driver caused a similar issue too.
> 
> Fixes: 9886a4dbd2aa ("net: phy: call phy_disable_interrupts() in phy_init_hw()")
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
>  Changes from v1:
>  - Fix build failure. I used two PCs: PC 1) for testing, PC 2) for
>    submitting patches. I tested on the PC 1. But, after that, I wrote
>    a patch on the PC2 again, and it seemed I didn't do a compile...
>    Today, I got some emails from kernel test bot. So, I realized
>    I had submitted an awful patch. To avoid such failure, I'll use
>    one PC only from now on.
> 

Applied and queued up for -stable, thanks.

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

end of thread, other threads:[~2020-09-10 19:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-09  5:43 [PATCH v2 RESEND] net: phy: call phy_disable_interrupts() in phy_attach_direct() instead Yoshihiro Shimoda
2020-09-10 19:57 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.