linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net-next] net: phy: fixed_phy: Fix fixed_phy not checking GPIO
@ 2019-02-07  5:45 Moritz Fischer
  2019-02-07 17:52 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Moritz Fischer @ 2019-02-07  5:45 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, davem, hkallweit1, f.fainelli, andrew, moritz,
	Moritz Fischer

Fix fixed_phy not checking GPIO if no link_update callback
is registered.

In the original version all users registered a link_update
callback so the issue was masked.

Fixes: a5597008dbc2 ("phy: fixed_phy: Add gpio to determine link up/down.")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Moritz Fischer <mdf@kernel.org>
---

Changes from v1:
- Added Andrew's Reviewed-by: tag
- Added Fixes: tag (Thanks for digging, Andrew!)

---
 drivers/net/phy/fixed_phy.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
index f136a23c1a35..d810f914aaa4 100644
--- a/drivers/net/phy/fixed_phy.c
+++ b/drivers/net/phy/fixed_phy.c
@@ -85,11 +85,11 @@ static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num)
 				s = read_seqcount_begin(&fp->seqcount);
 				fp->status.link = !fp->no_carrier;
 				/* Issue callback if user registered it. */
-				if (fp->link_update) {
+				if (fp->link_update)
 					fp->link_update(fp->phydev->attached_dev,
 							&fp->status);
-					fixed_phy_update(fp);
-				}
+				/* Check the GPIO for change in status */
+				fixed_phy_update(fp);
 				state = fp->status;
 			} while (read_seqcount_retry(&fp->seqcount, s));
 
-- 
2.20.1


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

* Re: [PATCH v2 net-next] net: phy: fixed_phy: Fix fixed_phy not checking GPIO
  2019-02-07  5:45 [PATCH v2 net-next] net: phy: fixed_phy: Fix fixed_phy not checking GPIO Moritz Fischer
@ 2019-02-07 17:52 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-02-07 17:52 UTC (permalink / raw)
  To: mdf; +Cc: netdev, linux-kernel, hkallweit1, f.fainelli, andrew, moritz

From: Moritz Fischer <mdf@kernel.org>
Date: Wed,  6 Feb 2019 21:45:29 -0800

> Fix fixed_phy not checking GPIO if no link_update callback
> is registered.
> 
> In the original version all users registered a link_update
> callback so the issue was masked.
> 
> Fixes: a5597008dbc2 ("phy: fixed_phy: Add gpio to determine link up/down.")
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Moritz Fischer <mdf@kernel.org>

Applied, thank you.

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

end of thread, other threads:[~2019-02-07 17:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-07  5:45 [PATCH v2 net-next] net: phy: fixed_phy: Fix fixed_phy not checking GPIO Moritz Fischer
2019-02-07 17:52 ` 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).