Re: Any hope for ide-scsi (error handling)?

dan carpenter (d_carpenter@sbcglobal.net)
Sat, 15 Mar 2003 05:43:51 +0100


On Saturday 15 March 2003 10:01 pm, Willem Riede wrote:
> It may not be elegant to schedule(1) with the lock taken, but it
> does work.
>
> However, my latest patch doesn't seem to be applied, since in my
> version I have a set_current_state(TASK_INTERRUPTIBLE); before
> the schedule.

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/