Date: Mon, 3 Mar 2003 12:36:50 -0800 (PST) From: Nate Lawson <nate@root.org> To: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp> Cc: non@ever.sanda.gr.jp, freebsd-scsi@freebsd.org Subject: Re: call scan_bus in interrupt context. Message-ID: <Pine.BSF.4.21.0303031234370.78538-100000@root.org> In-Reply-To: <ybsk7fml4xu.wl@ett.sat.t.u-tokyo.ac.jp>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 27 Feb 2003, Hidetoshi Shimokawa wrote: > At Wed, 26 Feb 2003 13:07:21 +0900, > non@ever.sanda.gr.jp wrote: > > > > From: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp> > > Date: Wed, 26 Feb 2003 12:43:26 +0900 > > > I have a question about XPT_SCAN_BUS in CAM. > > > I need to initiate a bus scan from a interrupt context but xpt_alloc_ccb() > > > failed because it calls malloc with M_WAITOK. > > > (kernel panics if you compile it with INVARIANTS in 4-stable) > > > > Does scsi_low_rescan_bus_cam() in sys/cam/scsi/scsi_low.c help ? > > This is almost same as I did except I used M_NOWAIT flags for > malloc(). XPT_SCAN_BUS cannot be used in an interrupt context. > > Anyway, I implemented scan_target function using XPT_SCAN_LUN which > can be used in an interrupt context. It's ok for now. I waited for someone else to ask this question but no one did so I will: "Why do you have to do this?" Couldn't you use a condition variable to signal a kthread telling it "rescan needed"? Could you set a flag that rescan is needed and check it in the open() call and perform a rescan there if necessary? I see a lot of ways to avoid rescanning in an interrupt context. -Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0303031234370.78538-100000>