Commit 5dbea799 authored by Philippe Gerum's avatar Philippe Gerum

driver core: ipipe: defer dev_printk() from head domain

Just like printk(), dev_printk() cannot run from the head domain
and/or with hard IRQs disabled. In such a case, log the output
directly into the staging buffer we use for printk().

NOTE: when redirected to the buffer, the output does not include the
dev_printk() header text but is merely sent as-is to the log.
parent c469670d
......@@ -3022,6 +3022,17 @@ EXPORT_SYMBOL(dev_printk_emit);
static void __dev_printk(const char *level, const struct device *dev,
struct va_format *vaf)
{
#ifdef CONFIG_IPIPE
/*
* Console logging only if hard locked, or over the head
* stage.
*/
if (hard_irqs_disabled() || !ipipe_root_p) {
__ipipe_log_printk(vaf->fmt, *vaf->va);
return;
}
#endif
if (dev)
dev_printk_emit(level[1] - '0', dev, "%s %s: %pV",
dev_driver_string(dev), dev_name(dev), vaf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment