Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb uhci(4): Fix wrong lock in callout_halt in uhci_...



details:   https://anonhg.NetBSD.org/src/rev/ca79e79ba034
branches:  trunk
changeset: 369445:ca79e79ba034
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Aug 17 20:03:05 2022 +0000

description:
uhci(4): Fix wrong lock in callout_halt in uhci_suspend.

Maybe this should just be unconditional and outside the lock to make
it simpler.

Found by code inspection.  Maybe someone should test uhci suspend
resume...

diffstat:

 sys/dev/usb/uhci.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 8e278226f1cc -r ca79e79ba034 sys/dev/usb/uhci.c
--- a/sys/dev/usb/uhci.c        Wed Aug 17 19:56:28 2022 +0000
+++ b/sys/dev/usb/uhci.c        Wed Aug 17 20:03:05 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhci.c,v 1.315 2022/03/13 11:29:46 riastradh Exp $     */
+/*     $NetBSD: uhci.c,v 1.316 2022/08/17 20:03:05 riastradh Exp $     */
 
 /*
  * Copyright (c) 1998, 2004, 2011, 2012, 2016, 2020 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.315 2022/03/13 11:29:46 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.316 2022/08/17 20:03:05 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -761,7 +761,7 @@
        mutex_enter(&sc->sc_lock);
        sc->sc_suspend = PWR_SUSPEND;
        if (sc->sc_intr_xfer != NULL)
-               callout_halt(&sc->sc_poll_handle, &sc->sc_intr_lock);
+               callout_halt(&sc->sc_poll_handle, &sc->sc_lock);
        mutex_exit(&sc->sc_lock);
 
        cmd = UREAD2(sc, UHCI_CMD);



Home | Main Index | Thread Index | Old Index