Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Use DVF_ATTACH_INPROGRESS.



details:   https://anonhg.NetBSD.org/src/rev/c763f6b7fe00
branches:  trunk
changeset: 446340:c763f6b7fe00
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Sat Dec 01 01:56:30 2018 +0000

description:
Use DVF_ATTACH_INPROGRESS.

diffstat:

 sys/arch/x86/x86/ipmi.c                 |  8 +++++---
 sys/external/bsd/drm2/i915drm/intelfb.c |  9 ++++++---
 2 files changed, 11 insertions(+), 6 deletions(-)

diffs (80 lines):

diff -r 1b8b41d0fe33 -r c763f6b7fe00 sys/arch/x86/x86/ipmi.c
--- a/sys/arch/x86/x86/ipmi.c   Sat Dec 01 01:51:38 2018 +0000
+++ b/sys/arch/x86/x86/ipmi.c   Sat Dec 01 01:56:30 2018 +0000
@@ -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 @@
                }
        }
        mutex_exit(&sc->sc_poll_mtx);
+       self->dv_flags &= ~DVF_ATTACH_INPROGRESS;
        kthread_exit(0);
 }
 
@@ -2167,7 +2168,8 @@
        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
diff -r 1b8b41d0fe33 -r c763f6b7fe00 sys/external/bsd/drm2/i915drm/intelfb.c
--- a/sys/external/bsd/drm2/i915drm/intelfb.c   Sat Dec 01 01:51:38 2018 +0000
+++ b/sys/external/bsd/drm2/i915drm/intelfb.c   Sat Dec 01 01:56:30 2018 +0000
@@ -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 @@
                    error);
                goto fail1;
        }
+       self->dv_flags |= DVF_ATTACH_INPROGRESS;
        sc->sc_scheduled = true;
 
        /* Success!  */
@@ -181,7 +182,7 @@
        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 @@
                    "failed to register shutdown handler\n");
 
        sc->sc_attached = true;
+out:
+       sc->sc_dev->dv_flags &= ~DVF_ATTACH_INPROGRESS;
 }
 
 static bool



Home | Main Index | Thread Index | Old Index