public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* two SCSI HBAs having same host no in Linux 2.4 kernel
@ 2004-03-17 14:10 N.C.Krishna Murthy
  2004-03-17 14:46 ` Matthew Wilcox
  0 siblings, 1 reply; 3+ messages in thread
From: N.C.Krishna Murthy @ 2004-03-17 14:10 UTC (permalink / raw)
  To: SCSI -DEVELOPERS

Hi,
	In 2.4 kernel ,a scsi HBA driver gets it's host no after scsi_register() call 
returns.
The call to scsi_register is made from the driver's 'detect' routine.
scsi_register_host calls the driver's 'detect' routine.

The following is an excerpt from scsi_register_host which does the above job.
-----------------------------------------------------------------------------
if (tpnt->use_new_eh_code) {
                spin_lock_irqsave(&io_request_lock, flags);
                tpnt->present = tpnt->detect(tpnt);
                spin_unlock_irqrestore(&io_request_lock, flags);
        } else
                tpnt->present = tpnt->detect(tpnt);
-----------------------------------------------------------------------------
In case of drivers which do not support new_eh_code, 'detect' is called
without any locks. Is this SMP safe? 

We were testing our iSCSI driver on an SMP machine which had a FC HBA as well.
Both iSCSI driver and FC HBA had the same host no allocated. The behaviour
could not be reproduced consistently though. 

Please let me know in case I am missing something.


Thanx
N.C.Krishna Murthy


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

* Re: two SCSI HBAs having same host no in Linux 2.4 kernel
  2004-03-17 14:10 two SCSI HBAs having same host no in Linux 2.4 kernel N.C.Krishna Murthy
@ 2004-03-17 14:46 ` Matthew Wilcox
  2004-03-17 14:48   ` N.C.Krishna Murthy
  0 siblings, 1 reply; 3+ messages in thread
From: Matthew Wilcox @ 2004-03-17 14:46 UTC (permalink / raw)
  To: N.C.Krishna Murthy; +Cc: SCSI -DEVELOPERS

On Wed, Mar 17, 2004 at 07:40:23PM +0530, N.C.Krishna Murthy wrote:
> In case of drivers which do not support new_eh_code, 'detect' is called
> without any locks. Is this SMP safe? 

... why aren't you using the new_eh_code?

I suspect the answer is that this is part of the transition; that old
drivers were expected to have their own lock inside ->detect and new
ones don't.  But I wasn't around for that, so I'm not sure.

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain

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

* Re: two SCSI HBAs having same host no in Linux 2.4 kernel
  2004-03-17 14:46 ` Matthew Wilcox
@ 2004-03-17 14:48   ` N.C.Krishna Murthy
  0 siblings, 0 replies; 3+ messages in thread
From: N.C.Krishna Murthy @ 2004-03-17 14:48 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: SCSI -DEVELOPERS

Hi,
	Our iSCSI driver does use new_eh_code.
Thanx
N.C.Krishna Murthy

On Wednesday 17 Mar 2004 8:16 pm, Matthew Wilcox wrote:
> On Wed, Mar 17, 2004 at 07:40:23PM +0530, N.C.Krishna Murthy wrote:
> > In case of drivers which do not support new_eh_code, 'detect' is called
> > without any locks. Is this SMP safe?
>
> ... why aren't you using the new_eh_code?
>
> I suspect the answer is that this is part of the transition; that old
> drivers were expected to have their own lock inside ->detect and new
> ones don't.  But I wasn't around for that, so I'm not sure.

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

end of thread, other threads:[~2004-03-17 14:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-17 14:10 two SCSI HBAs having same host no in Linux 2.4 kernel N.C.Krishna Murthy
2004-03-17 14:46 ` Matthew Wilcox
2004-03-17 14:48   ` N.C.Krishna Murthy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox