[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140818194151.GA4048@netboy>
Date: Mon, 18 Aug 2014 21:42:10 +0200
From: Richard Cochran <richardcochran@...il.com>
To: "fugang.duan@...escale.com" <fugang.duan@...escale.com>
Cc: "davem@...emloft.net" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"shawn.guo@...aro.org" <shawn.guo@...aro.org>
Subject: Re: [PATCH v3 1/1] net: fec: ptp: avoid register access when ipg
clock is disabled
On Mon, Aug 18, 2014 at 06:07:00AM +0000, fugang.duan@...escale.com wrote:
> 1. Set the flag to false firstly.
Yes.
> 2. Don't need to add mutex to protect the flag.(My previous mail ask one mutex to protect the flag)
You *do* need a mutex to protect the state of the physical clock. One
process might turn it off while another process is still reading it.
> Just pull the flag into the protected field by spin_lock_irqsave() like :
> fec_time_keep()
No, the spin only protects the register access.
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