ia64/xen-unstable

changeset 745:52f228c7096b

bitkeeper revision 1.445 (3f6b3cbfPoEFlaJ9_8AHKqhfHOuhyQ)

e100.h, schedule.c:
Yet another e100/schedule_timeout fix.
author kaf24@scramble.cl.cam.ac.uk
date Fri Sep 19 17:28:31 2003 +0000 (2003-09-19)
parents 57012a0c028c
children fd77b675a5af
files xen/common/schedule.c xen/drivers/net/e100/e100.h
line diff
     1.1 --- a/xen/common/schedule.c	Fri Sep 19 17:11:51 2003 +0000
     1.2 +++ b/xen/common/schedule.c	Fri Sep 19 17:28:31 2003 +0000
     1.3 @@ -648,33 +648,16 @@ long schedule_timeout(long timeout)
     1.4      
     1.5      expire = timeout + jiffies;
     1.6      
     1.7 -    if ( is_idle_task(current) )
     1.8 -    {
     1.9 -        /*
    1.10 -         * If the idle task is calling in then it shouldn't ever sleep. We 
    1.11 -         * therefore force it to TASK_RUNNING here and busy-wait. We spin on 
    1.12 -         * schedule to give other domains a chance meanwhile.
    1.13 -         */
    1.14 -        set_current_state(TASK_RUNNING);
    1.15 -        do { 
    1.16 -            schedule();
    1.17 -            timeout = expire - jiffies;
    1.18 -        } 
    1.19 -        while ( (timeout > 0) && is_idle_task(current) );
    1.20 -    }
    1.21 -    else
    1.22 -    {
    1.23 -        init_timer(&timer);
    1.24 -        timer.expires = expire;
    1.25 -        timer.data = (unsigned long) current;
    1.26 -        timer.function = process_timeout;
    1.27 -        
    1.28 -        add_timer(&timer);
    1.29 -        schedule();
    1.30 -        del_timer_sync(&timer);
    1.31 -        
    1.32 -        timeout = expire - jiffies;
    1.33 -    }
    1.34 +    init_timer(&timer);
    1.35 +    timer.expires = expire;
    1.36 +    timer.data = (unsigned long) current;
    1.37 +    timer.function = process_timeout;
    1.38 +    
    1.39 +    add_timer(&timer);
    1.40 +    schedule();
    1.41 +    del_timer_sync(&timer);
    1.42 +    
    1.43 +    timeout = expire - jiffies;
    1.44  
    1.45   out:
    1.46      return timeout < 0 ? 0 : timeout;
     2.1 --- a/xen/drivers/net/e100/e100.h	Fri Sep 19 17:11:51 2003 +0000
     2.2 +++ b/xen/drivers/net/e100/e100.h	Fri Sep 19 17:28:31 2003 +0000
     2.3 @@ -62,6 +62,10 @@
     2.4  
     2.5  #define yield() ((void)0)
     2.6  
     2.7 +#define schedule_timeout(_t)       \
     2.8 +  set_current_state(TASK_RUNNING); \
     2.9 +  mdelay((_t)*(1000/HZ))
    2.10 +
    2.11  #define E100_REGS_LEN 1
    2.12  /*
    2.13   *  Configure parameters for buffers per controller.