From mboxrd@z Thu Jan 1 00:00:00 1970 From: Detlev Zundel Date: Thu, 19 May 2011 10:53:30 +0200 Subject: [U-Boot] [PATCH] phylib: Detect link on 10G devices correctly In-Reply-To: <1305762259-5639-1-git-send-email-afleming@freescale.com> (Andy Fleming's message of "Wed, 18 May 2011 18:44:19 -0500") References: <1305762259-5639-1-git-send-email-afleming@freescale.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Andy, > gen10g_startup() had 2 bugs: > > 1) It had a boolean logic error in checking the MMD mask, and > always checked all of them. Good catch. > 2) It checked devices which don't actually report link state, which > meant that it would never believe the link was fully up. > > Fix the boolean logic, and then mask the MMD mask so only link-reporting > devices are checked. > > Signed-off-by: Andy Fleming > Reported-by: Ed Swarthout > --- > > drivers/net/phy/generic_10g.c | 8 ++++++-- > include/linux/mdio.h | 8 ++++++++ > 2 files changed, 14 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/phy/generic_10g.c b/drivers/net/phy/generic_10g.c > index 315c508..1c3e69e 100644 > --- a/drivers/net/phy/generic_10g.c > +++ b/drivers/net/phy/generic_10g.c > @@ -36,7 +36,7 @@ int gen10g_shutdown(struct phy_device *phydev) > int gen10g_startup(struct phy_device *phydev) > { > int devad, reg; > - u32 mmd_mask = phydev->mmds; > + u32 mmd_mask = phydev->mmds & MDIO_DEVS_LINK; So we are introducing this new macro, right? I don't see this in Linux - how is this handled there? If we do have to create a new name, can't we use something more self-documenting, e.g. MDIO_DEVS_REPORT_LINK or such? Cheers Detlev -- Quantum physicists can either know how fast they do it, or where they do it, but not both. -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de