diff options
author | Alexander Motin <mav@FreeBSD.org> | 2009-11-04 15:40:19 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2009-11-04 15:40:19 +0000 |
commit | efa575b6be201f52e0956c4f4941554227557a56 (patch) | |
tree | 5c286fcbb463526d61b9742678c85dba406925ee /sys/cam/cam_xpt.c | |
parent | c1bd46c2d37b58621ee30075a6bb7262e83f2133 (diff) | |
download | src-efa575b6be201f52e0956c4f4941554227557a56.tar.gz src-efa575b6be201f52e0956c4f4941554227557a56.zip |
MFp4:
- Remove CAM_PERIPH_POLLED flag. It is broken by design. Polling can't be
periph flag. May be SIM, may be CCB, but now it works fine just without it.
- Remove check unused for at least five years. If we will ever have non-BIO
devices in CAM, this check is smallest of what we will need.
- If several controllers complete requests same time, call swi_sched()
only once.
Notes
Notes:
svn path=/head/; revision=198899
Diffstat (limited to 'sys/cam/cam_xpt.c')
-rw-r--r-- | sys/cam/cam_xpt.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 8c568ecc452e..e09308457a9a 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -4238,6 +4238,7 @@ void xpt_done(union ccb *done_ccb) { struct cam_sim *sim; + int first; CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("xpt_done\n")); if ((done_ccb->ccb_h.func_code & XPT_FC_QUEUED) != 0) { @@ -4246,25 +4247,17 @@ xpt_done(union ccb *done_ccb) * any of the "non-immediate" type of ccbs. */ sim = done_ccb->ccb_h.path->bus->sim; - switch (done_ccb->ccb_h.path->periph->type) { - case CAM_PERIPH_BIO: - TAILQ_INSERT_TAIL(&sim->sim_doneq, &done_ccb->ccb_h, - sim_links.tqe); - done_ccb->ccb_h.pinfo.index = CAM_DONEQ_INDEX; - if ((sim->flags & CAM_SIM_ON_DONEQ) == 0) { - mtx_lock(&cam_simq_lock); - TAILQ_INSERT_TAIL(&cam_simq, sim, - links); - mtx_unlock(&cam_simq_lock); - sim->flags |= CAM_SIM_ON_DONEQ; - if ((done_ccb->ccb_h.path->periph->flags & - CAM_PERIPH_POLLED) == 0) - swi_sched(cambio_ih, 0); - } - break; - default: - panic("unknown periph type %d", - done_ccb->ccb_h.path->periph->type); + TAILQ_INSERT_TAIL(&sim->sim_doneq, &done_ccb->ccb_h, + sim_links.tqe); + done_ccb->ccb_h.pinfo.index = CAM_DONEQ_INDEX; + if ((sim->flags & CAM_SIM_ON_DONEQ) == 0) { + mtx_lock(&cam_simq_lock); + first = TAILQ_EMPTY(&cam_simq); + TAILQ_INSERT_TAIL(&cam_simq, sim, links); + mtx_unlock(&cam_simq_lock); + sim->flags |= CAM_SIM_ON_DONEQ; + if (first) + swi_sched(cambio_ih, 0); } } } |