PERFORCE change 102570 for review

Paolo Pisati piso at FreeBSD.org
Thu Jul 27 16:16:31 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=102570

Change 102570 by piso at piso_newluxor on 2006/07/27 16:16:12

	Turn fast+taskqueue handler into filter+ithread.

Affected files ...

.. //depot/projects/soc2006/intr_filter/dev/aac/aac.c#5 edit

Differences ...

==== //depot/projects/soc2006/intr_filter/dev/aac/aac.c#5 (text+ko) ====

@@ -75,6 +75,7 @@
 /* Command Processing */
 static void	aac_timeout(struct aac_softc *sc);
 static void	aac_complete(void *context, int pending);
+static void     aac_complete_wrapper(void *context);
 static int	aac_bio_command(struct aac_softc *sc, struct aac_command **cmp);
 static void	aac_bio_complete(struct aac_command *cm);
 static int	aac_wait_command(struct aac_command *cm);
@@ -313,7 +314,7 @@
 	} else {
 		if (bus_setup_intr(sc->aac_dev, sc->aac_irq,
 				   INTR_TYPE_BIO, 
-				   aac_fast_intr, NULL,
+				   aac_fast_intr, aac_complete_wrapper,
 				   sc, &sc->aac_intr)) {
 			device_printf(sc->aac_dev,
 				      "can't set up FAST interrupt\n");
@@ -786,7 +787,7 @@
 {
 	struct aac_softc *sc;
 	u_int16_t reason;
-	int flag = 0;
+	int ret = 0;
 
 	debug_called(2);
 
@@ -802,14 +803,12 @@
 	AAC_CLEAR_ISTATUS(sc, reason);
 
 	/* handle completion processing */
-	if (reason & AAC_DB_RESPONSE_READY) {
-		flag = 1;
-		taskqueue_enqueue_fast(taskqueue_fast, &sc->aac_task_complete);
-	}
+	if (reason & AAC_DB_RESPONSE_READY)
+		ret = FILTER_HANDLED | FILTER_SCHEDULE_THREAD; 
 
 	/* controller wants to talk to us */
 	if (reason & (AAC_DB_PRINTF | AAC_DB_COMMAND_READY)) {
-		flag = 1;
+		ret |= FILTER_HANDLED;
 		/*
 		 * XXX Make sure that we don't get fooled by strange messages
 		 * that start with a NULL.
@@ -827,7 +826,7 @@
 		 */
 		wakeup(sc->aifthread);
 	}
-	return((flag)?FILTER_HANDLED:FILTER_STRAY);
+	return((ret)?ret:FILTER_STRAY);
 }
 
 void
@@ -1092,6 +1091,12 @@
 	mtx_unlock(&sc->aac_io_lock);
 }
 
+static void
+aac_complete_wrapper(void *context)
+{
+	aac_complete(context, 0);
+}
+
 /*
  * Handle a bio submitted from a disk device.
  */


More information about the p4-projects mailing list