From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Darren Hart <dvhart@infradead.org>
Cc: Jonathan McDowell <noodles@earth.li>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Memory Management List <linux-mm@kvack.org>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Platform Driver <platform-driver-x86@vger.kernel.org>,
Andy Lutomirski <luto@amacapital.net>
Subject: Re: [PATCH] ACPI / WMI: Call acpi_wmi_init() later
Date: Sat, 6 Jan 2018 00:30:23 +0100 [thread overview]
Message-ID: <CAJZ5v0jxVUxFetwPaj76FoeQjHtSSwO+4jiEqadA1WXZ_YNNoQ@mail.gmail.com> (raw)
In-Reply-To: <2601877.IhOx20xkUK@aspire.rjw.lan>
On Wed, Jan 3, 2018 at 12:49 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Calling acpi_wmi_init() at the subsys_initcall() level causes ordering
> issues to appear on some systems and they are difficult to reproduce,
> because there is no guaranteed ordering between subsys_initcall()
> calls, so they may occur in different orders on different systems.
>
> In particular, commit 86d9f48534e8 (mm/slab: fix kmemcg cache
> creation delayed issue) exposed one of these issues where genl_init()
> and acpi_wmi_init() are both called at the same initcall level, but
> the former must run before the latter so as to avoid a NULL pointer
> dereference.
>
> For this reason, move the acpi_wmi_init() invocation to the
> initcall_sync level which should still be early enough for things
> to work correctly in the WMI land.
>
> Link: https://marc.info/?t=151274596700002&r=1&w=2
> Reported-by: Jonathan McDowell <noodles@earth.li>
> Reported-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> Tested-by: Jonathan McDowell <noodles@earth.li>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Guys, this fixes a crash on boot.
If there are no concerns/objections I will just take it through the ACPI tree.
> ---
> drivers/platform/x86/wmi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: linux-pm/drivers/platform/x86/wmi.c
> ===================================================================
> --- linux-pm.orig/drivers/platform/x86/wmi.c
> +++ linux-pm/drivers/platform/x86/wmi.c
> @@ -1458,5 +1458,5 @@ static void __exit acpi_wmi_exit(void)
> class_unregister(&wmi_bus_class);
> }
>
> -subsys_initcall(acpi_wmi_init);
> +subsys_initcall_sync(acpi_wmi_init);
> module_exit(acpi_wmi_exit);
>
> --
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2018-01-05 23:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-08 15:11 ACPI issues on cold power on [bisected] Jonathan McDowell
2017-12-22 0:21 ` Joonsoo Kim
2017-12-29 16:36 ` Jonathan McDowell
2018-01-02 2:54 ` Joonsoo Kim
2018-01-02 10:25 ` Rafael J. Wysocki
2018-01-03 2:11 ` Joonsoo Kim
2018-01-03 10:38 ` Jonathan McDowell
2018-01-03 11:29 ` Rafael J. Wysocki
2018-01-03 11:49 ` [PATCH] ACPI / WMI: Call acpi_wmi_init() later Rafael J. Wysocki
2018-01-05 23:30 ` Rafael J. Wysocki [this message]
2018-01-06 1:16 ` Darren Hart
2018-01-06 11:02 ` Jonathan McDowell
2018-01-06 22:59 ` Darren Hart
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=CAJZ5v0jxVUxFetwPaj76FoeQjHtSSwO+4jiEqadA1WXZ_YNNoQ@mail.gmail.com \
--to=rafael@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dvhart@infradead.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@amacapital.net \
--cc=noodles@earth.li \
--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