diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index f09713b0d0f5..12719edc4dc9 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -371,7 +371,6 @@ adadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t len } if (length > 0) { - periph->flags |= CAM_PERIPH_POLLED; xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); ccb.ccb_h.ccb_state = ADA_CCB_DUMP; cam_fill_ataio(&ccb.ataio, @@ -431,7 +430,6 @@ adadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t len /*timeout*/0, /*getcount_only*/0); } - periph->flags &= ~CAM_PERIPH_POLLED; cam_periph_unlock(periph); return (0); } diff --git a/sys/cam/cam_periph.h b/sys/cam/cam_periph.h index 258055f5bfc7..07caf52d08a5 100644 --- a/sys/cam/cam_periph.h +++ b/sys/cam/cam_periph.h @@ -117,7 +117,6 @@ struct cam_periph { #define CAM_PERIPH_INVALID 0x08 #define CAM_PERIPH_NEW_DEV_FOUND 0x10 #define CAM_PERIPH_RECOVERY_INPROG 0x20 -#define CAM_PERIPH_POLLED 0x40 u_int32_t immediate_priority; u_int32_t refcount; SLIST_HEAD(, ccb_hdr) ccb_list; /* For "immediate" requests */ 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); } } } diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 32ca51bb379c..d05376ee2959 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -859,7 +859,6 @@ dadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t leng } if (length > 0) { - periph->flags |= CAM_PERIPH_POLLED; xpt_setup_ccb(&csio.ccb_h, periph->path, CAM_PRIORITY_NORMAL); csio.ccb_h.ccb_state = DA_CCB_DUMP; scsi_read_write(&csio, @@ -885,7 +884,6 @@ dadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t leng else printf("status == 0x%x, scsi status == 0x%x\n", csio.ccb_h.status, csio.scsi_status); - periph->flags |= CAM_PERIPH_POLLED; return(EIO); } cam_periph_unlock(periph); @@ -929,7 +927,6 @@ dadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t leng } } } - periph->flags &= ~CAM_PERIPH_POLLED; cam_periph_unlock(periph); return (0); }