Module Name:    src
Committed By:   riastradh
Date:           Wed Mar  9 22:18:54 UTC 2022

Modified Files:
        src/sys/dev/usb: ohci.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.322 -r1.323 src/sys/dev/usb/ohci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.322 src/sys/dev/usb/ohci.c:1.323
--- src/sys/dev/usb/ohci.c:1.322	Wed Mar  9 22:17:41 2022
+++ src/sys/dev/usb/ohci.c	Wed Mar  9 22:18:54 2022
@@ -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_resume(device_t dv, const pmf_qual_
 	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 @@ ohci_resume(device_t dv, const pmf_qual_
 	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_suspend(device_t dv, const pmf_qual
 	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 @@ ohci_suspend(device_t dv, const pmf_qual
 	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;
 }
 

Reply via email to