Re: [PATCH] rpmsg bus subsys_initcall initialization ordering

From: Ohad Ben-Cohen
Date: Mon Jul 16 2012 - 03:47:21 EST


Hi Federico,

On Fri, Jul 13, 2012 at 9:00 PM, Ohad Ben-Cohen <ohad@xxxxxxxxxx> wrote:
> I agree. I'll take it, but will change the commit log to make it
> omaprpc-agnostic.

Here's what I'm going to apply:

commit 913552b8c7a0f06cc1bff27f8e9953bffe6a1817
Author: Federico Fuga <fuga@xxxxxxxxxxxxxx>
Date: Mon Jul 16 10:36:51 2012 +0300

rpmsg: fix dependency on initialization order

When rpmsg drivers are built into the kernel, they must not initialize
before the rpmsg bus does, otherwise they'd trigger a BUG() in
drivers/base/driver.c line 169 (driver_register()).

To fix that, and to stop depending on arbitrary linkage ordering of
those built-in rpmsg driver, we let the rpmsg bus initialize at
subsys_initcall.

Signed-off-by: Federico Fuga <fuga@xxxxxxxxxxxxxx>
[ohad: rewrite the commit log]
Signed-off-by: Ohad Ben-Cohen <ohad@xxxxxxxxxx>

diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index 0af7fd3..e564a01 100644
--- a/drivers/rpmsg/virtio_rpmsg_bus.c
+++ b/drivers/rpmsg/virtio_rpmsg_bus.c
@@ -1104,7 +1104,7 @@ static int __init rpmsg_init(void)

return ret;
}
-module_init(rpmsg_init);
+subsys_initcall(rpmsg_init);

static void __exit rpmsg_fini(void)
{
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/