Module Name:    src
Committed By:   msaitoh
Date:           Sat Dec  1 01:56:30 UTC 2018

Modified Files:
        src/sys/arch/x86/x86: ipmi.c
        src/sys/external/bsd/drm2/i915drm: intelfb.c

Log Message:
 Use DVF_ATTACH_INPROGRESS.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/x86/x86/ipmi.c
cvs rdiff -u -r1.15 -r1.16 src/sys/external/bsd/drm2/i915drm/intelfb.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/arch/x86/x86/ipmi.c
diff -u src/sys/arch/x86/x86/ipmi.c:1.67 src/sys/arch/x86/x86/ipmi.c:1.68
--- src/sys/arch/x86/x86/ipmi.c:1.67	Sun Oct 14 17:37:40 2018
+++ src/sys/arch/x86/x86/ipmi.c	Sat Dec  1 01:56:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipmi.c,v 1.67 2018/10/14 17:37:40 jdolecek Exp $ */
+/*	$NetBSD: ipmi.c,v 1.68 2018/12/01 01:56:30 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipmi.c,v 1.67 2018/10/14 17:37:40 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipmi.c,v 1.68 2018/12/01 01:56:30 msaitoh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -2143,6 +2143,7 @@ ipmi_thread(void *cookie)
 		}
 	}
 	mutex_exit(&sc->sc_poll_mtx);
+	self->dv_flags &= ~DVF_ATTACH_INPROGRESS;
 	kthread_exit(0);
 }
 
@@ -2167,7 +2168,8 @@ ipmi_attach(device_t parent, device_t se
 	if (kthread_create(PRI_NONE, 0, NULL, ipmi_thread, self,
 	    &sc->sc_kthread, "%s", device_xname(self)) != 0) {
 		aprint_error_dev(self, "unable to create thread, disabled\n");
-	}
+	} else
+		self->dv_flags |= DVF_ATTACH_INPROGRESS;
 }
 
 static int

Index: src/sys/external/bsd/drm2/i915drm/intelfb.c
diff -u src/sys/external/bsd/drm2/i915drm/intelfb.c:1.15 src/sys/external/bsd/drm2/i915drm/intelfb.c:1.16
--- src/sys/external/bsd/drm2/i915drm/intelfb.c:1.15	Mon Aug 27 15:09:35 2018
+++ src/sys/external/bsd/drm2/i915drm/intelfb.c	Sat Dec  1 01:56:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: intelfb.c,v 1.15 2018/08/27 15:09:35 riastradh Exp $	*/
+/*	$NetBSD: intelfb.c,v 1.16 2018/12/01 01:56:30 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intelfb.c,v 1.15 2018/08/27 15:09:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intelfb.c,v 1.16 2018/12/01 01:56:30 msaitoh Exp $");
 
 #include <sys/types.h>
 #include <sys/bus.h>
@@ -119,6 +119,7 @@ intelfb_attach(device_t parent, device_t
 		    error);
 		goto fail1;
 	}
+	self->dv_flags |= DVF_ATTACH_INPROGRESS;
 	sc->sc_scheduled = true;
 
 	/* Success!  */
@@ -181,7 +182,7 @@ intelfb_attach_task(struct i915drmkms_ta
 	if (error) {
 		aprint_error_dev(sc->sc_dev, "failed to attach drmfb: %d\n",
 		    error);
-		return;
+		goto out;
 	}
 
 	if (!pmf_device_register1(sc->sc_dev, NULL, NULL, &intelfb_shutdown))
@@ -189,6 +190,8 @@ intelfb_attach_task(struct i915drmkms_ta
 		    "failed to register shutdown handler\n");
 
 	sc->sc_attached = true;
+out:
+	sc->sc_dev->dv_flags &= ~DVF_ATTACH_INPROGRESS;
 }
 
 static bool

Reply via email to