Module Name: src
Committed By: bouyer
Date: Wed Aug 26 21:41:05 UTC 2009
Modified Files:
src/sys/dev/ic: mfi.c
Log Message:
mfi.c still uses the spl() synchronisation scheme and so needs the kernel lock.
The sysmon subsystem is marked MPSAFE and so runs without the kernel lock.
So get the kernel lock in mfi_sensor_refresh() before calling
mfi_ioctl_vol().
This fixes command list corruption seen on heavy I/O load on the mfi
driver(4).
To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/ic/mfi.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ic/mfi.c
diff -u src/sys/dev/ic/mfi.c:1.27 src/sys/dev/ic/mfi.c:1.28
--- src/sys/dev/ic/mfi.c:1.27 Thu Jul 16 18:58:38 2009
+++ src/sys/dev/ic/mfi.c Wed Aug 26 21:41:05 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: mfi.c,v 1.27 2009/07/16 18:58:38 dyoung Exp $ */
+/* $NetBSD: mfi.c,v 1.28 2009/08/26 21:41:05 bouyer Exp $ */
/* $OpenBSD: mfi.c,v 1.66 2006/11/28 23:59:45 dlg Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <[email protected]>
@@ -17,7 +17,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mfi.c,v 1.27 2009/07/16 18:58:38 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mfi.c,v 1.28 2009/08/26 21:41:05 bouyer Exp $");
#include "bio.h"
@@ -2032,18 +2032,21 @@
struct mfi_softc *sc = sme->sme_cookie;
struct bioc_vol bv;
int s;
+ int error;
if (edata->sensor >= sc->sc_ld_cnt)
return;
memset(&bv, 0, sizeof(bv));
bv.bv_volid = edata->sensor;
+ KERNEL_LOCK(1, curlwp);
s = splbio();
- if (mfi_ioctl_vol(sc, &bv)) {
- splx(s);
- return;
+ error = mfi_ioctl_vol(sc, &bv);
}
splx(s);
+ KERNEL_UNLOCK_ONE(curlwp);
+ if (error)
+ return;
switch(bv.bv_status) {
case BIOC_SVOFFLINE: