Re: When must the io_request_lock be held?

James Bottomley
2002-08-07T16:48:20Z

dledford@redhat.com said:
> Then you better not *ever* release the lock under those conditions.

Exactly so.

dledford@redhat.com said:
> Again, if Marcello takes my patch, this will become easier as well
> since it adds a host->lock lock that allows you to get your driver
> off the horrible io_request_lock once and for all. (Note: I may have
> to change the name to host->host_lock to make it match 2.5, but that
> just annoys the hell out of me because I *detest* totally redundant
> names like that...)

Well, that's just semantics, I won't get into the argument...

Note also that 2.5 already has per queue locks (that means per individual SCSI
devices) which are lock pointers. In 2.5 current, all the devices that hang
off an individual host have their queue_locks initialised to point to the
single host->host_lock. However, drivers which can do it (the type of
multi-threaded multi-mailbox ones) will be permitted to use individual and
separate queue_locks, rather than the single host_lock, to protect their
mailbox registers. If you are never going to do this, the difference between
using host_lock and queue_lock is irrelevant to you. If you are, you need to
begin using the queue_locks.

James