public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] phylib: Detect link on 10G devices correctly
Date: Thu, 19 May 2011 10:53:30 +0200	[thread overview]
Message-ID: <m2zkmjoyut.fsf@ohwell.denx.de> (raw)
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")

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 <afleming@freescale.com>
> Reported-by: Ed Swarthout <Ed.Swarthout@freescale.com>
> ---
>
>  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

  reply	other threads:[~2011-05-19  8:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18 23:44 [U-Boot] [PATCH] phylib: Detect link on 10G devices correctly Andy Fleming
2011-05-19  8:53 ` Detlev Zundel [this message]
2011-07-27 21:21 ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2zkmjoyut.fsf@ohwell.denx.de \
    --to=dzu@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox