The HyperNews Linux KHG Discussion Pages

## You are using the timer interface in a wrong way

  Forum: Device Driver Basics
  Re: using XX_select() for device without interrupts (Elwood Downey)
  Keywords: select interrupts polling sleeping
  Date: Thu, 15 Jan 1998 08:42:17 GMT
  From: Miran Miksic <mmiksic@hni.uni-paderborn.de>

Hi, How did you come to idea pass the wake_up_interruptible() function function as timer callback!? Not a wonder that the system hangs up. You should do the following: 1. Make pc39_wq a global variable and initialize it to NULL. 2. See code: ... the code above
        if (wait) {
            init_timer (&pc39_tl);
            pc39_tl.expires = PC39_SELTO;
            pc39_tl.function = your_timer_function;
            pc39_tl.data = (unsigned long) &pc39_wq;
            add_timer (&pc39_tl);
            select_wait (&pc39_wq, wait);
        }
        return(0);
    }
    void your_timer_funtion( unsigned long data )
    {
        wake_up_interruptible(&pc39_wq);
    }
I suppose that you've already solved your problem, but this post may be of use for the others. Miran