linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* host lock in EH
@ 2005-11-05  0:26 Stefan Richter
  2005-11-05  4:55 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Richter @ 2005-11-05  0:26 UTC (permalink / raw)
  To: linux-scsi; +Cc: linux1394-devel

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.
-- 
Stefan Richter
-=====-=-=-= =-== --=-=
http://arcgraph.de/sr/
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: host lock in EH
  2005-11-05  0:26 host lock in EH Stefan Richter
@ 2005-11-05  4:55 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2005-11-05  4:55 UTC (permalink / raw)
  To: Stefan Richter; +Cc: linux-scsi, linux1394-devel

Stefan Richter wrote:
> 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?

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-11-05  4:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-05  0:26 host lock in EH Stefan Richter
2005-11-05  4:55 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).