Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/sdmmc need to call lddone with splbio and kernel loc...
details: https://anonhg.NetBSD.org/src/rev/dfadd05a82be
branches: trunk
changeset: 338378:dfadd05a82be
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Wed May 20 13:09:34 2015 +0000
description:
need to call lddone with splbio and kernel lock held
diffstat:
sys/dev/sdmmc/ld_sdmmc.c | 12 +++++++-----
sys/dev/sdmmc/sdmmc.c | 6 ++++--
2 files changed, 11 insertions(+), 7 deletions(-)
diffs (89 lines):
diff -r 130f0554ff06 -r dfadd05a82be sys/dev/sdmmc/ld_sdmmc.c
--- a/sys/dev/sdmmc/ld_sdmmc.c Wed May 20 12:21:38 2015 +0000
+++ b/sys/dev/sdmmc/ld_sdmmc.c Wed May 20 13:09:34 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ld_sdmmc.c,v 1.15 2015/04/13 16:33:25 riastradh Exp $ */
+/* $NetBSD: ld_sdmmc.c,v 1.16 2015/05/20 13:09:34 jmcneill Exp $ */
/*
* Copyright (c) 2008 KIYOHARA Takashi
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.15 2015/04/13 16:33:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.16 2015/05/20 13:09:34 jmcneill Exp $");
#ifdef _KERNEL_OPT
#include "opt_sdmmc.h"
@@ -118,7 +118,7 @@
sa->sf->cid.rev, sa->sf->cid.psn, sa->sf->cid.mdt);
aprint_naive("\n");
- callout_init(&sc->sc_task.task_callout, CALLOUT_MPSAFE);
+ callout_init(&sc->sc_task.task_callout, 0);
sc->sc_hwunit = 0; /* always 0? */
sc->sc_sf = sa->sf;
@@ -216,7 +216,9 @@
bp->b_rawblkno, sc->sc_sf->csd.capacity);
bp->b_error = EINVAL;
bp->b_resid = bp->b_bcount;
+ s = splbio();
lddone(&sc->sc_ld, bp);
+ splx(s);
return;
}
@@ -235,9 +237,9 @@
} else {
bp->b_resid = 0;
}
- splx(s);
lddone(&sc->sc_ld, bp);
+ splx(s);
}
static void
@@ -256,11 +258,11 @@
bp->b_error = EIO; /* XXXX */
bp->b_resid = bp->b_bcount;
sdmmc_del_task(&task->task);
- splx(s);
aprint_error_dev(sc->sc_ld.sc_dv, "task timeout");
lddone(&sc->sc_ld, bp);
+ splx(s);
}
static int
diff -r 130f0554ff06 -r dfadd05a82be sys/dev/sdmmc/sdmmc.c
--- a/sys/dev/sdmmc/sdmmc.c Wed May 20 12:21:38 2015 +0000
+++ b/sys/dev/sdmmc/sdmmc.c Wed May 20 13:09:34 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sdmmc.c,v 1.24 2015/02/27 16:08:17 nonaka Exp $ */
+/* $NetBSD: sdmmc.c,v 1.25 2015/05/20 13:09:34 jmcneill Exp $ */
/* $OpenBSD: sdmmc.c,v 1.18 2009/01/09 10:58:38 jsg Exp $ */
/*
@@ -49,7 +49,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdmmc.c,v 1.24 2015/02/27 16:08:17 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc.c,v 1.25 2015/05/20 13:09:34 jmcneill Exp $");
#ifdef _KERNEL_OPT
#include "opt_sdmmc.h"
@@ -271,7 +271,9 @@
if (task != NULL) {
sdmmc_del_task1(sc, task);
mutex_exit(&sc->sc_tskq_mtx);
+ KERNEL_LOCK(1, curlwp);
(*task->func)(task->arg);
+ KERNEL_UNLOCK_ONE(curlwp);
mutex_enter(&sc->sc_tskq_mtx);
} else {
/* Check for the exit condition. */
Home |
Main Index |
Thread Index |
Old Index