I don't see how it works.
spin_lock_irqsave() increments preempt_count()
in_atomic checks is defined as:
# define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
kernel_locked() is defined as:
#define kernel_locked() (current->lock_depth >= 0)
If you call schedule while in_atomic() then it prints out the error
"bad: scheduling while atomic!\n".
As far as I can see set_current_state() doesn't affect
preempt_count() or current->lock_depth. I must be
missing something...
regards,
dan carpenter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/