The patch titled request_firmware: skip timeout if userspace was not notified has been removed from the -mm tree. Its filename was request_firmware-skip-timeout-if-userspace-was-not-notified.patch This patch was dropped because it was nacked ------------------------------------------------------ Subject: request_firmware: skip timeout if userspace was not notified From: Javier Pello <javier.pello@xxxxxxx> Make request_firmware skip the usual grace period that it gives firmware images to show up, if it determines that userspace was not notified at all. When request_firmware is called, it sends an event to userspace to ask for the firmware image that is needed, and then it installs a timeout so that it will not wait forever for the image. However, if userspace did not receive the event at all (no /sbin/hotplug, for instance), then having the kernel wait is pointless. This is particularly true during boot, when the wait is done synchronously and the whole kernel freezes for a minute. The attached patch fixes this by making _request_firmware check whether the firmware loading event was succesfully sent to userspace, and skip the timeout if it has not. The patch comes in two parts: 1. The first part changes kobject_uevent_env in lib/kobject_uevent.c to report a failure if both netlink_broadcast (if applicable) and call_usermodehelper fail to send the event to userspace. Nothing in the kernel seems to care about the return value of kobject_uevent_env, so this should not break anything. 2. The second part changes _request_firmware in drivers/base/firmware_class.c to actually check the return value of kobject_uevent and skip the loading_timeout delay if the loading event Signed-off-by: Javier Pello <javier.pello@xxxxxxx> Cc: Greg KH <greg@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/base/firmware_class.c | 8 ++++++-- lib/kobject_uevent.c | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff -puN drivers/base/firmware_class.c~request_firmware-skip-timeout-if-userspace-was-not-notified drivers/base/firmware_class.c --- a/drivers/base/firmware_class.c~request_firmware-skip-timeout-if-userspace-was-not-notified +++ a/drivers/base/firmware_class.c @@ -421,8 +421,12 @@ _request_firmware(const struct firmware add_timer(&fw_priv->timeout); } - kobject_uevent(&f_dev->kobj, KOBJ_ADD); - wait_for_completion(&fw_priv->completion); + retval = kobject_uevent(&f_dev->kobj, KOBJ_ADD); + if (retval) { + fw_load_abort(fw_priv); + } else { + wait_for_completion(&fw_priv->completion); + } set_bit(FW_STATUS_DONE, &fw_priv->status); del_timer_sync(&fw_priv->timeout); } else diff -puN lib/kobject_uevent.c~request_firmware-skip-timeout-if-userspace-was-not-notified lib/kobject_uevent.c --- a/lib/kobject_uevent.c~request_firmware-skip-timeout-if-userspace-was-not-notified +++ a/lib/kobject_uevent.c @@ -186,7 +186,8 @@ int kobject_uevent_env(struct kobject *k } NETLINK_CB(skb).dst_group = 1; - netlink_broadcast(uevent_sock, skb, 0, 1, GFP_KERNEL); + retval = netlink_broadcast(uevent_sock, skb, 0, 1, + GFP_KERNEL); } } #endif @@ -198,7 +199,18 @@ int kobject_uevent_env(struct kobject *k argv [0] = uevent_helper; argv [1] = (char *)subsystem; argv [2] = NULL; - call_usermodehelper (argv[0], argv, envp, UMH_WAIT_EXEC); +#if defined(CONFIG_NET) + if (retval) { + retval = call_usermodehelper (argv[0], argv, envp, + UMH_WAIT_EXEC); + } else { + call_usermodehelper (argv[0], argv, envp, + UMH_WAIT_EXEC); + } +#else + retval = call_usermodehelper (argv[0], argv, envp, + UMH_WAIT_EXEC); +#endif } exit: _ Patches currently in -mm which might be from javier.pello@xxxxxxx are request_firmware-skip-timeout-if-userspace-was-not-notified.patch request_firmware-skip-timeout-if-userspace-was-not-notified-fix.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html