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, shawn.guo@linaro.org
Subject: Re: [PATCH v4 1/1] net: fec: ptp: avoid register access when ipg clock is disabled
Date: Thu, 21 Aug 2014 09:02:41 +0200	[thread overview]
Message-ID: <20140821070241.GB6231@netboy> (raw)
In-Reply-To: <1408418453-28012-2-git-send-email-b38611@freescale.com>

On Tue, Aug 19, 2014 at 11:20:53AM +0800, Fugang Duan wrote:
> The current kernel hang on i.MX6SX with rootfs mount from MMC.
> The root cause is ptp rise up period timer to access enet register

s/ptp rise up period/that ptp uses a periodic/

> even if ipg clock is disabled.

...

> diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c
> index 82386b2..6d65555 100644
> --- a/drivers/net/ethernet/freescale/fec_ptp.c
> +++ b/drivers/net/ethernet/freescale/fec_ptp.c
> @@ -245,12 +245,18 @@ static int fec_ptp_settime(struct ptp_clock_info *ptp,
>  	u64 ns;
>  	unsigned long flags;
>  
> +	mutex_lock(&fep->ptp_clk_mutex);
> +	/* Check the ptp clock */
> +	if (!fep->ptp_clk_on)
> +		return -EINVAL;

You are still holding the mutex here.

> +
>  	ns = ts->tv_sec * 1000000000ULL;
>  	ns += ts->tv_nsec;
>  
>  	spin_lock_irqsave(&fep->tmreg_lock, flags);
>  	timecounter_init(&fep->tc, &fep->cc, ns);
>  	spin_unlock_irqrestore(&fep->tmreg_lock, flags);
> +	mutex_unlock(&fep->ptp_clk_mutex);
>  	return 0;
>  }

Thanks,
Richard

  reply	other threads:[~2014-08-21  7:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-19  3:20 [PATCH v4 0/1] net: fec: ptp: avoid register access when ipg clock is disabled Fugang Duan
2014-08-19  3:20 ` [PATCH v4 1/1] " Fugang Duan
2014-08-21  7:02   ` Richard Cochran [this message]
2014-08-21  9:24     ` 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=20140821070241.GB6231@netboy \
    --to=richardcochran@gmail.com \
    --cc=b38611@freescale.com \
    --cc=davem@davemloft.net \
    --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.