Module Name:    src
Committed By:   riz
Date:           Tue Jan 26 04:56:56 UTC 2016

Modified Files:
        src/sys/arch/sparc64/sparc64 [netbsd-7-0]: ofw_machdep.c

Log Message:
Pull up following revision(s) (requested by jdc in ticket #1069):
        sys/arch/sparc64/sparc64/ofw_machdep.c: revision 1.45
Restrict the check for fully specified interrupts to machines with psycho
controllers only, and adjust comments to note this.
See also the mail thread starting at:
http://mail-index.NetBSD.org/port-sparc64/2015/12/03/msg002488.html


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.42.4.1 src/sys/arch/sparc64/sparc64/ofw_machdep.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/arch/sparc64/sparc64/ofw_machdep.c
diff -u src/sys/arch/sparc64/sparc64/ofw_machdep.c:1.42 src/sys/arch/sparc64/sparc64/ofw_machdep.c:1.42.4.1
--- src/sys/arch/sparc64/sparc64/ofw_machdep.c:1.42	Sun May  4 09:05:39 2014
+++ src/sys/arch/sparc64/sparc64/ofw_machdep.c	Tue Jan 26 04:56:56 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw_machdep.c,v 1.42 2014/05/04 09:05:39 martin Exp $	*/
+/*	$NetBSD: ofw_machdep.c,v 1.42.4.1 2016/01/26 04:56:56 riz Exp $	*/
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -34,7 +34,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.42 2014/05/04 09:05:39 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.42.4.1 2016/01/26 04:56:56 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -707,22 +707,22 @@ OF_mapintr(int node, int *interrupt, int
 	int phc_node;
 	int rc = -1;
 
+	phc_node = find_pci_host_node(node);
+
 	/* 
-	 * Don't try to map interrupts for onboard devices, or if the
-	 * interrupt is already fully specified.
-	 * XXX This should be done differently (i.e. by matching
-	 * the node name) - but we need access to a machine where
-	 * a change is testable - hence the printf below.
+	 * On machines with psycho PCI controllers, we don't need to map
+	 * interrupts if they are already fully specified (0x20 to 0x3f
+	 * for onboard devices and IGN 0x7c0 for psycho0/psycho1).
 	 */
 	if (*interrupt & 0x20 || *interrupt & 0x7c0) {
-		char name[40];
-
-		OF_getprop(node, "name", &name, sizeof(name));
-		printf("\nATTENTION: if you see this message, please mail "
-		    "the output of \"dmesg\" and \"ofctl -p\" to "
-		    "[email protected]!\n"
-		    "Not mapping interrupt for node %s (%x)\n", name, node);
-		return validlen;
+		char model[40];
+		
+		if (OF_getprop(phc_node, "model", &model, sizeof(model)) > 10
+		    && !strcmp(model, "SUNW,psycho")) {
+			DPRINTF(("OF_mapintr: interrupt %x already mapped\n",
+			    *interrupt));
+			return validlen;
+		}
 	}
 
 	/*
@@ -744,8 +744,6 @@ OF_mapintr(int node, int *interrupt, int
 		return (-1);
 	}
 
-	phc_node = find_pci_host_node(node);
-
 	while (node) {
 #ifdef DEBUG
 		char name[40];

Reply via email to