diff options
author | Marco Peereboom <marco@cvs.openbsd.org> | 2005-11-22 04:28:15 +0000 |
---|---|---|
committer | Marco Peereboom <marco@cvs.openbsd.org> | 2005-11-22 04:28:15 +0000 |
commit | 506028da748115aa48171a9016671577b5d39956 (patch) | |
tree | b74aa76f6cb29c9c7c92a2e64ba5aa4098c0ae55 /sys/dev/ipmi.c | |
parent | fcae46d43bb2054b49deaf1c521051953b21c565 (diff) |
Some BIOS' lie about location of ports. Prevent panic by checking bus_space_map.
This works around bob's ipmi panic issue on the amd64 e325 IBM box.
ok jordan@
Diffstat (limited to 'sys/dev/ipmi.c')
-rw-r--r-- | sys/dev/ipmi.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/dev/ipmi.c b/sys/dev/ipmi.c index 36971d6d612..2d6c461e618 100644 --- a/sys/dev/ipmi.c +++ b/sys/dev/ipmi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipmi.c,v 1.18 2005/10/24 18:36:21 marco Exp $ */ +/* $OpenBSD: ipmi.c,v 1.19 2005/11/22 04:28:14 marco Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave @@ -1522,9 +1522,14 @@ ipmi_map_regs(struct ipmi_softc *sc, struct ipmi_attach_args *ia) sc->sc_if_rev = ia->iaa_if_rev; sc->sc_if_iospacing = ia->iaa_if_iospacing; - bus_space_map(sc->sc_iot, ia->iaa_if_iobase, + if (bus_space_map(sc->sc_iot, ia->iaa_if_iobase, sc->sc_if->nregs * sc->sc_if_iospacing, - 0, &sc->sc_ioh); + 0, &sc->sc_ioh)) { + printf("ipmi: bus_space_map(%x %x %x 0 %x) failed\n", + sc->sc_iot, ia->iaa_if_iobase, + sc->sc_if->nregs * sc->sc_if_iospacing, &sc->sc_ioh); + return (-1); + } #if 0 if (iaa->if_if_irq != -1) sc->ih = isa_intr_establish(-1, iaa->if_if_irq, |