From ff21b251a0b44b68b03c27f33b2e25e494aa40d7 Mon Sep 17 00:00:00 2001 From: augustss Date: Sun, 30 Dec 2001 20:26:59 +0000 Subject: [PATCH] Make sure we don't have any pending softintrs when entering polling mode. Thanks to Darrin for finding and fixing this problem when using USB keyboards in DDB. --- sys/dev/usb/usbdi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index fe70140ba969..ec2ecca5bd8d 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.c,v 1.93 2001/12/24 21:36:15 augustss Exp $ */ +/* $NetBSD: usbdi.c,v 1.94 2001/12/30 20:26:59 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */ /* @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.93 2001/12/24 21:36:15 augustss Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.94 2001/12/30 20:26:59 augustss Exp $"); #include #include @@ -1088,6 +1088,9 @@ usbd_set_polling(usbd_device_handle dev, int on) dev->bus->use_polling++; else dev->bus->use_polling--; + /* When polling we need to make sure there is nothing pending to do. */ + if (dev->bus->use_polling) + dev->bus->methods->soft_intr(dev->bus); }