Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151490277
D42539.id130122.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D42539.id130122.diff
View Options
diff --git a/sys/dev/mpi3mr/mpi3mr.c b/sys/dev/mpi3mr/mpi3mr.c
--- a/sys/dev/mpi3mr/mpi3mr.c
+++ b/sys/dev/mpi3mr/mpi3mr.c
@@ -3036,8 +3036,8 @@
mpi3mr_dprint(sc, MPI3MR_XINFO, "%s\n", __func__);
sc->watchdog_thread_active = 1;
- mtx_lock(&sc->reset_mutex);
for (;;) {
+ mtx_lock(&sc->reset_mutex);
/* Sleep for 1 second and check the queue status */
msleep(&sc->watchdog_chan, &sc->reset_mutex, PRIBIO,
"mpi3mr_watchdog", 1 * hz);
@@ -3047,8 +3047,10 @@
"Exit due to %s from %s\n",
sc->mpi3mr_flags & MPI3MR_FLAGS_SHUTDOWN ? "Shutdown" :
"Hardware critical error", __func__);
+ mtx_unlock(&sc->reset_mutex);
break;
}
+ mtx_unlock(&sc->reset_mutex);
if ((sc->prepare_for_reset) &&
((sc->prepare_for_reset_timeout_counter++) >=
@@ -3110,7 +3112,6 @@
}
}
out:
- mtx_unlock(&sc->reset_mutex);
sc->watchdog_thread_active = 0;
mpi3mr_kproc_exit(0);
}
diff --git a/sys/dev/mpi3mr/mpi3mr_pci.c b/sys/dev/mpi3mr/mpi3mr_pci.c
--- a/sys/dev/mpi3mr/mpi3mr_pci.c
+++ b/sys/dev/mpi3mr/mpi3mr_pci.c
@@ -635,13 +635,15 @@
if (!sc->secure_ctrl)
return 0;
- sc->mpi3mr_flags |= MPI3MR_FLAGS_SHUTDOWN;
if (sc->sysctl_tree != NULL)
sysctl_ctx_free(&sc->sysctl_ctx);
+ mtx_lock(&sc->reset_mutex);
+ sc->mpi3mr_flags |= MPI3MR_FLAGS_SHUTDOWN;
if (sc->watchdog_thread_active)
wakeup(&sc->watchdog_chan);
+ mtx_unlock(&sc->reset_mutex);
while (sc->reset_in_progress && (i < PEND_IOCTLS_COMP_WAIT_TIME)) {
i++;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 9, 7:09 PM (5 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31168517
Default Alt Text
D42539.id130122.diff (1 KB)
Attached To
Mode
D42539: mpi3mr: Reduce the scope of the reset_mutext
Attached
Detach File
Event Timeline
Log In to Comment