Module Name: src
Committed By: dyoung
Date: Mon Apr 4 22:48:15 UTC 2011
Modified Files:
src/sys/dev/pci: ehci_pci.c ohci_pci.c uhci_pci.c
Log Message:
Deregister PMF handlers during detachment. Complete the host controller
shutdown.
To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/pci/ehci_pci.c
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/pci/ohci_pci.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/pci/uhci_pci.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/pci/ehci_pci.c
diff -u src/sys/dev/pci/ehci_pci.c:1.51 src/sys/dev/pci/ehci_pci.c:1.52
--- src/sys/dev/pci/ehci_pci.c:1.51 Mon Apr 4 20:37:56 2011
+++ src/sys/dev/pci/ehci_pci.c Mon Apr 4 22:48:15 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ehci_pci.c,v 1.51 2011/04/04 20:37:56 dyoung Exp $ */
+/* $NetBSD: ehci_pci.c,v 1.52 2011/04/04 22:48:15 dyoung Exp $ */
/*
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.51 2011/04/04 20:37:56 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.52 2011/04/04 22:48:15 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -282,11 +282,13 @@
struct ehci_pci_softc *sc = device_private(self);
int rv;
- pmf_device_deregister(self);
rv = ehci_detach(&sc->sc, flags);
if (rv)
return rv;
+ pmf_device_deregister(self);
+ ehci_shutdown(self, flags);
+
/* disable interrupts */
EOWRITE2(&sc->sc, EHCI_USBINTR, 0);
/* XXX grotty hack to flush the write */
Index: src/sys/dev/pci/ohci_pci.c
diff -u src/sys/dev/pci/ohci_pci.c:1.46 src/sys/dev/pci/ohci_pci.c:1.47
--- src/sys/dev/pci/ohci_pci.c:1.46 Tue May 25 08:37:10 2010
+++ src/sys/dev/pci/ohci_pci.c Mon Apr 4 22:48:15 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ohci_pci.c,v 1.46 2010/05/25 08:37:10 pgoyette Exp $ */
+/* $NetBSD: ohci_pci.c,v 1.47 2011/04/04 22:48:15 dyoung Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci_pci.c,v 1.46 2010/05/25 08:37:10 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci_pci.c,v 1.47 2011/04/04 22:48:15 dyoung Exp $");
#include "ehci.h"
@@ -186,11 +186,14 @@
struct ohci_pci_softc *sc = device_private(self);
int rv;
- pmf_device_deregister(self);
rv = ohci_detach(&sc->sc, flags);
if (rv)
return rv;
+ pmf_device_deregister(self);
+
+ ohci_shutdown(self, flags);
+
if (sc->sc.sc_size) {
/* Disable interrupts, so we don't get any spurious ones. */
bus_space_write_4(sc->sc.iot, sc->sc.ioh,
Index: src/sys/dev/pci/uhci_pci.c
diff -u src/sys/dev/pci/uhci_pci.c:1.52 src/sys/dev/pci/uhci_pci.c:1.53
--- src/sys/dev/pci/uhci_pci.c:1.52 Tue May 25 08:50:54 2010
+++ src/sys/dev/pci/uhci_pci.c Mon Apr 4 22:48:15 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: uhci_pci.c,v 1.52 2010/05/25 08:50:54 cegger Exp $ */
+/* $NetBSD: uhci_pci.c,v 1.53 2011/04/04 22:48:15 dyoung Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhci_pci.c,v 1.52 2010/05/25 08:50:54 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci_pci.c,v 1.53 2011/04/04 22:48:15 dyoung Exp $");
#include "ehci.h"
@@ -203,12 +203,12 @@
struct uhci_pci_softc *sc = device_private(self);
int rv;
- pmf_device_deregister(self);
-
rv = uhci_detach(&sc->sc, flags);
if (rv)
return (rv);
+ pmf_device_deregister(self);
+
/* disable interrupts and acknowledge any pending */
bus_space_write_2(sc->sc.iot, sc->sc.ioh, UHCI_INTR, 0);
bus_space_write_2(sc->sc.iot, sc->sc.ioh, UHCI_STS,