lkml.org 
[lkml]   [2003]   [Dec]   [18]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 18 Dec 2003 08:47:49 +0100
FromJens Axboe <>
SubjectRe: cciss update for 2.4.24-pre1, 2 of 2
On Wed, Dec 17 2003, Andrew Morton wrote:
> Jens Axboe <axboe@suse.de> wrote:
> >
> > > +	for (i=0; i < 1200; i++) {
> > > +		scratchpad = readl(c->vaddr + SA5_SCRATCHPAD_OFFSET);
> > > +		if (scratchpad == 0xffff0000) {
> > > +			ready = 1;
> > > +			break;
> > > +		}
> > > +		set_current_state(TASK_INTERRUPTIBLE);
> > > +		schedule_timeout(HZ / 10); /* wait 100ms */
> > > +	}
> > > +	if (!ready) {
> > > +		printk(KERN_WARNING "cciss: Board not ready.  Timed out.\n");
> > > +		return -1;
> > > +	}
> > 
> > Fine as well, aren't you happy you changed this to schedule_timeout()
> > instead of busy looping? :)
> 
> It will still be a busy loop if this task has a signal pending. 
> TASK_UNINTERRUPTIBLE may be more appropriate...

Agreed, that would be better.

-- 
Jens Axboe

-
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/

\
 
 \ /
  Last update: 2005-03-22 12:59    [from the cache]
©2003-2008