lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 14 Oct 2014 12:36:10 +0200
From:	Richard Cochran <richardcochran@...il.com>
To:	Fugang Duan <b38611@...escale.com>
Cc:	davem@...emloft.net, netdev@...r.kernel.org,
	bhutchings@...arflare.com, b20596@...escale.com
Subject: Re: [PATCH] net: fec: ptp: fix convergence issue to support LinuxPTP
 stack

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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists