Module Name:    src
Committed By:   jdolecek
Date:           Mon Oct 22 21:40:45 UTC 2018

Modified Files:
        src/sys/dev/pci: ahcisata_pci.c siisata_pci.c

Log Message:
first disestablish interrupt, then release


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/pci/ahcisata_pci.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pci/siisata_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/ahcisata_pci.c
diff -u src/sys/dev/pci/ahcisata_pci.c:1.39 src/sys/dev/pci/ahcisata_pci.c:1.40
--- src/sys/dev/pci/ahcisata_pci.c:1.39	Mon Oct 22 21:04:53 2018
+++ src/sys/dev/pci/ahcisata_pci.c	Mon Oct 22 21:40:45 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_pci.c,v 1.39 2018/10/22 21:04:53 jdolecek Exp $	*/
+/*	$NetBSD: ahcisata_pci.c,v 1.40 2018/10/22 21:40:45 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.39 2018/10/22 21:04:53 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.40 2018/10/22 21:40:45 jdolecek Exp $");
 
 #include <sys/types.h>
 #include <sys/malloc.h>
@@ -343,16 +343,16 @@ ahci_pci_detach(device_t dv, int flags)
 
 	pmf_device_deregister(dv);
 
-	if (psc->sc_pihp != NULL) {
-		pci_intr_release(psc->sc_pc, psc->sc_pihp, 1);
-		psc->sc_pihp = NULL;
-	}
-
 	if (psc->sc_ih != NULL) {
 		pci_intr_disestablish(psc->sc_pc, psc->sc_ih);
 		psc->sc_ih = NULL;
 	}
 
+	if (psc->sc_pihp != NULL) {
+		pci_intr_release(psc->sc_pc, psc->sc_pihp, 1);
+		psc->sc_pihp = NULL;
+	}
+
 	bus_space_unmap(sc->sc_ahcit, sc->sc_ahcih, sc->sc_ahcis);
 
 	return 0;

Index: src/sys/dev/pci/siisata_pci.c
diff -u src/sys/dev/pci/siisata_pci.c:1.17 src/sys/dev/pci/siisata_pci.c:1.18
--- src/sys/dev/pci/siisata_pci.c:1.17	Mon Oct 22 20:57:07 2018
+++ src/sys/dev/pci/siisata_pci.c	Mon Oct 22 21:40:45 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata_pci.c,v 1.17 2018/10/22 20:57:07 jdolecek Exp $ */
+/* $NetBSD: siisata_pci.c,v 1.18 2018/10/22 21:40:45 jdolecek Exp $ */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -51,7 +51,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: siisata_pci.c,v 1.17 2018/10/22 20:57:07 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata_pci.c,v 1.18 2018/10/22 21:40:45 jdolecek Exp $");
 
 #include <sys/types.h>
 #include <sys/malloc.h>
@@ -290,15 +290,16 @@ siisata_pci_detach(device_t dv, int flag
 	if (rv)
 		return rv;
 
+	if (psc->sc_ih != NULL) {
+		pci_intr_disestablish(psc->sc_pc, psc->sc_ih);
+		psc->sc_ih = NULL;
+	}
+
 	if (psc->sc_pihp != NULL) {
 		pci_intr_release(psc->sc_pc, psc->sc_pihp, 1);
 		psc->sc_pihp = NULL;
 	}
 	
-	if (psc->sc_ih != NULL) {
-		pci_intr_disestablish(psc->sc_pc, psc->sc_ih);
-	}
-
 	bus_space_unmap(sc->sc_prt, sc->sc_prh, sc->sc_prs);
 	bus_space_unmap(sc->sc_grt, sc->sc_grh, sc->sc_grs);
 

Reply via email to