From: Darren Hart <dvhart@infradead.org>
To: Mario Limonciello <mario.limonciello@dell.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
pali.rohar@gmail.com, LKML <linux-kernel@vger.kernel.org>,
platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v3 3/3] platform/x86: dell-smbios: Link all dell-smbios-* modules together
Date: Thu, 1 Mar 2018 09:48:45 -0800 [thread overview]
Message-ID: <20180301174845.GA25613@fury> (raw)
In-Reply-To: <1519755784-2155-3-git-send-email-mario.limonciello@dell.com>
On Tue, Feb 27, 2018 at 12:23:04PM -0600, Mario Limonciello wrote:
> Some race conditions were raised due to dell-smbios and its backends
> not being ready by the time that a consumer would call one of the
> exported methods.
>
> To avoid this problem, guarantee that all initialization has been
> done by linking them all together and running init for them all.
>
> As part of this change the Kconfig needs to be adjusted so that
> CONFIG_DELL_SMBIOS_SMM and CONFIG_DELL_SMBIOS_WMI are boolean
> rather than modules.
>
> CONFIG_DELL_SMBIOS is a visually selectable option again and both
> CONFIG_DELL_SMBIOS_WMI and CONFIG_DELL_SMBIOS_SMM are optional.
>
> Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
> ---
> Changes from v2:
> * Move rest of #ifdef out of source files
> * Only compile units as necessary
>
> drivers/platform/x86/Kconfig | 11 ++++++++---
> drivers/platform/x86/Makefile | 4 ++--
> drivers/platform/x86/dell-smbios-base.c | 21 ++++++++++++++++++++-
> drivers/platform/x86/dell-smbios-smm.c | 18 ++++--------------
> drivers/platform/x86/dell-smbios-wmi.c | 14 ++++----------
> drivers/platform/x86/dell-smbios.h | 27 ++++++++++++++++++++++++++-
> 6 files changed, 64 insertions(+), 31 deletions(-)
>
> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index 9a8f964..0c0897e 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -106,10 +106,15 @@ config ASUS_LAPTOP
> If you have an ACPI-compatible ASUS laptop, say Y or M here.
>
> config DELL_SMBIOS
> - tristate
> + tristate "Dell SMBIOS driver"
> + ---help---
> + This provides support for the Dell SMBIOS calling interface.
> + If you have a Dell computer you should enable this option.
> +
> + Be sure to select at least one backend for it to work properly.
In order to make the default sane, I would suggest making the above a menu
(default n), nesting the two options below, and making WMI a default=y. This
satisfies Linus' requirement by defaulting everything to n, but enables a sane
default IFF the DELL_SMBIOS menu is enabled.
Alternatively, all of the above can be put under the "Dell Extras" menu I
proposed, and DELL_SMBIOS can default to m and DELL_SMBIOS_WMI can default to y.
>
> + /* register backends */
> + wmi = init_dell_smbios_wmi();
> + if (wmi)
> + pr_debug("Failed to initialize WMI backend: %d\n", wmi);
> + smm = init_dell_smbios_smm();
> + if (smm)
> + pr_debug("Failed to initialize SMM backend: %d\n", smm);
> + if (wmi && smm) {
> + pr_err("No SMBIOS backends available (wmi: %d, smm: %d)\n",
> + wmi, smm);
> + goto fail_sysfs;
> + }
> +
I like the approach of building a library instead of a bunch of separate
modules.
--
Darren Hart
VMware Open Source Technology Center
next prev parent reply other threads:[~2018-03-01 17:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-27 18:23 [PATCH v3 1/3] platform/x86: dell-smbios: Correct some style warnings Mario Limonciello
2018-02-27 18:23 ` [PATCH v3 2/3] platform/x86: dell-smbios: Rename dell-smbios source to dell-smbios-base Mario Limonciello
2018-02-27 18:23 ` [PATCH v3 3/3] platform/x86: dell-smbios: Link all dell-smbios-* modules together Mario Limonciello
2018-03-01 17:48 ` Darren Hart [this message]
2018-03-01 20:54 ` Mario.Limonciello
2018-03-01 21:38 ` Darren Hart
2018-03-03 0:21 ` Darren Hart
2018-03-03 1:48 ` Mario.Limonciello
2018-03-03 0:55 ` Darren Hart
2018-03-03 2:10 ` Darren Hart
2018-03-03 11:59 ` Mario.Limonciello
2018-03-05 23:48 ` Darren Hart
2018-03-06 0:29 ` Mario.Limonciello
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=20180301174845.GA25613@fury \
--to=dvhart@infradead.org \
--cc=andy.shevchenko@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@dell.com \
--cc=pali.rohar@gmail.com \
--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;
as well as URLs for NNTP newsgroup(s).