Re: waiting 100ms while in __init code

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

 



Florin Malita (mali@go.ro) wrote:
> On Mon, 2003-03-31 at 22:53, David Wuertele wrote:
> > I'm putting some code in ide_setup() (which is declared as __init)
> > that powers up a peripheral, then waits 100ms, then resets the
> > peripheral.  I'm having trouble doing the wait.  Here's what I'm
> > doing:
> > 
> >   unsigned long ulMillSecs = 100;
> >   unsigned long ulJiffies;
> >   current->state = TASK_INTERRUPTIBLE;
> >   ulJiffies = (ulMillSecs * HZ)/1000; // Convert ms to jiffies
> >   schedule_timeout(ulJiffies);
> > 
> > I guess the jiffies and scheduler aren't ready at this point?
> 
> Yup, doesn't make sense to call schedule at __init time. Try using
> mdelay (#include <linux/delay.h>).
> 

http://www.xml.com/ldd/chapter/book/ch06.html

-- 
Cordialement/Regards
Iomeda SA (clucas@iomeda.fr)
Christophe Lucas -- Developpeur/Administrateur GNU/Linux
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux