lkml.org 
[lkml]   [2002]   [Dec]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectContext of strategy routine in block device drivers

Hi list,

I have a question concerning the strategy routine of a block device
driver. Any hints or pointers would be appreciated; a search of the
list archives did not reveal anything.

Alessandro Rubini & Jonathan Corbet write on p. 331 of their book
"Linux Device Drivers", 2nd ed:

"The request function has one very important constraint: it must be
atomic. request is not usually called in direct response to user
requests, and it is not running in the context of any particular
process. It can be called at interrupt time, from tasklets, or from
any number of other places. Thus, it must not sleep while carrying out
its tasks."

Why, then, is sleep_on() used happily all over
linux/drivers/block/amiflop.c? According to the above statement, this
should not work. I also use sleep_on(), together with a kernel timer,
in order to implement a simple delay in my own device driver, and it
has always worked fine. Why? Am I just having good luck?

Yours confused,
--
michael krause -- .oO[ http://www.soundtracker.org/raw/ ]Oo.

-
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 13:31    [from the cache]
©2003-2011 Jasper Spaans