Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Apr 2013 11:53:54 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r249158 - stable/9/sys/cam/scsi
Message-ID:  <201304051153.r35BrsqC065976@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Fri Apr  5 11:53:53 2013
New Revision: 249158
URL: http://svnweb.freebsd.org/changeset/base/249158

Log:
  MFC r245310:
  - 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.

Modified:
  stable/9/sys/cam/scsi/scsi_cd.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/scsi/scsi_cd.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_cd.c	Fri Apr  5 11:52:33 2013	(r249157)
+++ stable/9/sys/cam/scsi/scsi_cd.c	Fri Apr  5 11:53:53 2013	(r249158)
@@ -581,7 +581,7 @@ cdasync(void *callback_arg, u_int32_t co
 		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
 
 			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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304051153.r35BrsqC065976>