diff options
author | mav <mav@FreeBSD.org> | 2013-01-11 19:11:56 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2013-01-11 19:11:56 +0000 |
commit | 74a37192c1ed61caaf37eda3424567138533cdfb (patch) | |
tree | 1175fcdce194581e40394c73a8db2f5609bdd6fc /sys/cam | |
parent | 29b3d8996d7dcf7db3443c3be67174f6eb4c89c9 (diff) | |
download | FreeBSD-src-74a37192c1ed61caaf37eda3424567138533cdfb.zip FreeBSD-src-74a37192c1ed61caaf37eda3424567138533cdfb.tar.gz |
- Add missig xpt_schedule() call for cases when requested immediate CCB
priority is lower then payload/TUR one.
- Reduce TUR priority and avoid sending them if there are any other
outstanding commands, alike to DA driver.
Diffstat (limited to 'sys/cam')
-rw-r--r-- | sys/cam/scsi/scsi_cd.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index d5d7156..a7c4c5b 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -581,7 +581,7 @@ cdasync(void *callback_arg, u_int32_t code, if (softc->state == CD_STATE_NORMAL && !softc->tur) { if (cam_periph_acquire(periph) == CAM_REQ_CMP) { softc->tur = 1; - xpt_schedule(periph, CAM_PRIORITY_DEV); + xpt_schedule(periph, CAM_PRIORITY_NORMAL); } } /* FALLTHROUGH */ @@ -1612,9 +1612,11 @@ cdstart(struct cam_periph *periph, union ccb *start_ccb) xpt_action(start_ccb); } - if (bp != NULL || softc->tur) { + if (bp != NULL || softc->tur || + periph->immediate_priority != CAM_PRIORITY_NONE) { /* Have more work to do, so ensure we stay scheduled */ - xpt_schedule(periph, CAM_PRIORITY_NORMAL); + xpt_schedule(periph, min(CAM_PRIORITY_NORMAL, + periph->immediate_priority)); } break; } @@ -3293,10 +3295,11 @@ cdmediapoll(void *arg) if (softc->flags & CD_FLAG_CHANGER) return; - if (softc->state == CD_STATE_NORMAL && !softc->tur) { + if (softc->state == CD_STATE_NORMAL && !softc->tur && + softc->outstanding_cmds == 0) { if (cam_periph_acquire(periph) == CAM_REQ_CMP) { softc->tur = 1; - xpt_schedule(periph, CAM_PRIORITY_DEV); + xpt_schedule(periph, CAM_PRIORITY_NORMAL); } } /* Queue us up again */ |