summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartin <martin@NetBSD.org>2022-08-03 15:50:03 +0000
committermartin <martin@NetBSD.org>2022-08-03 15:50:03 +0000
commitf1d2435af19ed80ab9726916c6a3370fcc67ebcb (patch)
tree9a32ee4467781b89521494a743990f03a7cd3c0e
parent85a8f06eed781108549b0576ddce8f6169d00d49 (diff)
Pull up following revision(s) (requested by riastradh in ticket #1492):
sys/dev/usb/ukbd.c: revision 1.154 ukbd(4): Wait for callouts and blinking to complete in detach. This detach routine (and whole driver) has got a lotta other problems, but let's fix 'em one at a time...
-rw-r--r--sys/dev/usb/ukbd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c
index 82207cb9533..6c71e78c116 100644
--- a/sys/dev/usb/ukbd.c
+++ b/sys/dev/usb/ukbd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ukbd.c,v 1.142 2019/05/05 03:17:54 mrg Exp $ */
+/* $NetBSD: ukbd.c,v 1.142.2.1 2022/08/03 15:50:03 martin Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.142 2019/05/05 03:17:54 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.142.2.1 2022/08/03 15:50:03 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@@ -578,6 +578,10 @@ ukbd_detach(device_t self, int flags)
if (sc->sc_wskbddev != NULL)
rv = config_detach(sc->sc_wskbddev, flags);
+ callout_halt(&sc->sc_delay, NULL);
+ usb_rem_task_wait(sc->sc_hdev.sc_parent->sc_udev, &sc->sc_ledtask,
+ USB_TASKQ_DRIVER, NULL);
+
/* The console keyboard does not get a disable call, so check pipe. */
if (sc->sc_hdev.sc_state & UHIDEV_OPEN)
uhidev_close(&sc->sc_hdev);