Date: Thu, 31 Oct 2013 13:47:40 +0000 (UTC) From: Brooks Davis <brooks@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257445 - in stable/10/sys: conf dev/altera/sdcard Message-ID: <201310311347.r9VDle2r005666@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: brooks Date: Thu Oct 31 13:47:39 2013 New Revision: 257445 URL: http://svnweb.freebsd.org/changeset/base/257445 Log: 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) Modified: stable/10/sys/conf/options stable/10/sys/dev/altera/sdcard/altera_sdcard.c stable/10/sys/dev/altera/sdcard/altera_sdcard_io.c Directory Properties: stable/10/sys/ (props changed) stable/10/sys/conf/ (props changed) Modified: stable/10/sys/conf/options ============================================================================== --- stable/10/sys/conf/options Thu Oct 31 13:00:35 2013 (r257444) +++ stable/10/sys/conf/options Thu Oct 31 13:47:39 2013 (r257445) @@ -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 Modified: stable/10/sys/dev/altera/sdcard/altera_sdcard.c ============================================================================== --- stable/10/sys/dev/altera/sdcard/altera_sdcard.c Thu Oct 31 13:00:35 2013 (r257444) +++ stable/10/sys/dev/altera/sdcard/altera_sdcard.c Thu Oct 31 13:47:39 2013 (r257445) @@ -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_sdca 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_sdca /* * 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 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); } Modified: stable/10/sys/dev/altera/sdcard/altera_sdcard_io.c ============================================================================== --- stable/10/sys/dev/altera/sdcard/altera_sdcard_io.c Thu Oct 31 13:00:35 2013 (r257444) +++ stable/10/sys/dev/altera/sdcard/altera_sdcard_io.c Thu Oct 31 13:47:39 2013 (r257445) @@ -390,20 +390,23 @@ altera_sdcard_io_complete(struct altera_ 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 { /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310311347.r9VDle2r005666>