Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Jul 2011 21:42:53 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r224531 - head/sys/cam/ata
Message-ID:  <201107302142.p6ULgrbL016657@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat Jul 30 21:42:53 2011
New Revision: 224531
URL: http://svn.freebsd.org/changeset/base/224531

Log:
  Higher-priority initialization request can eat request scheduling done from
  adaclose(). Add immediate_priority check into adaschedule() to restore it.
  
  Approved by:	re (kib)
  MFC after:	1 week

Modified:
  head/sys/cam/ata/ata_da.c

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c	Sat Jul 30 21:28:34 2011	(r224530)
+++ head/sys/cam/ata/ata_da.c	Sat Jul 30 21:42:53 2011	(r224531)
@@ -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);
 }
 
 /*



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