Module Name: src Committed By: christos Date: Mon Dec 17 16:26:03 UTC 2018
Modified Files: src/sys/arch/x86/x86: ipmi.c Log Message: Back to using aprint_error() and get more info about the error so we can figure out why we can't map the registers. To generate a diff of this commit: cvs rdiff -u -r1.69 -r1.70 src/sys/arch/x86/x86/ipmi.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/x86/x86/ipmi.c diff -u src/sys/arch/x86/x86/ipmi.c:1.69 src/sys/arch/x86/x86/ipmi.c:1.70 --- src/sys/arch/x86/x86/ipmi.c:1.69 Mon Dec 17 10:12:52 2018 +++ src/sys/arch/x86/x86/ipmi.c Mon Dec 17 11:26:03 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ipmi.c,v 1.69 2018/12/17 15:12:52 gson Exp $ */ +/* $NetBSD: ipmi.c,v 1.70 2018/12/17 16:26:03 christos Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -52,7 +52,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ipmi.c,v 1.69 2018/12/17 15:12:52 gson Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ipmi.c,v 1.70 2018/12/17 16:26:03 christos Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -1923,6 +1923,8 @@ ipmi_refresh_sensors(struct ipmi_softc * int ipmi_map_regs(struct ipmi_softc *sc, struct ipmi_attach_args *ia) { + int error; + sc->sc_if = ipmi_get_if(ia->iaa_if_type); if (sc->sc_if == NULL) return -1; @@ -1934,12 +1936,14 @@ ipmi_map_regs(struct ipmi_softc *sc, str sc->sc_if_rev = ia->iaa_if_rev; sc->sc_if_iospacing = ia->iaa_if_iospacing; - if (bus_space_map(sc->sc_iot, ia->iaa_if_iobase, - sc->sc_if->nregs * sc->sc_if_iospacing, - 0, &sc->sc_ioh)) { - printf("%s: bus_space_map(..., %x, %x, 0, %p) failed\n", - __func__, ia->iaa_if_iobase, - sc->sc_if->nregs * sc->sc_if_iospacing, &sc->sc_ioh); + if ((error = bus_space_map(sc->sc_iot, ia->iaa_if_iobase, + sc->sc_if->nregs * sc->sc_if_iospacing, 0, &sc->sc_ioh)) != 0) { + const char *xname = sc->sc_dev ? device_xname(sc->sc_dev) : + "ipmi0"; + aprint_error("%s: %s:bus_space_map(..., %x, %x, 0, %p)" + " type %c failed %d\n", xname, __func__, ia->iaa_if_iobase, + sc->sc_if->nregs * sc->sc_if_iospacing, &sc->sc_ioh, + ia->iaa_if_iotype, error); return -1; } #if 0