interruptible_sleep_on_timeout causes system to hang

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

I hope this is the correct list for posting this question.  If not, please let 
me know.

I am a Linux newbie writing a device driver for a proprietary board.  I am 
experiencing problems (system hard hangs) when my driver calls 
interruptible_sleep_on_timeout.  I have combed through the archives of this 
list and have seen indications of problems in the past with this routine.  I 
don't know if what I am experiencing is due to a bug or a programmer error on 
my part.  I am currently running Red Hat 7.3 (Linux 2.4.18-3) on an Intel 
Pentium III (i686).  Originally I thought I was experiencing problems with 
interrupt handling.  My driver now does a request_irq, but does not enable it 
on the hardware.  Nor does it issue any commands to the board to generate an 
interrupt.  Thus, I would expect the interruptible_sleep_on_timeout to simply 
. . . time out!  (I wish I could be so lucky!!)  What follows are code snips:

global driver data:
static wait_queue_head_t RcvIntrcvQ;

in my open routine:

        status = request_irq(pslState->irq_line,&pslengrave_intr, 
                  SA_INTERRUPT   | SA_SHIRQ, "pslengrave",  (void *)pslState);
	 pslState->RcvIntrcvQp = &RcvIntrcvQ;
	 init_waitqueue_head (pslState->RcvIntrcvQp);
/*        EnableReceiverInterrupt(pslState);*/

in my ISR (which I don't expect to be called since I do not enable interrupt):
   /* Receive interrupt */
   if (USER_INTERRUPTING(pslState))
      {
      ResetReceiverInterrupt(pslState);
      pslState->numRcvIntrs++;
      wake_up_interruptible(pslState->RcvIntrcvQp);
      }

in a routine which will eventually initiate a command to the board:
(Note the writel is currently commented out.  If this was included, it would 
cause the hardware to interrupt).

/*        writel(Data, HardwareAddress);*/
    RcvTimeLeft = interruptible_sleep_on_timeout (pslState->RcvIntrcvQp,1*HZ);
    if (RcvTimeLeft)
	   {
           if (DebugMode) printk (KERN_INFO "Rcv intr received.\n");
	   }
     else
           {
	   printk (KERN_INFO "Rcv intr TIMEOUT.\n");
	   DumpEngraverStatus(pslState);
	   ReceiverTimeOut = 1;
	   }

If I comment out the call to interruptible_sleep_on_timeout, I experience no 
problems.  However, if this call is left in as shown above, the system 
completely hangs:  the clock quits ticking, I have no keyboard, mouse, etc.  
In addition, the keyboard lights for Caps Lock and Scroll lock begin 
blinking.  I greped through the Linux source code, but could not find 
anything pertaining to LEDs, blink, etc that looked like it had to do with 
this.

Any ideas, comments, suggestions?  

Thanks in advance!
Kathy




_______________________________________________
Redhat-devel-list mailing list
Redhat-devel-list@redhat.com
https://listman.redhat.com/mailman/listinfo/redhat-devel-list

[Index of Archives]     [Kernel Newbies]     [Red Hat General]     [Fedora]     [Red Hat Install]     [Linux Kernel Development]     [Yosemite News]

  Powered by Linux