Module Name:    src
Committed By:   jdc
Date:           Wed Dec 30 09:16:17 UTC 2015

Modified Files:
        src/sys/arch/sparc64/sparc64: ofw_machdep.c

Log Message:
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.44 -r1.45 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.44 src/sys/arch/sparc64/sparc64/ofw_machdep.c:1.45
--- src/sys/arch/sparc64/sparc64/ofw_machdep.c:1.44	Mon Mar  2 14:17:06 2015
+++ src/sys/arch/sparc64/sparc64/ofw_machdep.c	Wed Dec 30 09:16:17 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw_machdep.c,v 1.44 2015/03/02 14:17:06 nakayama Exp $	*/
+/*	$NetBSD: ofw_machdep.c,v 1.45 2015/12/30 09:16:17 jdc 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.44 2015/03/02 14:17:06 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.45 2015/12/30 09:16:17 jdc Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -738,22 +738,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 "
-		    "port-spar...@netbsd.org!\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;
+		}
 	}
 
 	/*
@@ -775,8 +775,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