All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: Fugang Duan <b38611@freescale.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	bhutchings@solarflare.com, b20596@freescale.com
Subject: Re: [PATCH] net: fec: ptp: fix convergence issue to support LinuxPTP stack
Date: Tue, 14 Oct 2014 12:36:10 +0200	[thread overview]
Message-ID: <20141014103610.GA4019@localhost.localdomain> (raw)
In-Reply-To: <1413265187-5228-1-git-send-email-b38611@freescale.com>

On Tue, Oct 14, 2014 at 01:39:47PM +0800, Fugang Duan wrote:
> IEEE 1588 module has one hw issue in capturing the ATVR register. According
> to the user manual it is:
> 		ENET0->ATCR |= ENET_ATCR_CAPTURE_MASK;
> 		while(ENET0->ATCR & ENET_ATCR_CAPTURE_MASK);
> 		ts_counter_ns = ENET0->ATVR;

...

> diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c
> index cca3617..380bb10 100644
> --- a/drivers/net/ethernet/freescale/fec_ptp.c
> +++ b/drivers/net/ethernet/freescale/fec_ptp.c
> @@ -82,12 +82,17 @@ static cycle_t fec_ptp_read(const struct cyclecounter *cc)
>  {
>  	struct fec_enet_private *fep =
>  		container_of(cc, struct fec_enet_private, cc);
> +	const struct platform_device_id *id_entry =
> +		platform_get_device_id(fep->pdev);
>  	u32 tempval;
>  
>  	tempval = readl(fep->hwp + FEC_ATIME_CTRL);
>  	tempval |= FEC_T_CTRL_CAPTURE;
>  	writel(tempval, fep->hwp + FEC_ATIME_CTRL);
>  
> +	if (id_entry->driver_data & FEC_QUIRK_BUG_CAPTURE)
> +		udelay(1);
> +

What? You never had

	while(ENET0->ATCR & ENET_ATCR_CAPTURE_MASK);

in the first place. Maybe you should try that.

Did this code ever work? I guess not.

>  	return readl(fep->hwp + FEC_ATIME);
>  }

Thanks,
Richard

  reply	other threads:[~2014-10-14 10:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-14  5:39 [PATCH] net: fec: ptp: fix convergence issue to support LinuxPTP stack Fugang Duan
2014-10-14 10:36 ` Richard Cochran [this message]
2014-10-14 16:52   ` David Miller
2014-10-14 18:27     ` Frank.Li
2014-10-14 18:39       ` Richard Cochran
2014-10-14 18:43         ` Frank.Li
2014-10-14 18:49           ` Richard Cochran
2014-10-15  1:28             ` fugang.duan
2014-10-15  1:37             ` fugang.duan
2014-10-15  1:30         ` fugang.duan
2014-10-15  7:25           ` Richard Cochran
2014-10-15  7:42             ` fugang.duan

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=20141014103610.GA4019@localhost.localdomain \
    --to=richardcochran@gmail.com \
    --cc=b20596@freescale.com \
    --cc=b38611@freescale.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --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.