diff options
-rw-r--r-- | sys/cam/ata/ata_da.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index c0be395..b1d5ea8 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -484,12 +484,20 @@ static void adaschedule(struct cam_periph *periph) { struct ada_softc *softc = (struct ada_softc *)periph->softc; + uint32_t prio; + /* Check if cam_periph_getccb() was called. */ + prio = periph->immediate_priority; + + /* Check if we have more work to do. */ if (bioq_first(&softc->bio_queue) || (!softc->trim_running && bioq_first(&softc->trim_queue))) { - /* Have more work to do, so ensure we stay scheduled */ - xpt_schedule(periph, CAM_PRIORITY_NORMAL); + prio = CAM_PRIORITY_NORMAL; } + + /* Schedule CCB if any of above is true. */ + if (prio != CAM_PRIORITY_NONE) + xpt_schedule(periph, prio); } /* |