From e908804339e365058f8b06216fbbd24f8336f418 Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Fri, 18 Oct 2013 15:27:11 +0000 Subject: [PATCH] MFP4 (driver change only): Change 231100 by brooks@brooks_zenith on 2013/07/12 21:01:31 Add a new option ALTERA_SDCARD_FAST_SIM which checks immediatly for success of I/O operations rather than queuing a task. MFC after: 3 days Sponsored by: DARPA/AFRL --- sys/conf/options | 1 + sys/dev/altera/sdcard/altera_sdcard.c | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/sys/conf/options b/sys/conf/options index ff011448a7f2..1009f5ba8dc6 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -68,6 +68,7 @@ TEXTDUMP_VERBOSE opt_ddb.h # Miscellaneous options. ADAPTIVE_LOCKMGRS ALQ +ALTERA_SDCARD_FAST_SIM opt_altera_sdcard.h AUDIT opt_global.h BOOTHOWTO opt_global.h BOOTVERBOSE opt_global.h diff --git a/sys/dev/altera/sdcard/altera_sdcard.c b/sys/dev/altera/sdcard/altera_sdcard.c index f64b9c51ab95..45088451bc33 100644 --- a/sys/dev/altera/sdcard/altera_sdcard.c +++ b/sys/dev/altera/sdcard/altera_sdcard.c @@ -31,6 +31,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_altera_sdcard.h" + #include #include #include @@ -258,6 +260,9 @@ altera_sdcard_task_io(struct altera_sdcard_softc *sc) ALTERA_SDCARD_LOCK_ASSERT(sc); KASSERT(sc->as_currentbio != NULL, ("%s: no current I/O", __func__)); +#ifdef ALTERA_SDCARD_FAST_SIM +recheck: +#endif asr = altera_sdcard_read_asr(sc); /* @@ -299,9 +304,12 @@ altera_sdcard_task_io(struct altera_sdcard_softc *sc) /* * Finally, either start the next I/O or transition to the IDLE state. */ - if (bioq_first(&sc->as_bioq) != NULL) + if (bioq_first(&sc->as_bioq) != NULL) { altera_sdcard_nextio(sc); - else +#ifdef ALTERA_SDCARD_FAST_SIM + goto recheck; +#endif + } else sc->as_state = ALTERA_SDCARD_STATE_IDLE; } @@ -398,6 +406,8 @@ altera_sdcard_start(struct altera_sdcard_softc *sc) taskqueue_cancel_timeout(sc->as_taskqueue, &sc->as_task, NULL); altera_sdcard_nextio(sc); - taskqueue_enqueue_timeout(sc->as_taskqueue, &sc->as_task, - ALTERA_SDCARD_TIMEOUT_IO); +#ifdef ALTERA_SDCARD_FAST_SIM + altera_sdcard_task_io(sc); +#endif + altera_sdcard_task_rechedule(sc); }