Module Name:    src
Committed By:   martin
Date:           Wed Aug  3 15:50:03 UTC 2022

Modified Files:
        src/sys/dev/usb [netbsd-9]: ukbd.c

Log Message:
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...


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.142.2.1 src/sys/dev/usb/ukbd.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/usb/ukbd.c
diff -u src/sys/dev/usb/ukbd.c:1.142 src/sys/dev/usb/ukbd.c:1.142.2.1
--- src/sys/dev/usb/ukbd.c:1.142	Sun May  5 03:17:54 2019
+++ src/sys/dev/usb/ukbd.c	Wed Aug  3 15:50:03 2022
@@ -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);

Reply via email to