> 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").
Are you sure about that?
I think, there are low-level drivers which don't follow this rule.
Why does not the scsi_done function(s) itself get the io_request_lock
first before doing any work if it really needs this?
Mit freundlichen Gr��en / with kind regards
Martin Peschke
IBM Deutschland Entwicklung GmbH
GNU/Linux for S/390 and zSeries Development
Phone: +49-(0)7031-16-2349
Doug Ledford <[EMAIL PROTECTED]> on 07/19/2001 06:48:45 PM
Please respond to Doug Ledford <[EMAIL PROTECTED]>
To: "MEHTA,HIREN (A-SanJose,ex1)" <[EMAIL PROTECTED]>
cc: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
Subject: Re: question on io_request_lock
"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]
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]