Module Name:    src
Committed By:   mlelstv
Date:           Mon Jul 10 10:35:08 UTC 2017

Modified Files:
        src/sys/dev/sdmmc: ld_sdmmc.c

Log Message:
Decrypt comment about the attach thread. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/sdmmc/ld_sdmmc.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/sdmmc/ld_sdmmc.c
diff -u src/sys/dev/sdmmc/ld_sdmmc.c:1.29 src/sys/dev/sdmmc/ld_sdmmc.c:1.30
--- src/sys/dev/sdmmc/ld_sdmmc.c:1.29	Sat Jul  8 18:38:57 2017
+++ src/sys/dev/sdmmc/ld_sdmmc.c	Mon Jul 10 10:35:07 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld_sdmmc.c,v 1.29 2017/07/08 18:38:57 jmcneill Exp $	*/
+/*	$NetBSD: ld_sdmmc.c,v 1.30 2017/07/10 10:35:07 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.29 2017/07/08 18:38:57 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.30 2017/07/10 10:35:07 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -153,8 +153,13 @@ ld_sdmmc_attach(device_t parent, device_
 	ld->sc_discard = ld_sdmmc_discard;
 
 	/*
-	 * It is avoided that the error occurs when the card attaches it,
-	 * when wedge is supported.
+	 * Defer attachment of ld + disk subsystem to a thread.
+	 *
+	 * This is necessary because wedge autodiscover needs to
+	 * open and call into the ld driver, which could deadlock
+	 * when the sdmmc driver isn't ready in early bootstrap.
+	 *
+	 * Don't mark thread as MPSAFE to keep aprint output sane.
 	 */
 	config_pending_incr(self);
 	if (kthread_create(PRI_NONE, 0, NULL,

Reply via email to