From bb3c1460622985864c57d1e046e82bb67c67749c Mon Sep 17 00:00:00 2001 From: macallan Date: Fri, 16 Oct 2020 17:59:46 +0000 Subject: [PATCH] config space accesses to device 15 function 7 cause a machine check exception on my C200, so weed them out. Now we can scan the PCI buses without crashing. --- sys/arch/hppa/dev/dino.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/sys/arch/hppa/dev/dino.c b/sys/arch/hppa/dev/dino.c index 12c2f58366b5..bc6976b7e558 100644 --- a/sys/arch/hppa/dev/dino.c +++ b/sys/arch/hppa/dev/dino.c @@ -1,4 +1,4 @@ -/* $NetBSD: dino.c,v 1.6 2020/06/14 01:40:04 chs Exp $ */ +/* $NetBSD: dino.c,v 1.7 2020/10/16 17:59:46 macallan Exp $ */ /* $OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $ */ @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.6 2020/06/14 01:40:04 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.7 2020/10/16 17:59:46 macallan Exp $"); /* #include "cardbus.h" */ @@ -345,10 +345,17 @@ dino_conf_read(void *v, pcitag_t tag, int reg) if ((unsigned int)reg >= PCI_CONF_SIZE) return (pcireg_t) -1; + /* + * XXX + * accessing dev 1f / func 7 on the 2nd Dino causes a machine check + * exception on my C200 + */ + if ((tag & 0xff00) == 0xff00) return -1; + /* fix arbitration errata by disabling all pci devs on config read */ pamr = r->pamr; r->pamr = 0; - + r->pci_addr = tag | reg; data = r->pci_conf_data; @@ -368,6 +375,13 @@ dino_conf_write(void *v, pcitag_t tag, int reg, pcireg_t data) if ((unsigned int)reg >= PCI_CONF_SIZE) return; + /* + * XXX + * accessing dev 1f / func 7 on the 2nd Dino causes a machine check + * exception on my C200 + */ + if ((tag & 0xff00) == 0xff00) return; + /* fix arbitration errata by disabling all pci devs on config read */ pamr = r->pamr; r->pamr = 0;