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.
This commit is contained in:
macallan 2020-10-16 17:59:46 +00:00
parent 500a7971b4
commit bb3c146062
1 changed files with 17 additions and 3 deletions

View File

@ -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 <sys/cdefs.h>
__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;