diff options
author | Mario Limonciello <mario.limonciello@dell.com> | 2017-11-09 11:49:10 -0600 |
---|---|---|
committer | Darren Hart (VMware) <dvhart@infradead.org> | 2017-11-16 17:45:26 -0800 |
commit | 868b8d33f91e431b1961a35baa6b5022639067f3 (patch) | |
tree | a49852abaa758657c61145842cfd73094f0bd3e9 /drivers/platform/x86/dell-wmi-descriptor.h | |
parent | 8b9528a6d9a901b9f933231505fef5630e80ce5a (diff) | |
download | lwn-868b8d33f91e431b1961a35baa6b5022639067f3.tar.gz lwn-868b8d33f91e431b1961a35baa6b5022639067f3.zip |
platform/x86: dell-*wmi*: Relay failed initial probe to dependent drivers
dell-wmi and dell-smbios-wmi are dependent upon dell-wmi-descriptor
finishing probe successfully to probe themselves.
Currently if dell-wmi-descriptor fails probing in a non-recoverable way
(such as invalid header) dell-wmi and dell-smbios-wmi will continue to
try to redo probing due to deferred probing.
To solve this have the dependent drivers query the dell-wmi-descriptor
driver whether the descriptor has been determined valid. The possible
results are:
-ENODEV: Descriptor GUID missing from WMI bus
-EPROBE_DEFER: Descriptor not yet probed, dependent driver should wait
and use deferred probing
< 0: Descriptor probed, invalid. Dependent driver should return an
error.
0: Successful descriptor probe, dependent driver can continue
Successful descriptor probe still doesn't mean that the descriptor driver
is necessarily bound at the time of initialization of dependent driver.
Userspace can unbind the driver, so all methods used from driver
should still be verified to return success values otherwise deferred
probing be used.
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Diffstat (limited to 'drivers/platform/x86/dell-wmi-descriptor.h')
-rw-r--r-- | drivers/platform/x86/dell-wmi-descriptor.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/platform/x86/dell-wmi-descriptor.h b/drivers/platform/x86/dell-wmi-descriptor.h index 5f7b69c2c83a..1e8cb96ffd78 100644 --- a/drivers/platform/x86/dell-wmi-descriptor.h +++ b/drivers/platform/x86/dell-wmi-descriptor.h @@ -13,7 +13,13 @@ #include <linux/wmi.h> -#define DELL_WMI_DESCRIPTOR_GUID "8D9DDCBC-A997-11DA-B012-B622A1EF5492" +/* possible return values: + * -ENODEV: Descriptor GUID missing from WMI bus + * -EPROBE_DEFER: probing for dell-wmi-descriptor not yet run + * 0: valid descriptor, successfully probed + * < 0: invalid descriptor, don't probe dependent devices + */ +int dell_wmi_get_descriptor_valid(void); bool dell_wmi_get_interface_version(u32 *version); bool dell_wmi_get_size(u32 *size); |