"MEHTA,HIREN (A-SanJose,ex1)" wrote:
> 
> Hi List,
> 
> If I decide that I do not want to depend on io_request_lock
> to maintain the consistency of the data structures in my driver,
> then do I ever need to acquire this lock and release it in the driver ?
> e.g. Do I need to acquire io_request_lock before I call the done() routine
> and release it after done() returns ?

Yes, the done() function needs to be wrapped (this isn't so much because it
actually needs it as it is that you are calling mid layer code and you need to
adhere to what it tells you locking semantics are, which in this case is
"always hold the io_request_lock because that's how I keep myself sane").  You
are free to use your own internal spin locks in your code if you wish.  For
certain of your code entry points, you may wish to release the io_request_lock
and then re-grab it before returning.  For example, at the beginning of your
queue routine you should release the io_request_lock and then regrab it before
returning if you want to use your own internal locking and not use the
io_request_lock.  The queue, abort, and reset routines are called with the
io_request_lock held when using the old error handling methods.  I don't know
which entry points are called with the lock held under the new error handling
code, but I would suspect the answer is "all of them".


-- 

 Doug Ledford <[EMAIL PROTECTED]>  http://people.redhat.com/dledford
      Please check my web site for aic7xxx updates/answers before
                      e-mailing me about problems
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]

Reply via email to