Change the TIMEOUT constants from ticks to seconds, change the input
unit of ommmc_wait_intr() from ticks to seconds, and change tsleep(9)
to tsleep_nsec(9).
ok?
Index: arch/armv7/omap/ommmc.c
===================================================================
RCS file: /cvs/src/sys/arch/armv7/omap/ommmc.c,v
retrieving revision 1.31
diff -u -p -r1.31 ommmc.c
--- arch/armv7/omap/ommmc.c 21 Jan 2017 05:42:03 -0000 1.31
+++ arch/armv7/omap/ommmc.c 11 Jan 2020 00:09:10 -0000
@@ -180,9 +180,10 @@
#define MMCHS_CUR_CAPA 0x148
#define MMCHS_REV 0x1fc
-#define SDHC_COMMAND_TIMEOUT hz
-#define SDHC_BUFFER_TIMEOUT hz
-#define SDHC_TRANSFER_TIMEOUT hz
+/* Timeouts in seconds. */
+#define SDHC_COMMAND_TIMEOUT 1
+#define SDHC_BUFFER_TIMEOUT 1
+#define SDHC_TRANSFER_TIMEOUT 1
int ommmc_match(struct device *, void *, void *);
void ommmc_attach(struct device *, struct device *, void *);
@@ -1123,17 +1124,19 @@ ommmc_soft_reset(struct ommmc_softc *sc,
}
int
-ommmc_wait_intr(struct ommmc_softc *sc, int mask, int timo)
+ommmc_wait_intr(struct ommmc_softc *sc, int mask, int secs)
{
+ uint64_t nsecs;
int status;
int s;
mask |= MMCHS_STAT_ERRI;
+ nsecs = SEC_TO_NSEC(secs);
s = splsdmmc();
status = sc->intr_status & mask;
while (status == 0) {
- if (tsleep(&sc->intr_status, PWAIT, "hcintr", timo)
+ if (tsleep_nsec(&sc->intr_status, PWAIT, "hcintr", nsecs)
== EWOULDBLOCK) {
status |= MMCHS_STAT_ERRI;
break;