Re: use of preempt_count instead of in_atomic() at leds-gpio.c

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alan Stern
Date: Friday, March 21, 2008 - 11:05 am

On Fri, 21 Mar 2008, Andrew Morton wrote:


There's also a section about in_atomic() in the Linux Device Drivers 
(3rd ed.) book which may have contributed to the confusion.  On p. 198:

	A function related to in_interrupt() is in_atomic().  Its 
	return value is nonzero whenever scheduling is not allowed;
	this includes hardware and software interrupt contexts as well
	as any time when a spinlock is held.  In the latter case, 
	current may be valid, but access to user space is forbidden, 
	since it can cause scheduling to happen.  Whenever you are
	using in_interrupt(), you should really consider whether 
	in_atomic() is what you actually mean.  Both functions are
	declared in <asm/hardirq.h>.

Alan Stern

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
use of preempt_count instead of in_atomic() at leds-gpio.c, Henrique de Moraes H ..., (Sun Mar 16, 11:43 am)
Re: use of preempt_count instead of in_atomic() at leds-gpio.c, Henrique de Moraes H ..., (Thu Mar 20, 3:56 pm)
Re: use of preempt_count instead of in_atomic() at leds-gpio.c, Henrique de Moraes H ..., (Thu Mar 20, 5:36 pm)
Re: use of preempt_count instead of in_atomic() at leds-gpio.c, Henrique de Moraes H ..., (Thu Mar 20, 7:10 pm)
Re: use of preempt_count instead of in_atomic() at leds-gpio.c, Henrique de Moraes H ..., (Fri Mar 21, 5:37 am)
Re: use of preempt_count instead of in_atomic() at leds-gpio.c, Alan Stern, (Fri Mar 21, 11:05 am)
Re: use of preempt_count instead of in_atomic() at leds-gpio.c, Henrique de Moraes H ..., (Wed Mar 26, 9:17 am)