Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Oct 2009 15:40:04 +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: r197838 - in head/sys/dev: ahci siis
Message-ID:  <200910071540.n97Fe4xN088962@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Wed Oct  7 15:40:04 2009
New Revision: 197838
URL: http://svn.freebsd.org/changeset/base/197838

Log:
  On command timeout handle frozen command first, to not run it inside
  XXX_end_transaction().
  
  Submitted by:	avg

Modified:
  head/sys/dev/ahci/ahci.c
  head/sys/dev/siis/siis.c

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c	Wed Oct  7 14:29:48 2009	(r197837)
+++ head/sys/dev/ahci/ahci.c	Wed Oct  7 15:40:04 2009	(r197838)
@@ -1259,15 +1259,16 @@ ahci_timeout(struct ahci_slot *slot)
 
 	if (!ch->readlog)
 		xpt_freeze_simq(ch->sim, ch->numrslots);
-	/* Handle command with timeout. */
-	ahci_end_transaction(&ch->slot[slot->slot], AHCI_ERR_TIMEOUT);
-	/* Handle the rest of commands. */
+	/* Handle frozen command. */
 	if (ch->frozen) {
 		union ccb *fccb = ch->frozen;
 		ch->frozen = NULL;
 		fccb->ccb_h.status = CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ;
 		xpt_done(fccb);
 	}
+	/* Handle command with timeout. */
+	ahci_end_transaction(&ch->slot[slot->slot], AHCI_ERR_TIMEOUT);
+	/* Handle the rest of commands. */
 	for (i = 0; i < ch->numslots; i++) {
 		/* Do we have a running request on slot? */
 		if (ch->slot[i].state < AHCI_SLOT_RUNNING)

Modified: head/sys/dev/siis/siis.c
==============================================================================
--- head/sys/dev/siis/siis.c	Wed Oct  7 14:29:48 2009	(r197837)
+++ head/sys/dev/siis/siis.c	Wed Oct  7 15:40:04 2009	(r197838)
@@ -982,15 +982,16 @@ device_printf(dev, "%s is %08x ss %08x r
 
 	if (!ch->readlog)
 		xpt_freeze_simq(ch->sim, ch->numrslots);
-	/* Handle command with timeout. */
-	siis_end_transaction(&ch->slot[slot->slot], SIIS_ERR_TIMEOUT);
-	/* Handle the rest of commands. */
+	/* Handle frozen command. */
 	if (ch->frozen) {
 		union ccb *fccb = ch->frozen;
 		ch->frozen = NULL;
 		fccb->ccb_h.status = CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ;
 		xpt_done(fccb);
 	}
+	/* Handle command with timeout. */
+	siis_end_transaction(&ch->slot[slot->slot], SIIS_ERR_TIMEOUT);
+	/* Handle the rest of commands. */
 	for (i = 0; i < SIIS_MAX_SLOTS; i++) {
 		/* Do we have a running request on slot? */
 		if (ch->slot[i].state < SIIS_SLOT_RUNNING)



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