Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64/dev It seems that accessing to a PCI config...
details: https://anonhg.NetBSD.org/src/rev/3f8a346388db
branches: trunk
changeset: 750413:3f8a346388db
user: nakayama <nakayama%NetBSD.org@localhost>
date: Wed Dec 30 20:20:56 2009 +0000
description:
It seems that accessing to a PCI configration space where devices
are unavailable causes data_access_error trap. We need to check a
validity of OF node embeded in pcitag to avoid the trap.
Fixes PR port-sparc64/42545.
diffstat:
sys/arch/sparc64/dev/schizo.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diffs (39 lines):
diff -r a2ee34b3888c -r 3f8a346388db sys/arch/sparc64/dev/schizo.c
--- a/sys/arch/sparc64/dev/schizo.c Wed Dec 30 19:47:15 2009 +0000
+++ b/sys/arch/sparc64/dev/schizo.c Wed Dec 30 20:20:56 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: schizo.c,v 1.10 2009/11/30 05:00:58 mrg Exp $ */
+/* $NetBSD: schizo.c,v 1.11 2009/12/30 20:20:56 nakayama Exp $ */
/* $OpenBSD: schizo.c,v 1.55 2008/08/18 20:29:37 brad Exp $ */
/*
@@ -448,11 +448,12 @@
schizo_conf_read(pci_chipset_tag_t pc, pcitag_t tag, int reg)
{
struct schizo_pbm *sp = pc->cookie;
- pcireg_t val;
+ pcireg_t val = (pcireg_t)~0;
DPRINTF(SDB_CONF, ("%s: tag %lx reg %x ", __func__, (long)tag, reg));
- val = bus_space_read_4(sp->sp_cfgt, sp->sp_cfgh,
- PCITAG_OFFSET(tag) + reg);
+ if (PCITAG_NODE(tag) != -1)
+ val = bus_space_read_4(sp->sp_cfgt, sp->sp_cfgh,
+ PCITAG_OFFSET(tag) + reg);
DPRINTF(SDB_CONF, (" returning %08x\n", (u_int)val));
return (val);
}
@@ -464,6 +465,13 @@
DPRINTF(SDB_CONF, ("%s: tag %lx; reg %x; data %x", __func__,
(long)tag, reg, (int)data));
+
+ /* If we don't know it, just punt it. */
+ if (PCITAG_NODE(tag) == -1) {
+ DPRINTF(SDB_CONF, (" .. bad addr\n"));
+ return;
+ }
+
bus_space_write_4(sp->sp_cfgt, sp->sp_cfgh,
PCITAG_OFFSET(tag) + reg, data);
DPRINTF(SDB_CONF, (" .. done\n"));
Home |
Main Index |
Thread Index |
Old Index