Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jun 2019 15:30:47 +0000 (UTC)
From:      Ruslan Bukin <br@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r348620 - stable/12/sys/riscv/riscv
Message-ID:  <201906041530.x54FUljl034116@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: br
Date: Tue Jun  4 15:30:46 2019
New Revision: 348620
URL: https://svnweb.freebsd.org/changeset/base/348620

Log:
  MFC r346994:
  
  Deactivate IRQ resource by calling to intr_deactivate_irq().
  This is the part of INTRNG support that was missed.
  
  Sponsored by:	DARPA, AFRL

Modified:
  stable/12/sys/riscv/riscv/nexus.c

Modified: stable/12/sys/riscv/riscv/nexus.c
==============================================================================
--- stable/12/sys/riscv/riscv/nexus.c	Tue Jun  4 15:28:32 2019	(r348619)
+++ stable/12/sys/riscv/riscv/nexus.c	Tue Jun  4 15:30:46 2019	(r348620)
@@ -357,13 +357,17 @@ nexus_deactivate_resource(device_t bus, device_t child
 	bus_size_t psize;
 	bus_space_handle_t vaddr;
 
-	psize = (bus_size_t)rman_get_size(r);
-	vaddr = rman_get_bushandle(r);
+	if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) {
+		psize = (bus_size_t)rman_get_size(r);
+		vaddr = rman_get_bushandle(r);
 
-	if (vaddr != 0) {
-		bus_space_unmap(&memmap_bus, vaddr, psize);
-		rman_set_virtual(r, NULL);
-		rman_set_bushandle(r, 0);
+		if (vaddr != 0) {
+			bus_space_unmap(&memmap_bus, vaddr, psize);
+			rman_set_virtual(r, NULL);
+			rman_set_bushandle(r, 0);
+		}
+	} else if (type == SYS_RES_IRQ) {
+		intr_deactivate_irq(child, r);
 	}
 
 	return (rman_deactivate_resource(r));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906041530.x54FUljl034116>