ret = of_dma_get_range(bus_np, &map);
of_node_put(bus_np); if (ret < 0) { /* *Forlegacyreasons,wehavetoassumesomedevicesneed *DMAconfigurationregardlessofwhether"dma-ranges"is *correctlyspecifiedornot.
*/ if (!force_dma) return ret == -ENODEV ? 0 : ret;
} else { /* Determine the overall bounds of all DMA regions */
end = dma_range_map_max(map);
set_map = true;
}
skip_map: /* *If@devisexpectedtobeDMA-capablethenthebuscodethatcreated *itshouldhaveinitialiseditsdma_maskpointerbythispoint.For *now,we'llcontinuethelegacybehaviourofcoercingittothe *coherentmaskifnot,butwe'llnolongerdosoquietly.
*/ if (!dev->dma_mask) {
dev_warn(dev, "DMA mask not set\n");
dev->dma_mask = &dev->coherent_dma_mask;
}
if (!end && dev->coherent_dma_mask)
end = dev->coherent_dma_mask; elseif (!end)
end = (1ULL << 32) - 1;
/* *Limitcoherentanddmamaskbasedonsizeanddefaultmask *setbythedriver.
*/
mask = DMA_BIT_MASK(ilog2(end) + 1);
dev->coherent_dma_mask &= mask;
*dev->dma_mask &= mask; /* ...but only set bus limit and range map if we found valid dma-ranges earlier */ if (set_map) {
dev->bus_dma_limit = end;
dev->dma_range_map = map;
}
ret = of_iommu_configure(dev, np, id); if (ret == -EPROBE_DEFER) { /* Don't touch range map if it wasn't set from a valid dma-ranges */ if (set_map)
dev->dma_range_map = NULL;
kfree(map); return -EPROBE_DEFER;
} /* Take all other IOMMU errors to mean we'll just carry on without it */
dev_dbg(dev, "device is%sbehind an iommu\n",
!ret ? " " : " not ");
add_uevent_var(env, "OF_NAME=%pOFn", dev->of_node);
add_uevent_var(env, "OF_FULLNAME=%pOF", dev->of_node);
type = of_node_get_device_type(dev->of_node); if (type)
add_uevent_var(env, "OF_TYPE=%s", type);
/* Since the compatible field can contain pretty much anything *it'snotreallylegaltosplititoutwithcommas.Wesplitit
* up using a number of environment variables instead. */
of_property_for_each_string(dev->of_node, "compatible", p, compat) {
add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat);
seen++;
}
add_uevent_var(env, "OF_COMPATIBLE_N=%d", seen);
/* format arguments only used if dev_name() resolves to NULL */
dev_set_name(dev, dev_name(dev) ? "%s:%s" : "%s",
kbasename(node->full_name), dev_name(dev));
node = node->parent;
}
}
EXPORT_SYMBOL_GPL(of_device_make_bus_id);
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.11Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-09-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.