Prevent spurious connection events after resume by caching the current
authorkettenis <kettenis@openbsd.org>
Sun, 23 Jul 2023 11:42:44 +0000 (11:42 +0000)
committerkettenis <kettenis@openbsd.org>
Sun, 23 Jul 2023 11:42:44 +0000 (11:42 +0000)
commit23d6429a03bae5a80cf2ced691eaaced32e41aa8
tree71d42890abb81af67dcf763c940fd47c4dc378ce
parent440d141494672caa7e8d231fced157bd3b6b7448
Prevent spurious connection events after resume by caching the current
plug state and comparing it with the current plug state when we receive
in interrupt.  Only call the connect/disconnect callbacks registered for
the port if the state really changed.  This prevents an spurious
attach/detach/attach sequence when resuming with a USB device connected.

ok patrick@
sys/dev/fdt/tipd.c