diff options
author | Mario Limonciello <mario.limonciello@dell.com> | 2017-11-16 22:13:12 -0600 |
---|---|---|
committer | Darren Hart (VMware) <dvhart@infradead.org> | 2017-11-20 12:38:43 -0800 |
commit | 4255c30fe88ee3cc99bbeac7974db27e4217a497 (patch) | |
tree | 4950a7b7da05a1b76e52ba02278fab796faf302b /drivers/platform/x86/dell-smbios-wmi.c | |
parent | aaa40965d2342137d756121993c395e2a7463a8d (diff) | |
download | lwn-4255c30fe88ee3cc99bbeac7974db27e4217a497.tar.gz lwn-4255c30fe88ee3cc99bbeac7974db27e4217a497.zip |
platform/x86: dell-smbios-wmi: Disable userspace interface if missing hotfix
The Dell SMBIOS WMI interface will fail for some more complex calls unless
a WMI hotfix has been included. Most platforms have this fix available in
a maintenance BIOS release. In the case the driver is loaded on a
platform without this fix, disable the userspace interface.
A hotfix indicator is present in the dell-wmi-descriptor that represents
whether or not more complex calls will work properly.
"Simple" calls such as those used by dell-laptop and dell-wmi will continue
to work properly so dell-smbios-wmi should not be blocked from binding and
being used as the dell-smbios dispatcher.
Suggested-by: Girish Prakash <girish.prakash@dell.com>
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Diffstat (limited to 'drivers/platform/x86/dell-smbios-wmi.c')
-rw-r--r-- | drivers/platform/x86/dell-smbios-wmi.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/platform/x86/dell-smbios-wmi.c b/drivers/platform/x86/dell-smbios-wmi.c index 0cab1f9c35af..609557aa5868 100644 --- a/drivers/platform/x86/dell-smbios-wmi.c +++ b/drivers/platform/x86/dell-smbios-wmi.c @@ -147,7 +147,10 @@ fail_smbios_cmd: static int dell_smbios_wmi_probe(struct wmi_device *wdev) { + struct wmi_driver *wdriver = + container_of(wdev->dev.driver, struct wmi_driver, driver); struct wmi_smbios_priv *priv; + u32 hotfix; int count; int ret; @@ -164,6 +167,16 @@ static int dell_smbios_wmi_probe(struct wmi_device *wdev) if (!dell_wmi_get_size(&priv->req_buf_size)) return -EPROBE_DEFER; + /* some SMBIOS calls fail unless BIOS contains hotfix */ + if (!dell_wmi_get_hotfix(&hotfix)) + return -EPROBE_DEFER; + if (!hotfix) { + dev_warn(&wdev->dev, + "WMI SMBIOS userspace interface not supported(%u), try upgrading to a newer BIOS\n", + hotfix); + wdriver->filter_callback = NULL; + } + /* add in the length object we will use internally with ioctl */ priv->req_buf_size += sizeof(u64); ret = set_required_buffer_size(wdev, priv->req_buf_size); |