two SCSI HBAs having same host no in Linux 2.4 kernel
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
Quoted 2 lines · N.C.Krishna Murthy
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.
Signature · 6 lines
"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
Hi,
Our iSCSI driver does use new_eh_code.
Thanx
N.C.Krishna Murthy
Quoted 9 lines · Matthew Wilcox
Quoted 2 lines · N.C.Krishna Murthy
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.