From: Hans de Goede <hdegoede@redhat.com>
To: Maximilian Luz <luzmaximilian@gmail.com>,
Mark Gross <markgross@kernel.org>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: "Blaž Hrastnik" <blaz@mxxn.io>
Subject: Re: [PATCH] platform/surface: aggregator: Fix initialization order when compiling as builtin module
Date: Fri, 6 May 2022 12:16:53 +0200 [thread overview]
Message-ID: <f0af4593-78ad-f277-39b8-002c156ffed4@redhat.com> (raw)
In-Reply-To: <20220429195738.535751-1-luzmaximilian@gmail.com>
Hi,
On 4/29/22 21:57, Maximilian Luz wrote:
> When building the Surface Aggregator Module (SAM) core, registry, and
> other SAM client drivers as builtin modules (=y), proper initialization
> order is not guaranteed. Due to this, client driver registration
> (triggered by device registration in the registry) races against bus
> initialization in the core.
>
> If any attempt is made at registering the device driver before the bus
> has been initialized (i.e. if bus initialization fails this race) driver
> registration will fail with a message similar to:
>
> Driver surface_battery was unable to register with bus_type surface_aggregator because the bus was not initialized
>
> Switch from module_init() to subsys_initcall() to resolve this issue.
> Note that the serdev subsystem uses postcore_initcall() so we are still
> able to safely register the serdev device driver for the core.
>
> Fixes: c167b9c7e3d6 ("platform/surface: Add Surface Aggregator subsystem")
> Reported-by: Blaž Hrastnik <blaz@mxxn.io>
> Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
Thank you for your patch, I've applied this patch to my review-hans
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.
Regards,
Hans
> ---
> drivers/platform/surface/aggregator/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/surface/aggregator/core.c b/drivers/platform/surface/aggregator/core.c
> index d384d36098c2..a62c5dfe42d6 100644
> --- a/drivers/platform/surface/aggregator/core.c
> +++ b/drivers/platform/surface/aggregator/core.c
> @@ -817,7 +817,7 @@ static int __init ssam_core_init(void)
> err_bus:
> return status;
> }
> -module_init(ssam_core_init);
> +subsys_initcall(ssam_core_init);
>
> static void __exit ssam_core_exit(void)
> {
prev parent reply other threads:[~2022-05-06 10:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-29 19:57 Maximilian Luz
2022-05-06 10:16 ` Hans de Goede [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f0af4593-78ad-f277-39b8-002c156ffed4@redhat.com \
--to=hdegoede@redhat.com \
--cc=blaz@mxxn.io \
--cc=linux-kernel@vger.kernel.org \
--cc=luzmaximilian@gmail.com \
--cc=markgross@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®