From: Darren Hart <dvhart@infradead.org>
To: Mario Limonciello <mario.limonciello@dell.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
platform-driver-x86@vger.kernel.org,
Andy Lutomirski <luto@kernel.org>,
quasisec@google.com, pali.rohar@gmail.com, rjw@rjwysocki.net,
mjg59@google.com, hch@lst.de, Greg KH <greg@kroah.com>
Subject: Re: [PATCH v4 05/14] platform/x86: dell-wmi-descriptor: split WMI descriptor into it's own driver
Date: Wed, 4 Oct 2017 18:09:09 -0700 [thread overview]
Message-ID: <20171005010909.GC25018@fury> (raw)
In-Reply-To: <ff211830e3953c70aa8e0d43614619f1fb423668.1507156392.git.mario.limonciello@dell.com>
On Wed, Oct 04, 2017 at 05:48:31PM -0500, Mario Limonciello wrote:
> All communication on individual GUIDs should occur in separate drivers.
> Allowing a driver to communicate with the bus to another GUID is just
> a hack that discourages drivers to adopt the bus model.
>
> The information found from the WMI descriptor driver is now exported
> for use by other drivers.
>
> Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
> ---
> MAINTAINERS | 5 +
> drivers/platform/x86/Kconfig | 12 +++
> drivers/platform/x86/Makefile | 1 +
> drivers/platform/x86/dell-wmi-descriptor.c | 162 +++++++++++++++++++++++++++++
> drivers/platform/x86/dell-wmi-descriptor.h | 18 ++++
> drivers/platform/x86/dell-wmi.c | 88 ++--------------
> 6 files changed, 205 insertions(+), 81 deletions(-)
> create mode 100644 drivers/platform/x86/dell-wmi-descriptor.c
> create mode 100644 drivers/platform/x86/dell-wmi-descriptor.h
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 08b96f77f618..659dbeec4191 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -4002,6 +4002,11 @@ M: Pali Rohár <pali.rohar@gmail.com>
> S: Maintained
> F: drivers/platform/x86/dell-wmi.c
>
> +DELL WMI DESCRIPTOR DRIVER
> +M: Mario Limonciello <mario.limonciello@dell.com>
> +S: Maintained
> +F: drivers/platform/x86/dell-wmi-descriptor.c
> +
> DELTA ST MEDIA DRIVER
> M: Hugues Fruchet <hugues.fruchet@st.com>
> L: linux-media@vger.kernel.org
> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index 1f7959ff055c..bc347c326d87 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -121,6 +121,7 @@ config DELL_WMI
> depends on DMI
> depends on INPUT
> depends on ACPI_VIDEO || ACPI_VIDEO = n
> + depends on DELL_WMI_DESCRIPTOR
We have to be careful with the use of "select", but I think in this case it
makes sense.
If you "select DELL_WMI_DESCRIPTOR" here, and maintain depends on
ACPI_WMI (not shown in context here), then...
> select DELL_SMBIOS
> select INPUT_SPARSEKMAP
> ---help---
> @@ -129,6 +130,17 @@ config DELL_WMI
> To compile this driver as a module, choose M here: the module will
> be called dell-wmi.
>
> +config DELL_WMI_DESCRIPTOR
> + tristate "Dell WMI descriptor"
> + depends on ACPI_WMI
> + default ACPI_WMI
This default can be dropped, the dependency will be met if DELL_WMI can
be enabled...
> + ---help---
> + Say Y here if you want to be able to read the format of WMI
> + communications on some Dell laptops, desktops and IoT gateways.
> +
> + To compile this driver as a module, choose M here: the module will
> + be called dell-wmi-descriptor.
... and this can be converted to an invisible option and eliminate some
Kconfig clutter.
...
> diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
> index 1366bccdf275..90d7e8e55e9b 100644
...
> @@ -376,7 +375,11 @@ static void dell_wmi_notify(struct wmi_device *wdev,
> * So to prevent reading garbage from buffer we will process only first
> * one event on devices with WMI interface version 0.
> */
> - if (priv->interface_version == 0 && buffer_entry < buffer_end)
> + if (!dell_wmi_get_interface_version(&interface_version)) {
You've introduced a dependency on another module here and haven't
guaranteed that dell-wmi-descriptor will have been loaded prior to this
one.
You'll want to add something like:
#ifdef CONFIG_DELL_WMI_DESCRIPTOR_MODULE
if (request_module("dell_wmi_descriptor"))
/* FAIL */
#endif
During init.
--
Darren Hart
VMware Open Source Technology Center
next prev parent reply other threads:[~2017-10-05 1:09 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-04 22:48 [PATCH v4 00/14] Introduce support for Dell SMBIOS over WMI Mario Limonciello
2017-10-04 22:48 ` [PATCH v4 01/14] platform/x86: wmi: Add new method wmidev_evaluate_method Mario Limonciello
2017-10-04 22:48 ` [PATCH v4 02/14] platform/x86: dell-wmi: clean up wmi descriptor check Mario Limonciello
2017-10-04 22:48 ` [PATCH v4 03/14] platform/x86: dell-wmi: allow 32k return size in the descriptor Mario Limonciello
2017-10-04 22:48 ` [PATCH v4 04/14] platform/x86: dell-wmi: increase severity of some failures Mario Limonciello
2017-10-05 5:20 ` Andy Shevchenko
2017-10-05 15:02 ` Mario.Limonciello
2017-10-05 18:22 ` Andy Shevchenko
2017-10-04 22:48 ` [PATCH v4 05/14] platform/x86: dell-wmi-descriptor: split WMI descriptor into it's own driver Mario Limonciello
2017-10-05 1:09 ` Darren Hart [this message]
2017-10-05 5:29 ` Andy Shevchenko
2017-10-05 7:11 ` Darren Hart
2017-10-05 8:47 ` Andy Shevchenko
2017-10-05 13:59 ` Mario.Limonciello
2017-10-05 14:14 ` Darren Hart
2017-10-05 14:47 ` Mario.Limonciello
2017-10-05 17:22 ` Darren Hart
2017-10-05 17:32 ` Mario.Limonciello
2017-10-05 5:34 ` Andy Shevchenko
2017-10-05 17:04 ` Mario.Limonciello
2017-10-04 22:48 ` [PATCH v4 06/14] platform/x86: wmi: Don't allow drivers to get each other's GUIDs Mario Limonciello
2017-10-04 22:48 ` [PATCH v4 07/14] platform/x86: dell-smbios: only run if proper oem string is detected Mario Limonciello
2017-10-04 22:48 ` [PATCH v4 08/14] platform/x86: dell-smbios: Add a sysfs interface for SMBIOS tokens Mario Limonciello
2017-10-05 8:49 ` Andy Shevchenko
2017-10-05 13:58 ` Mario.Limonciello
2017-10-05 14:22 ` Andy Shevchenko
2017-10-04 22:48 ` [PATCH v4 09/14] platform/x86: dell-smbios: Introduce dispatcher for SMM calls Mario Limonciello
2017-10-05 1:57 ` Darren Hart
2017-10-05 15:04 ` Mario.Limonciello
2017-10-04 22:48 ` [PATCH v4 10/14] platform/x86: dell-smbios-smm: test for WSMT Mario Limonciello
2017-10-05 1:59 ` Darren Hart
2017-10-04 22:48 ` [PATCH v4 11/14] platform/x86: dell-smbios-wmi: Add new WMI dispatcher driver Mario Limonciello
2017-10-05 2:14 ` Darren Hart
2017-10-05 15:12 ` Mario.Limonciello
2017-10-05 17:57 ` Darren Hart
2017-10-05 19:47 ` Mario.Limonciello
2017-10-06 16:44 ` Darren Hart
2017-10-06 16:47 ` Mario.Limonciello
2017-10-04 22:48 ` [PATCH v4 12/14] platform/x86: wmi: create character devices when requested by drivers Mario Limonciello
2017-10-05 2:33 ` Darren Hart
2017-10-05 7:16 ` Greg KH
2017-10-05 14:35 ` Mario.Limonciello
2017-10-05 15:42 ` Greg KH
2017-10-05 15:51 ` Pali Rohár
2017-10-05 16:26 ` Greg KH
2017-10-05 17:39 ` Darren Hart
2017-10-05 18:47 ` Greg KH
2017-10-05 19:03 ` Mario.Limonciello
2017-10-05 19:09 ` Greg KH
2017-10-05 19:32 ` Pali Rohár
2017-10-05 19:39 ` Mario.Limonciello
2017-10-05 19:34 ` Mario.Limonciello
2017-10-05 20:58 ` Darren Hart
2017-10-05 20:51 ` Darren Hart
2017-10-04 22:48 ` [PATCH v4 13/14] platform/x86: dell-smbios-wmi: introduce userspace interface Mario Limonciello
2017-10-05 7:23 ` Greg KH
2017-10-05 16:28 ` Mario.Limonciello
2017-10-05 16:34 ` Pali Rohár
2017-10-05 16:40 ` Greg KH
2017-10-05 7:33 ` Greg KH
2017-10-05 16:37 ` Mario.Limonciello
2017-10-05 13:59 ` Alan Cox
2017-10-05 14:22 ` Mario.Limonciello
2017-10-05 15:44 ` Greg KH
2017-10-05 15:56 ` Pali Rohár
2017-10-05 16:28 ` Greg KH
2017-10-05 16:48 ` Mario.Limonciello
2017-10-10 19:40 ` Alan Cox
2017-10-10 19:51 ` Mario.Limonciello
2017-10-04 22:48 ` [PATCH v4 14/14] platform/x86: Kconfig: Set default for dell-smbios to ACPI_WMI Mario Limonciello
2017-10-05 0:09 ` [PATCH v4 00/14] Introduce support for Dell SMBIOS over WMI Darren Hart
2017-10-05 9:00 ` Andy Shevchenko
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=20171005010909.GC25018@fury \
--to=dvhart@infradead.org \
--cc=andy.shevchenko@gmail.com \
--cc=greg@kroah.com \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mario.limonciello@dell.com \
--cc=mjg59@google.com \
--cc=pali.rohar@gmail.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=quasisec@google.com \
--cc=rjw@rjwysocki.net \
/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).