Ignore registers on devices where the reg property is malformed. Issue a

warning if this happens under bootverbose. This prevents some
strange-looking entries in dmesg for SMU devices on Apple G5 systems.
This commit is contained in:
nwhitehorn 2013-10-22 15:47:13 +00:00
parent e0414fcda4
commit 71d461451d

View File

@ -567,6 +567,12 @@ nexus_setup_dinfo(device_t dev, phandle_t node)
nreg = OF_getprop_alloc(node, "reg", sizeof(*reg), (void **)&reg);
if (nreg == -1)
nreg = 0;
if (nreg % (sc->acells + sc->scells) != 0) {
if (bootverbose)
device_printf(dev, "Malformed reg property on <%s>\n",
ndi->ndi_obdinfo.obd_name);
nreg = 0;
}
for (i = 0; i < nreg; i += sc->acells + sc->scells) {
phys = size = 0;