PERFORCE change 102914 for review

Paolo Pisati piso at FreeBSD.org
Tue Aug 1 10:11:40 UTC 2006


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

Change 102914 by piso at piso_newluxor on 2006/08/01 10:11:37

	Setting up a filtered interrupt can't fail
	anymore: axe the fall back branch and the taskqueue
	related code.
	While here, mask/unmask correctly the interrupts in the 
	filter+ithread case.

Affected files ...

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

Differences ...

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

@@ -74,8 +74,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 void	aac_complete(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);
@@ -261,11 +260,6 @@
 	aac_initq_busy(sc);
 	aac_initq_bio(sc);
 
-	/*
-	 * Initialise command-completion task.
-	 */
-	TASK_INIT(&sc->aac_task_complete, 0, aac_complete, sc);
-
 	/* mark controller as suspended until we get ourselves organised */
 	sc->aac_state |= AAC_STATE_SUSPEND;
 
@@ -314,17 +308,11 @@
 	} else {
 		if (bus_setup_intr(sc->aac_dev, sc->aac_irq,
 				   INTR_TYPE_BIO, 
-				   aac_fast_intr, aac_complete_wrapper,
+				   aac_fast_intr, aac_complete,
 				   sc, &sc->aac_intr)) {
 			device_printf(sc->aac_dev,
-				      "can't set up FAST interrupt\n");
-			if (bus_setup_intr(sc->aac_dev, sc->aac_irq,
-					   INTR_MPSAFE|INTR_TYPE_BIO,
-					   NULL, aac_intr, sc, &sc->aac_intr)) {
-				device_printf(sc->aac_dev,
-					     "can't set up MPSAFE interrupt\n");
-				return (EINVAL);
-			}
+				      "can't set up FILTERed handler\n");
+			return (EINVAL);
 		}
 	}
 
@@ -826,6 +814,8 @@
 		 */
 		wakeup(sc->aifthread);
 	}
+	if (ret & FILTER_SCHEDULE_THREAD)
+		AAC_MASK_INTERRUPTS(sc);
 	return((ret)?ret:FILTER_STRAY);
 }
 
@@ -1044,7 +1034,7 @@
  * Process completed commands.
  */
 static void
-aac_complete(void *context, int pending)
+aac_complete(void *context)
 {
 	struct aac_softc *sc;
 	struct aac_command *cm;
@@ -1089,12 +1079,7 @@
 	aac_startio(sc);
 
 	mtx_unlock(&sc->aac_io_lock);
-}
-
-static void
-aac_complete_wrapper(void *context)
-{
-	aac_complete(context, 0);
+	AAC_UNMASK_INTERRUPTS(sc);
 }
 
 /*


More information about the p4-projects mailing list