Don't timeout waiting for ld_sdmmc_dobio in the IO thread to start.

XXX why does it take >1s to get scheduled?
This commit is contained in:
skrll 2015-07-27 07:53:46 +00:00
parent 4169abe3e4
commit a85df79f98
1 changed files with 2 additions and 33 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ld_sdmmc.c,v 1.16 2015/05/20 13:09:34 jmcneill Exp $ */ /* $NetBSD: ld_sdmmc.c,v 1.17 2015/07/27 07:53:46 skrll Exp $ */
/* /*
* Copyright (c) 2008 KIYOHARA Takashi * Copyright (c) 2008 KIYOHARA Takashi
@ -28,7 +28,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.16 2015/05/20 13:09:34 jmcneill Exp $"); __KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.17 2015/07/27 07:53:46 skrll Exp $");
#ifdef _KERNEL_OPT #ifdef _KERNEL_OPT
#include "opt_sdmmc.h" #include "opt_sdmmc.h"
@ -41,7 +41,6 @@ __KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.16 2015/05/20 13:09:34 jmcneill Exp $
#include <sys/buf.h> #include <sys/buf.h>
#include <sys/bufq.h> #include <sys/bufq.h>
#include <sys/bus.h> #include <sys/bus.h>
#include <sys/callout.h>
#include <sys/endian.h> #include <sys/endian.h>
#include <sys/dkio.h> #include <sys/dkio.h>
#include <sys/disk.h> #include <sys/disk.h>
@ -65,7 +64,6 @@ struct ld_sdmmc_task {
struct ld_sdmmc_softc *task_sc; struct ld_sdmmc_softc *task_sc;
struct buf *task_bp; struct buf *task_bp;
callout_t task_callout;
}; };
struct ld_sdmmc_softc { struct ld_sdmmc_softc {
@ -85,7 +83,6 @@ static int ld_sdmmc_start(struct ld_softc *, struct buf *);
static void ld_sdmmc_doattach(void *); static void ld_sdmmc_doattach(void *);
static void ld_sdmmc_dobio(void *); static void ld_sdmmc_dobio(void *);
static void ld_sdmmc_timeout(void *);
CFATTACH_DECL_NEW(ld_sdmmc, sizeof(struct ld_sdmmc_softc), CFATTACH_DECL_NEW(ld_sdmmc, sizeof(struct ld_sdmmc_softc),
ld_sdmmc_match, ld_sdmmc_attach, ld_sdmmc_detach, NULL); ld_sdmmc_match, ld_sdmmc_attach, ld_sdmmc_detach, NULL);
@ -118,8 +115,6 @@ ld_sdmmc_attach(device_t parent, device_t self, void *aux)
sa->sf->cid.rev, sa->sf->cid.psn, sa->sf->cid.mdt); sa->sf->cid.rev, sa->sf->cid.psn, sa->sf->cid.mdt);
aprint_naive("\n"); aprint_naive("\n");
callout_init(&sc->sc_task.task_callout, 0);
sc->sc_hwunit = 0; /* always 0? */ sc->sc_hwunit = 0; /* always 0? */
sc->sc_sf = sa->sf; sc->sc_sf = sa->sf;
@ -185,7 +180,6 @@ ld_sdmmc_start(struct ld_softc *ld, struct buf *bp)
task->task_bp = bp; task->task_bp = bp;
sdmmc_init_task(&task->task, ld_sdmmc_dobio, task); sdmmc_init_task(&task->task, ld_sdmmc_dobio, task);
callout_reset(&task->task_callout, hz, ld_sdmmc_timeout, task);
sdmmc_add_task(sc->sc_sf->sc, &task->task); sdmmc_add_task(sc->sc_sf->sc, &task->task);
return 0; return 0;
@ -199,8 +193,6 @@ ld_sdmmc_dobio(void *arg)
struct buf *bp = task->task_bp; struct buf *bp = task->task_bp;
int error, s; int error, s;
callout_stop(&task->task_callout);
/* /*
* I/O operation * I/O operation
*/ */
@ -242,29 +234,6 @@ ld_sdmmc_dobio(void *arg)
splx(s); splx(s);
} }
static void
ld_sdmmc_timeout(void *arg)
{
struct ld_sdmmc_task *task = (struct ld_sdmmc_task *)arg;
struct ld_sdmmc_softc *sc = task->task_sc;
struct buf *bp = task->task_bp;
int s;
s = splbio();
if (!sdmmc_task_pending(&task->task)) {
splx(s);
return;
}
bp->b_error = EIO; /* XXXX */
bp->b_resid = bp->b_bcount;
sdmmc_del_task(&task->task);
aprint_error_dev(sc->sc_ld.sc_dv, "task timeout");
lddone(&sc->sc_ld, bp);
splx(s);
}
static int static int
ld_sdmmc_dump(struct ld_softc *ld, void *data, int blkno, int blkcnt) ld_sdmmc_dump(struct ld_softc *ld, void *data, int blkno, int blkcnt)
{ {