Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb ohci(4): Don't flail around with enabling pollin...



details:   https://anonhg.NetBSD.org/src/rev/024c870abe6c
branches:  trunk
changeset: 363398:024c870abe6c
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Mar 09 22:18:54 2022 +0000

description:
ohci(4): Don't flail around with enabling polling in suspend/resume.

This doesn't work -- polling mode only works when all other CPUs are
quiesced and the current one is running sequentially without
preemption.

Also not clear whether this does anything useful.  Maybe we need a
mechanism to block new xfers until resumed, but this wasn't that.

diffstat:

 sys/dev/usb/ohci.c |  20 ++------------------
 1 files changed, 2 insertions(+), 18 deletions(-)

diffs (62 lines):

diff -r 7302553a6f6a -r 024c870abe6c sys/dev/usb/ohci.c
--- a/sys/dev/usb/ohci.c        Wed Mar 09 22:18:13 2022 +0000
+++ b/sys/dev/usb/ohci.c        Wed Mar 09 22:18:54 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci.c,v 1.322 2022/03/09 22:17:41 riastradh Exp $     */
+/*     $NetBSD: ohci.c,v 1.323 2022/03/09 22:18:54 riastradh Exp $     */
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012, 2016, 2020 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.322 2022/03/09 22:17:41 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.323 2022/03/09 22:18:54 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1147,10 +1147,6 @@
        ohci_softc_t *sc = device_private(dv);
        uint32_t ctl;
 
-       mutex_spin_enter(&sc->sc_intr_lock);
-       sc->sc_bus.ub_usepolling++;
-       mutex_spin_exit(&sc->sc_intr_lock);
-
        /* Some broken BIOSes do not recover these values */
        OWRITE4(sc, OHCI_HCCA, DMAADDR(&sc->sc_hccadma, 0));
        OWRITE4(sc, OHCI_CONTROL_HEAD_ED,
@@ -1172,10 +1168,6 @@
        usb_delay_ms(&sc->sc_bus, USB_RESUME_RECOVERY);
        sc->sc_control = sc->sc_intre = 0;
 
-       mutex_spin_enter(&sc->sc_intr_lock);
-       sc->sc_bus.ub_usepolling--;
-       mutex_spin_exit(&sc->sc_intr_lock);
-
        return true;
 }
 
@@ -1185,10 +1177,6 @@
        ohci_softc_t *sc = device_private(dv);
        uint32_t ctl;
 
-       mutex_spin_enter(&sc->sc_intr_lock);
-       sc->sc_bus.ub_usepolling++;
-       mutex_spin_exit(&sc->sc_intr_lock);
-
        ctl = OREAD4(sc, OHCI_CONTROL) & ~OHCI_HCFS_MASK;
        if (sc->sc_control == 0) {
                /*
@@ -1203,10 +1191,6 @@
        OWRITE4(sc, OHCI_CONTROL, ctl);
        usb_delay_ms(&sc->sc_bus, USB_RESUME_WAIT);
 
-       mutex_spin_enter(&sc->sc_intr_lock);
-       sc->sc_bus.ub_usepolling--;
-       mutex_spin_exit(&sc->sc_intr_lock);
-
        return true;
 }
 



Home | Main Index | Thread Index | Old Index