Use DVF_ATTACH_INPROGRESS.

This commit is contained in:
msaitoh 2018-12-01 01:56:30 +00:00
parent d7577d0e80
commit 9b94098d19
2 changed files with 11 additions and 6 deletions

View File

@ -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 self, void *aux)
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

View File

@ -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 self, void *aux)
error);
goto fail1;
}
self->dv_flags |= DVF_ATTACH_INPROGRESS;
sc->sc_scheduled = true;
/* Success! */
@ -181,7 +182,7 @@ intelfb_attach_task(struct i915drmkms_task *task)
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_task *task)
"failed to register shutdown handler\n");
sc->sc_attached = true;
out:
sc->sc_dev->dv_flags &= ~DVF_ATTACH_INPROGRESS;
}
static bool