* scsi_scan_host will hang up my system!
@ 2006-09-20 3:46 crazyrushstar
2006-09-20 3:48 ` Matthew Wilcox
0 siblings, 1 reply; 7+ messages in thread
From: crazyrushstar @ 2006-09-20 3:46 UTC (permalink / raw)
To: linux-scsi
I am writing a driver for our product.
After research various drivers, I start to write my
driver.
Now when I instert my driver, my linux will stick with
this insmod cmd.
I trace this is due to this scsi_host_scan function.
Does this function require any speical parameter or
setting?
Does someone can advise me where the document of "scsi
related" is?
My driver is base on "linux device drivers,
3e"(O'REILLY). This book does not reference to scsi.
scsi_host_template
scsi_scan_host()
scsi_host_put()
Many functions ware uesd without really understand
what are they.
Thanks for your advice.
___________________________________________________
您的生活即時通 - 溝通、娛樂、生活、工作一次搞定!
http://messenger.yahoo.com.tw/
-
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] 7+ messages in thread
* Re: scsi_scan_host will hang up my system!
2006-09-20 3:46 scsi_scan_host will hang up my system! crazyrushstar
@ 2006-09-20 3:48 ` Matthew Wilcox
2006-09-20 4:07 ` Karen Shaeffer
0 siblings, 1 reply; 7+ messages in thread
From: Matthew Wilcox @ 2006-09-20 3:48 UTC (permalink / raw)
To: crazyrushstar; +Cc: linux-scsi
On Wed, Sep 20, 2006 at 11:46:13AM +0800, crazyrushstar@yahoo.com.tw wrote:
> Does someone can advise me where the document of "scsi
> related" is?
Documentation/scsi/scsi_mid_low_api.txt was of immense help to me.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: scsi_scan_host will hang up my system!
2006-09-20 3:48 ` Matthew Wilcox
@ 2006-09-20 4:07 ` Karen Shaeffer
2006-09-20 5:06 ` crazyrushstar
0 siblings, 1 reply; 7+ messages in thread
From: Karen Shaeffer @ 2006-09-20 4:07 UTC (permalink / raw)
To: linux-scsi
On Tue, Sep 19, 2006 at 09:48:46PM -0600, Matthew Wilcox wrote:
> On Wed, Sep 20, 2006 at 11:46:13AM +0800, crazyrushstar@yahoo.com.tw wrote:
> > Does someone can advise me where the document of "scsi
> > related" is?
>
> Documentation/scsi/scsi_mid_low_api.txt was of immense help to me.
I would agree that documentation is well worth reading. I also would
purchase the applicable scsi standards.
http://www.t10.org/
You have to go to the referred links from there to actually buy
the standards. Those are very worth reading also. Actually well
written and easy to assimilate. And, after all, the code is
supposed to implement those standards -- so I would think
everyone on this list has them. (smiles ;)
Then all you have to do is work with the source code. Have fun.
Thanks,
Karen
--
Karen Shaeffer
Neuralscape, Palo Alto, Ca. 94306
shaeffer@neuralscape.com http://www.neuralscape.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: scsi_scan_host will hang up my system!
2006-09-20 4:07 ` Karen Shaeffer
@ 2006-09-20 5:06 ` crazyrushstar
2006-09-22 11:11 ` Stefan Richter
0 siblings, 1 reply; 7+ messages in thread
From: crazyrushstar @ 2006-09-20 5:06 UTC (permalink / raw)
To: linux-scsi
--- Karen Shaeffer <shaeffer@neuralscape.com> 說:
> On Tue, Sep 19, 2006 at 09:48:46PM -0600, Matthew
> Wilcox wrote:
> > On Wed, Sep 20, 2006 at 11:46:13AM +0800,
> crazyrushstar@yahoo.com.tw wrote:
> > > Does someone can advise me where the document of
> "scsi
> > > related" is?
> >
> > Documentation/scsi/scsi_mid_low_api.txt was of
> immense help to me.
>
> I would agree that documentation is well worth
> reading. I also would
> purchase the applicable scsi standards.
>
> http://www.t10.org/
>
> You have to go to the referred links from there to
> actually buy
> the standards. Those are very worth reading also.
> Actually well
> written and easy to assimilate. And, after all, the
> code is
> supposed to implement those standards -- so I would
> think
> everyone on this list has them. (smiles ;)
>
> Then all you have to do is work with the source
> code. Have fun.
>
> Thanks,
> Karen
> --
> Karen Shaeffer
> Neuralscape, Palo Alto, Ca. 94306
> shaeffer@neuralscape.com
> http://www.neuralscape.com
Thank you all very much
I have google out a link
"http://www.mjmwired.net/kernel/Documentation/scsi/scsi_mid_low_api.txt"
I will read this right now, hope can solve this
problem.
By the way, I have read T10 before, Because of
writting pci option rom and so on. It is really a
basic document for a scsi device developer wherether.
___________________________________________________
您的生活即時通 - 溝通、娛樂、生活、工作一次搞定!
http://messenger.yahoo.com.tw/
-
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] 7+ messages in thread
* Re: scsi_scan_host will hang up my system!
2006-09-20 5:06 ` crazyrushstar
@ 2006-09-22 11:11 ` Stefan Richter
2006-09-26 3:40 ` crazyrushstar
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Richter @ 2006-09-22 11:11 UTC (permalink / raw)
To: crazyrushstar; +Cc: linux-scsi, Matthew Wilcox, Karen Shaeffer
crazyrushstar@yahoo.com.tw wrote:
> --- Karen Shaeffer <shaeffer@neuralscape.com> 說:
>> On Tue, Sep 19, 2006 at 09:48:46PM -0600, Matthew
>> Wilcox wrote:
>>> Documentation/scsi/scsi_mid_low_api.txt was of
>>> immense help to me.
This document is indeed essential for low-level driver development.
However it doesn't (can't) tell you how to avoid some types of deadlocks.
Crazyrushstar, I can't give specific advise about scsi_scan_host() since
the code I'm maintaining (sbp2) doesn't use it. However I have some
basic suggestions:
- Consider your driver a layer between Linux' SCSI core (higher level)
and the interconnect software/firmware/hardware, e.g. PCI layer (lower
level). Make sure that you first bring up the lower level, then the
higher level. Vice versa, bring down the higher level before the lower
level on driver shutdown.
- AFAIU your driver and everything below it has to be fully able to
transfer commands, data and status before it calls scsi_scan_host().
- Also keep the layer paradigm in mind when you design the locking in
your driver. Watch out for the host lock which the SCSI core will use on
several occasions and which your driver may have to use on some
occasions. (The low-level driver I'm maintaining doesn't touch the host
lock.) A clearly layered design helps to avoid deadlocks.
- Don't use the scsi_block_requests()/ scsi_unblock_requests() API.
(The code I'm maintaining is using these, and it is a nightmare because
it easily leads into deadlocks. I will rework that driver to not use
these calls anymore.) The scsi_block_requests()/ scsi_unblock_requests()
API manipulates host state on a low level, subverting the SCSI core's
assumptions about host/ target/ LU states. This and similar
manipulations of host/ target/ LU state are better _not_ done in a SCSI
low-level driver.
...
>> I also would purchase the applicable scsi standards.
>>
>> http://www.t10.org/
The drafts at http://www.t10.org/ftp/t10/drafts/ may suffice too, at
least to get started.
...
> I have google out a link
> "http://www.mjmwired.net/kernel/Documentation/scsi/scsi_mid_low_api.txt"
...
"Documentation/" is a subdirectory of the Linux kernel source distribution.
Another essential resource are of course the sources themselves. Good
tools to browse the code are Cscope or KScope or LXR:
http://free-electrons.com/community/kernel/lxr
You certainly already read the sources in include/scsi/.
--
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] 7+ messages in thread
* Re: scsi_scan_host will hang up my system!
2006-09-22 11:11 ` Stefan Richter
@ 2006-09-26 3:40 ` crazyrushstar
0 siblings, 0 replies; 7+ messages in thread
From: crazyrushstar @ 2006-09-26 3:40 UTC (permalink / raw)
To: linux-scsi
--- Stefan Richter <stefanr@s5r6.in-berlin.de> 說:
> crazyrushstar@yahoo.com.tw wrote:
> > --- Karen Shaeffer <shaeffer@neuralscape.com> 說:
> >> On Tue, Sep 19, 2006 at 09:48:46PM -0600, Matthew
> >> Wilcox wrote:
> >>> Documentation/scsi/scsi_mid_low_api.txt was of
> >>> immense help to me.
>
> This document is indeed essential for low-level
> driver development.
> However it doesn't (can't) tell you how to avoid
> some types of deadlocks.
>
> Crazyrushstar, I can't give specific advise about
> scsi_scan_host() since
> the code I'm maintaining (sbp2) doesn't use it.
> However I have some
> basic suggestions:
>
> - Consider your driver a layer between Linux' SCSI
> core (higher level)
> and the interconnect software/firmware/hardware,
> e.g. PCI layer (lower
> level). Make sure that you first bring up the lower
> level, then the
> higher level. Vice versa, bring down the higher
> level before the lower
> level on driver shutdown.
>
> - AFAIU your driver and everything below it has to
> be fully able to
> transfer commands, data and status before it calls
> scsi_scan_host().
>
> - Also keep the layer paradigm in mind when you
> design the locking in
> your driver. Watch out for the host lock which the
> SCSI core will use on
> several occasions and which your driver may have to
> use on some
> occasions. (The low-level driver I'm maintaining
> doesn't touch the host
> lock.) A clearly layered design helps to avoid
> deadlocks.
>
> - Don't use the scsi_block_requests()/
> scsi_unblock_requests() API.
> (The code I'm maintaining is using these, and it is
> a nightmare because
> it easily leads into deadlocks. I will rework that
> driver to not use
> these calls anymore.) The scsi_block_requests()/
> scsi_unblock_requests()
> API manipulates host state on a low level,
> subverting the SCSI core's
> assumptions about host/ target/ LU states. This and
> similar
> manipulations of host/ target/ LU state are better
> _not_ done in a SCSI
> low-level driver.
>
> ...
> >> I also would purchase the applicable scsi
> standards.
> >>
> >> http://www.t10.org/
>
> The drafts at http://www.t10.org/ftp/t10/drafts/ may
> suffice too, at
> least to get started.
>
> ...
> > I have google out a link
> >
>
"http://www.mjmwired.net/kernel/Documentation/scsi/scsi_mid_low_api.txt"
> ...
>
> "Documentation/" is a subdirectory of the Linux
> kernel source distribution.
>
> Another essential resource are of course the sources
> themselves. Good
> tools to browse the code are Cscope or KScope or
> LXR:
> http://free-electrons.com/community/kernel/lxr
>
> You certainly already read the sources in
> include/scsi/.
> --
> Stefan Richter
> -=====-=-==- =--= =--==
> http://arcgraph.de/sr/
>
Now I have make my driver work well under a
environment without a lun(This is a RAID card). After
insmod , inquery(12H) , report lun(A0H) received 8
times. Syetem is alive.
If I insmod after make a lun, system will hangup
within 2 secends. All message printed by printk wont
show so that I dont know where is wrong.
I Use "tail -f /var/log/messages &" to observe kernel
log.
I have debug two days, but no more ideas for this
situation.
___________________________________________________
您的生活即時通 - 溝通、娛樂、生活、工作一次搞定!
http://messenger.yahoo.com.tw/
-
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] 7+ messages in thread
* Re: scsi_scan_host will hang up my system!
[not found] <20060926033733.30229.qmail@web18311.mail.tpe.yahoo.com>
@ 2006-09-26 7:28 ` Stefan Richter
0 siblings, 0 replies; 7+ messages in thread
From: Stefan Richter @ 2006-09-26 7:28 UTC (permalink / raw)
To: crazyrushstar; +Cc: linux-scsi
Please reply to the list, not in private.
crazyrushstar@yahoo.com.tw wrote:
> Now I have make my driver work well under a
> environment without a lun(This is a RAID card). After
> insmod , inquery(12H) , report lun(A0H) received 8
> times. Syetem is alive.
>
> If I insmod after make a lun, system will hangup
> within 2 secends. All message printed by printk wont
> show so that I dont know where is wrong.
>
> I Use "tail -f /var/log/messages &" to observe kernel
> log.
...
Probably an interrupt handler is hanging.
Set up a serial console or netconsole or debug via FireWire.
Or simply switch to a text console (IOW to a VGA console or framebuffer
console, not an X11 terminal) and let klogd log directly to it. This may
give you at least parts of the last messages. I think it goes like this:
# killall klogd
# klogd
# modprobe yourmodule
--
Stefan Richter
-=====-=-==- =--= ==-=-
http://arcgraph.de/sr/
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-09-26 7:29 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-20 3:46 scsi_scan_host will hang up my system! crazyrushstar
2006-09-20 3:48 ` Matthew Wilcox
2006-09-20 4:07 ` Karen Shaeffer
2006-09-20 5:06 ` crazyrushstar
2006-09-22 11:11 ` Stefan Richter
2006-09-26 3:40 ` crazyrushstar
[not found] <20060926033733.30229.qmail@web18311.mail.tpe.yahoo.com>
2006-09-26 7:28 ` Stefan Richter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox