Subject: Re: [PATCH v2 1/1] net: fec: ptp: avoid register access when ipg clock is disabled

From: Richard Cochran <[email-masked]>
Date: Wed, 13 Aug 2014 23:19:42 +0200

On Wed, Aug 13, 2014 at 12:55:05PM +0800, Fugang Duan wrote:

> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> index 66fe1f6..8befa2c 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -2198,6 +2198,8 @@ fec_enet_open(struct net_device *ndev)
>  	napi_enable(&fep->napi);
>  	phy_start(fep->phy_dev);
>  	netif_start_queue(ndev);
> +	if (fep->hwts_tx_en)
> +		schedule_delayed_work(&fep->time_keep, HZ);
>  	return 0;
>  }
>  
> @@ -2206,6 +2208,9 @@ fec_enet_close(struct net_device *ndev)
>  {
>  	struct fec_enet_private *fep = netdev_priv(ndev);
>  
> +	if (fep->hwts_tx_en)
> +		cancel_delayed_work_sync(&fep->time_keep);

You make the clock logic depend on whether time stamping is enabled or
not. Why do you do that?

The clock should keep ticking, even if time stamping is disabled.

Thanks,
Richard