All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Guo-Fu Tseng" <cooldavid@cooldavid.org>
To: AriesLee <AriesLee@jmicron.com>,
	Aries Lee <ariesleeILan@gmail.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH 1/1]  PHY configuration for compatible issue
Date: Mon, 21 Nov 2011 13:35:06 +0800	[thread overview]
Message-ID: <20111121053026.M38786@cooldavid.org> (raw)
In-Reply-To: <1321870127-15541-1-git-send-email-AriesLee@jmicron.com>

On Mon, 21 Nov 2011 18:08:47 +0800, AriesLee wrote
> To perform PHY calibration and set a different EA value by chip ID,
> Whenever the NIC chip power on, ie booting or resuming, we need to
> force HW to calibrate PHY parameter again, and also set a proper EA
> value which gather from experiment.
> 
> Those procedures help to reduce compatible issues(NIC is unable to link
> up in some special case) in giga speed.
> 
> Signed-off-by: AriesLee <AriesLee@jmicron.com>
> ---
>  drivers/net/ethernet/jme.c |  113 
> ++++++++++++++++++++++++++++++++++++++++++- drivers/net/ethernet/jme.h 
> |   19 +++++++ 2 files changed, 129 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
> index df3ab83..4d217b8 100644
> --- a/drivers/net/ethernet/jme.c
> +++ b/drivers/net/ethernet/jme.c
> @@ -1744,6 +1744,112 @@ jme_phy_off(struct jme_adapter *jme)
>  		jme_new_phy_off(jme);
>  }
> 
> +static void
> +jme_phy_specreg_read(struct jme_adapter *jme, u32 specreg, u32 *phy_data) 
> +{
> +	u32 phy_addr;
> +
> +	phy_addr = JM_PHY_SPEC_REG_READ | specreg;
> +	jme_mdio_write(jme->dev, jme->mii_if.phy_id, JM_PHY_SPEC_ADDR_REG,
> +			phy_addr);
> +	*phy_data = jme_mdio_read(jme->dev, jme->mii_if.phy_id,
> +			JM_PHY_SPEC_DATA_REG);
> +}
Is there any particular reason that you pass the address of reading data.
Instead of just returning the value? (phy_data)
It would be more consistent if you return the value in this kind of
read function.

Otherwise this path all seems to be OK to me. :)

Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>

Guo-Fu Tseng

  reply	other threads:[~2011-11-21  5:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-21 10:08 [PATCH 1/1] PHY configuration for compatible issue AriesLee
2011-11-21  5:35 ` Guo-Fu Tseng [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-11-21 20:20 AriesLee
2011-11-22 16:19 ` Guo-Fu Tseng
2011-11-28  0:22 ` David Miller
2011-11-18 14:54 AriesLee
2011-11-17 14:05 AriesLee
2011-11-17  7:15 ` Guo-Fu Tseng
2011-11-18  7:13   ` Aries Lee
2011-11-19  4:19     ` Guo-Fu Tseng
2011-11-21  2:13       ` Aries Lee

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=20111121053026.M38786@cooldavid.org \
    --to=cooldavid@cooldavid.org \
    --cc=AriesLee@jmicron.com \
    --cc=ariesleeILan@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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 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.