]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: dell-*wmi*: Relay failed initial probe to dependent drivers
authorMario Limonciello <mario.limonciello@dell.com>
Thu, 9 Nov 2017 17:49:10 +0000 (11:49 -0600)
committerDarren Hart (VMware) <dvhart@infradead.org>
Fri, 17 Nov 2017 01:45:26 +0000 (17:45 -0800)
commit9561dac981db85561f41ec3e29d10f4b710ede2a
treea49852abaa758657c61145842cfd73094f0bd3e9
parent71ccc75c894781544217ac6ce47212e0ab1c7ded
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>
drivers/platform/x86/dell-smbios-wmi.c
drivers/platform/x86/dell-wmi-descriptor.c
drivers/platform/x86/dell-wmi-descriptor.h
drivers/platform/x86/dell-wmi.c