On 7 June 2013 18:48, Catalin Marinas catalin.marinas@arm.com wrote:
On Fri, Jun 07, 2013 at 03:50:55PM +0100, Ard Biesheuvel wrote:
+void kernel_neon_begin(void) +{
/* Avoid using the NEON in interrupt context */
might_sleep();
The patch looks fine but this might_sleep() does not feel right since we don't expect the subsequent code to sleep. Would something like BUG_ON(in_interrupt()) work?
The underlying purpose (make noise when calling the function in interrupt context) is the same. However, might_sleep() is also a voluntary preemption point in case that option is enabled, and it drops the check for which context it is called from entirely if CONFIG_DEBUG_ATOMIC_SLEEP is not set.
I am fine either way.
I also realized changing late_initcall() to core_initcall() is not necessary here, so I will change that as well. I will follow up with an actual (updated) patch once things have moved some more on the arm/ side.