All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: "fugang.duan@freescale.com" <fugang.duan@freescale.com>
Cc: "shawn.guo@linaro.org" <shawn.guo@linaro.org>,
	"Frank.Li@freescale.com" <Frank.Li@freescale.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] net: fec: ptp: avoid register access when ipg clock is disabled
Date: Mon, 21 Jul 2014 18:40:04 +0200	[thread overview]
Message-ID: <20140721164004.GA13039@localhost.localdomain> (raw)
In-Reply-To: <08eaaff4b82b42538d6a0f4193ecb805@BLUPR03MB373.namprd03.prod.outlook.com>

On Mon, Jul 21, 2014 at 10:46:31AM +0000, fugang.duan@freescale.com wrote:

> >> +	if (fep->bufdesc_ex && (fep->hwts_tx_en || fep->hwts_rx_en))
> >> +		fec_ptp_stop(ndev);
> >
> >So if user space turns time stamping off, then you keep running the timer.
> >That is wrong, isn't it?
> >
> If user close the ethx interface, or do suspend operation, fec driver will
> Close all clocks to save power, we also need to stop ptp, otherwise ptp timer
> Keep access register that cause system hang.
> 
> I don't think this is a good method, maybe I need some time to struct better solution.

What?

Look at the code that you wrote. You have:

	IF   x AND (fep->hwts_tx_en || fep->hwts_rx_en)
	THEN fec_ptp_stop;

So if the user clears 'hwts_tx_en' and 'hwts_rx_en' using the ioctl,
you don't stop the timer. But in order to fix the bug, you should stop
the timer in any case.

> >Why not use a work queue for this?
>
> There need one period timer to sync hw timer to avoid 32 bit hw counter overflow.

So why not use schedule_delayed_work?

Thanks,
Richard

      reply	other threads:[~2014-07-21 16:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-21  2:35 [PATCH] net: fec: ptp: avoid register access when ipg clock is disabled Fugang Duan
2014-07-21  4:02 ` Shawn Guo
2014-07-21  4:03 ` Richard Cochran
2014-07-21 10:46   ` fugang.duan
2014-07-21 16:40     ` Richard Cochran [this message]

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=20140721164004.GA13039@localhost.localdomain \
    --to=richardcochran@gmail.com \
    --cc=Frank.Li@freescale.com \
    --cc=davem@davemloft.net \
    --cc=fugang.duan@freescale.com \
    --cc=netdev@vger.kernel.org \
    --cc=shawn.guo@linaro.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.