diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-12-02 09:38:16 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-08 21:22:32 -0500 |
commit | bba3a87e982ad5992e776ca1fc409326915d6b44 (patch) | |
tree | 9149b3090514f8715f6899401a4977d3e1dc0d0c /include/linux/firmware.h | |
parent | 020d30f17f196dcbf0c2c68a874345e8885a3149 (diff) |
firmware: Introduce request_firmware_direct()
When CONFIG_FW_LOADER_USER_HELPER is set, request_firmware() falls
back to the usermode helper for loading via udev when the direct
loading fails. But the recent udev takes way too long timeout (60
seconds) for non-existing firmware. This is unacceptable for the
drivers like microcode loader where they load firmwares optionally,
i.e. it's no error even if no requested file exists.
This patch provides a new helper function, request_firmware_direct().
It behaves as same as request_firmware() except for that it doesn't
fall back to usermode helper but returns an error immediately if the
f/w can't be loaded directly in kernel.
Without CONFIG_FW_LOADER_USER_HELPER=y, request_firmware_direct() is
just an alias of request_firmware(), due to obvious reason.
Tested-by: Prarit Bhargava <prarit@redhat.com>
Acked-by: Ming Lei <ming.lei@canonical.com>
Acked-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/firmware.h')
-rw-r--r-- | include/linux/firmware.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index e154c1005cd1..59529330efd6 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
@@ -68,4 +68,11 @@ static inline void release_firmware(const struct firmware *fw) | |||
68 | 68 | ||
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | #ifdef CONFIG_FW_LOADER_USER_HELPER | ||
72 | int request_firmware_direct(const struct firmware **fw, const char *name, | ||
73 | struct device *device); | ||
74 | #else | ||
75 | #define request_firmware_direct request_firmware | ||
76 | #endif | ||
77 | |||
71 | #endif | 78 | #endif |