host lock in EH
Hi all,
some time ago eh_device_reset_handlers of most drivers were changed to grab the host lock.
http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=94d0e7b805961c44e4dc486ffc21075084bb7175
Are there general reasons to acquire the host lock in eh_s?
I ask in particular because sbp2's eh_abort_handler actually performs a superset of what sbp2's eh_device_reset_handler does,¹ yet the eh_abort_handler does not grab the host lock.² I.e.,
sbp2scsi_abort() /* eh_abort_handler */
{
A;
B;
C;
}sbp2scsi_reset() /* eh_device_reset_handler */
{
spin_lock_irqsave(host_lock, flags);
B;
spin_unlock_irqrestore(host_lock, flags);
}So, is it wrong that sbp2scsi_abort doesn't take a lock around B or even around A...C? Or is it wrong that sbp2scsi_reset takes the lock?
TIA for any clues.
¹) This seems a bit goofy and may change eventually. I don't think sbp2's eh_s are mature yet.
²) sbp2's eh_abort_handler only has a dedicated lock protection further down in a subroutine which manipulates an sbp2-internal list.
Signature · 7 lines
Stefan Richter -=====-=-=-= =-== --=-= http://arcgraph.de/sr/ - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines · Stefan Richter
Hi all,
some time ago
eh_device_reset_handlersof most drivers were changed to grab the host lock.
http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=94d0e7b805961c44e4dc486ffc21075084bb7175Are there general reasons to acquire the host lock in
eh_s?
The patch you reference simply maintains existing locking rules, whatever they were at the time.
For drivers that unlocked the host lock and did their own thing, those lock manipulations simply went away.
For drivers that took no locks, they were updated to take the host lock since that is no longer done by the upper layers.
Jeff
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php