Re: [PATCH 08/12] ptp: Added a brand new class driver for ptp clocks.
From: Grant Likely <hidden>
Date: 2010-08-13 23:54:42
Also in:
linux-arm-kernel, linux-devicetree, linuxppc-dev
From: Grant Likely <hidden>
Date: 2010-08-13 23:54:42
Also in:
linux-arm-kernel, linux-devicetree, linuxppc-dev
On Fri, Aug 13, 2010 at 3:34 AM, Richard Cochran [off-list ref] wrote:
On Tue, Jun 15, 2010 at 01:11:30PM -0600, Grant Likely wrote:quoted
On Tue, Jun 15, 2010 at 10:09 AM, Richard Cochranquoted
+static DEFINE_SPINLOCK(clocks_lock); /* protects 'clocks' */Doesn't appear that clocks is manipulated at atomic context. Mutex instead?...quoted
If the spinlock is changed to a mutex that is held for the entire function call, then the logic here can be simpler.Grant, I am working on another go at this patch series. Stupid question: The caller of ptp_clock_register(), which takes the clocks_lock, is always a module_init() function. Is this always a safe context in which to call mutex_lock?
Yes, you can take mutexes in the module_init context. g. -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.