diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2024-05-26 20:06:28 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2024-05-26 20:06:28 +0000 |
commit | 5d372523b3ce9f6d16c8ae4dadc26ff4bf469094 (patch) | |
tree | 71331b2038ed06f01371c989d769c780a8b105ee /sys | |
parent | 853b10c2a4092f452ab9daeb0b7cdd621f32ca47 (diff) |
Fix suspend/resume for ums(4) and umt(4); Calling hidm*_attach not at the
end of the device driver attach function can cause accessops functions to
be called by wscons(4) *before* the device has completed its attach
procedure. In this case this has led the device driver to ignore
interrupts after resume, because during resume ums_disable/umt_disable
were called last, *after* ums_enable/umt_enable.
OK phessler@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/ums.c | 6 | ||||
-rw-r--r-- | sys/dev/usb/umt.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/usb/ums.c b/sys/dev/usb/ums.c index 239e853fa00..5376365569c 100644 --- a/sys/dev/usb/ums.c +++ b/sys/dev/usb/ums.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ums.c,v 1.52 2024/05/23 03:21:09 jsg Exp $ */ +/* $OpenBSD: ums.c,v 1.53 2024/05/26 20:06:27 mglocker Exp $ */ /* $NetBSD: ums.c,v 1.60 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -178,14 +178,14 @@ ums_attach(struct device *parent, struct device *self, void *aux) ms->sc_loc_btn[2].pos = 2; } - hidms_attach(ms, &ums_accessops); - if (sc->sc_quirks & UQ_ALWAYS_OPEN) { /* open uhidev and keep it open */ ums_enable(sc); /* but mark the hidms not in use */ ums_disable(sc); } + + hidms_attach(ms, &ums_accessops); } int diff --git a/sys/dev/usb/umt.c b/sys/dev/usb/umt.c index aea4412e5cd..35ebfb59668 100644 --- a/sys/dev/usb/umt.c +++ b/sys/dev/usb/umt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umt.c,v 1.7 2024/05/23 03:21:09 jsg Exp $ */ +/* $OpenBSD: umt.c,v 1.8 2024/05/26 20:06:27 mglocker Exp $ */ /* * USB multitouch touchpad driver for devices conforming to * Windows Precision Touchpad standard @@ -181,14 +181,14 @@ umt_attach(struct device *parent, struct device *self, void *aux) if (hidmt_setup(self, mt, desc, size) != 0) return; - hidmt_attach(mt, &umt_accessops); - if (sc->sc_quirks & UQ_ALWAYS_OPEN) { /* open uhidev and keep it open */ umt_enable(sc); /* but mark the hidmt not in use */ umt_disable(sc); } + + hidmt_attach(mt, &umt_accessops); } int |