Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1667913 > unrolled thread

[PATCH] net/phy: micrel: configure intterupts after autoneg workaround

Started byZach Brown <zach.brown@ni.com>
First post2017-06-16 19:30 +0200
Last post2017-06-18 00:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] net/phy: micrel: configure intterupts after autoneg workaround Zach Brown <zach.brown@ni.com> - 2017-06-16 19:30 +0200
    Re: [PATCH] net/phy: micrel: configure intterupts after autoneg  workaround Andrew Lunn <andrew@lunn.ch> - 2017-06-18 00:40 +0200

#1667913 — [PATCH] net/phy: micrel: configure intterupts after autoneg workaround

FromZach Brown <zach.brown@ni.com>
Date2017-06-16 19:30 +0200
Subject[PATCH] net/phy: micrel: configure intterupts after autoneg workaround
Message-ID<tT3eh-393-1@gated-at.bofh.it>
The commit ("net/phy: micrel: Add workaround for bad autoneg") fixes
an autoneg failure case by resetting the hardware. This turns off
intterupts. Things will work themselves out if the phy
polls, as it will figure out it's state during a poll. However if the
phy uses only intterupts, the phy will stall, since interrupts
are off.

This patch fixes the issue by calling config_intr after resetting the
phy.

Fixes: d2fd719bcb0e ("net/phy: micrel: Add workaround for bad autoneg ")
Signed-off-by: Zach Brown <zach.brown@ni.com>
---
 drivers/net/phy/micrel.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 9365b07..bc2a0a4 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -620,6 +620,8 @@ static int ksz9031_read_status(struct phy_device *phydev)
 	if ((regval & 0xFF) == 0xFF) {
 		phy_init_hw(phydev);
 		phydev->link = 0;
+		if (phydev->drv->config_intr)
+			phydev->drv->config_intr(phydev);
 	}
 
 	return 0;
-- 
2.7.4

[toc] | [next] | [standalone]


#1668439 — Re: [PATCH] net/phy: micrel: configure intterupts after autoneg workaround

FromAndrew Lunn <andrew@lunn.ch>
Date2017-06-18 00:40 +0200
SubjectRe: [PATCH] net/phy: micrel: configure intterupts after autoneg workaround
Message-ID<tTuxQ-5dy-19@gated-at.bofh.it>
In reply to#1667913
On Fri, Jun 16, 2017 at 12:20:07PM -0500, Zach Brown wrote:
> The commit ("net/phy: micrel: Add workaround for bad autoneg") fixes
> an autoneg failure case by resetting the hardware. This turns off
> intterupts. Things will work themselves out if the phy
> polls, as it will figure out it's state during a poll. However if the
> phy uses only intterupts, the phy will stall, since interrupts
> are off.
> 
> This patch fixes the issue by calling config_intr after resetting the
> phy.
> 
> Fixes: d2fd719bcb0e ("net/phy: micrel: Add workaround for bad autoneg ")
> Signed-off-by: Zach Brown <zach.brown@ni.com>
> ---
>  drivers/net/phy/micrel.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> index 9365b07..bc2a0a4 100644
> --- a/drivers/net/phy/micrel.c
> +++ b/drivers/net/phy/micrel.c
> @@ -620,6 +620,8 @@ static int ksz9031_read_status(struct phy_device *phydev)
>  	if ((regval & 0xFF) == 0xFF) {
>  		phy_init_hw(phydev);
>  		phydev->link = 0;
> +		if (phydev->drv->config_intr)
> +			phydev->drv->config_intr(phydev);

The core will only call the config_intr() method if
phy_interrupt_is_valid() is true.

I would suggest you do the same here. Otherwise there is a danger of
enabling interrupts without having an interrupt handler registered.

  Andrew

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web