On 07/08/17 19:38, Jared D. McNeill wrote:
Module Name: src
Committed By: jmcneill
Date: Sat Jul 8 18:38:57 UTC 2017
Modified Files:
src/sys/dev/sdmmc: ld_sdmmc.c
Log Message:
The config_* APIs are not MPSAFE, so make sure the deferred attach
thread holds KERNEL_LOCK.
[snip]
@@ -157,7 +157,7 @@ ld_sdmmc_attach(device_t parent, device_
* when wedge is supported.
*/
config_pending_incr(self);
- if (kthread_create(PRI_NONE, KTHREAD_MPSAFE, NULL,
+ if (kthread_create(PRI_NONE, 0, NULL,
ld_sdmmc_doattach, sc, &lwp, "%sattach", device_xname(self))) {
aprint_error_dev(self, "couldn't create thread\n");
}
I think we should mark all kthreads KTHREAD_MPSAFE (or even get rid of
the option) and sprinkle KERNEL_{,UN}LOCK as appropriate.
Nick