Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb ukbd(4): Wait for callouts and blinking to compl...



details:   https://anonhg.NetBSD.org/src/rev/87df1b34d3b8
branches:  trunk
changeset: 1029183:87df1b34d3b8
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Dec 25 13:41:12 2021 +0000

description:
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...

diffstat:

 sys/dev/usb/ukbd.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 06796d90ad83 -r 87df1b34d3b8 sys/dev/usb/ukbd.c
--- a/sys/dev/usb/ukbd.c        Sat Dec 25 13:30:42 2021 +0000
+++ b/sys/dev/usb/ukbd.c        Sat Dec 25 13:41:12 2021 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: ukbd.c,v 1.153 2021/10/11 00:00:03 jmcneill Exp $        */
+/*      $NetBSD: ukbd.c,v 1.154 2021/12/25 13:41:12 riastradh Exp $        */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.153 2021/10/11 00:00:03 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.154 2021/12/25 13:41:12 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -572,6 +572,10 @@
        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);



Home | Main Index | Thread Index | Old Index