Re: [PATCH RFC] netpoll: convert mutex into a semaphore
From: David Miller <davem@davemloft.net>
Date: 2013-05-01 19:01:01
From: David Miller <davem@davemloft.net>
Date: 2013-05-01 19:01:01
From: Neil Horman <nhorman@tuxdriver.com> Date: Tue, 30 Apr 2013 11:35:05 -0400
Bart Van Assche recently reported a warning to me:
...
This resulted from my commit ca99ca14c which introduced a mutex_trylock operation in a path that could execute in interrupt context. When mutex debugging is enabled, the above warns the user when we are in fact exectuting in interrupt context interrupt context. After some discussion, It seems that a semaphore is the proper mechanism to use here. While mutexes are defined to be unusable in interrupt context, no such condition exists for semaphores (save for the fact that the non blocking api calls, like up and down_trylock must be used when in irq context). Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Reported-by: Bart Van Assche <bvanassche@acm.org>
Neil this looks good to me so I'm going to toss it into my tree and queue it up for -stable too, thanks!