Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MFC: r256743, r256744

MFP4:
Change 227594 by brooks@brooks_zenith on 2013/04/11 17:10:14

	When we fail, print the error that occurred if we are giving
	up or if bootverbose is set.

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 immediately
	for success of I/O operations rather than queuing a task.

Sponsored by:   DARPA/AFRL
Approved by:	re (glebius)
  • Loading branch information...
commit 01a0280e092297cd5e8debd6c8df9def66d08ca7 1 parent c291b4b
@brooksdavis brooksdavis authored
View
1  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
View
18 sys/dev/altera/sdcard/altera_sdcard.c
@@ -31,6 +31,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_altera_sdcard.h"
+
#include <sys/param.h>
#include <sys/bus.h>
#include <sys/condvar.h>
@@ -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);
}
View
15 sys/dev/altera/sdcard/altera_sdcard_io.c
@@ -390,20 +390,23 @@ altera_sdcard_io_complete(struct altera_sdcard_softc *sc, uint16_t asr)
break;
}
if (error) {
+ sc->as_retriesleft--;
+ if (sc->as_retriesleft == 0 || bootverbose)
+ device_printf(sc->as_dev, "%s: %s operation block %ju "
+ "length %ju failed; asr 0x%08x (rr1: 0x%04x)%s\n",
+ __func__, bp->bio_cmd == BIO_READ ? "BIO_READ" :
+ (bp->bio_cmd == BIO_WRITE ? "BIO_WRITE" :
+ "unknown"),
+ bp->bio_pblkno, bp->bio_bcount, asr, rr1,
+ sc->as_retriesleft != 0 ? " retrying" : "");
/*
* This attempt experienced an error; possibly retry.
*/
- sc->as_retriesleft--;
if (sc->as_retriesleft != 0) {
sc->as_flags |= ALTERA_SDCARD_FLAG_IOERROR;
altera_sdcard_io_start_internal(sc, bp);
return (0);
}
- device_printf(sc->as_dev, "%s: %s operation block %ju length "
- "%ju failed; asr 0x%08x (rr1: 0x%04x)\n", __func__,
- bp->bio_cmd == BIO_READ ? "BIO_READ" :
- (bp->bio_cmd == BIO_WRITE ? "BIO_WRITE" : "unknown"),
- bp->bio_pblkno, bp->bio_bcount, asr, rr1);
sc->as_flags &= ~ALTERA_SDCARD_FLAG_IOERROR;
} else {
/*

0 comments on commit 01a0280

Please sign in to comment.
Something went wrong with that request. Please try again.