Lines Matching +full:timeout +full:- +full:secs

1 // SPDX-License-Identifier: GPL-2.0
19 * use small loading timeout for caching devices' firmware because all these
22 * current distributions is about 2M bytes, so 10 secs should be enough.
30 /* Restores the timeout to the value last configured during normal operation */
42 static inline int fw_sysfs_wait_timeout(struct fw_priv *fw_priv, long timeout) in fw_sysfs_wait_timeout() argument
44 return __fw_state_wait_common(fw_priv, timeout); in fw_sysfs_wait_timeout()
57 if (kill_all || !fw_priv->need_uevent) in kill_pending_fw_fallback_reqs()
68 * fw_load_sysfs_fallback() - load a firmware via the sysfs fallback mechanism
70 * @timeout: timeout to wait for the load
74 static int fw_load_sysfs_fallback(struct fw_sysfs *fw_sysfs, long timeout) in fw_load_sysfs_fallback() argument
77 struct device *f_dev = &fw_sysfs->dev; in fw_load_sysfs_fallback()
78 struct fw_priv *fw_priv = fw_sysfs->fw_priv; in fw_load_sysfs_fallback()
81 if (!fw_priv->data) in fw_load_sysfs_fallback()
82 fw_priv->is_paged_buf = true; in fw_load_sysfs_fallback()
95 retval = -EINTR; in fw_load_sysfs_fallback()
98 list_add(&fw_priv->pending_list, &pending_fw_head); in fw_load_sysfs_fallback()
101 if (fw_priv->opt_flags & FW_OPT_UEVENT) { in fw_load_sysfs_fallback()
102 fw_priv->need_uevent = true; in fw_load_sysfs_fallback()
104 dev_dbg(f_dev, "firmware: requesting %s\n", fw_priv->fw_name); in fw_load_sysfs_fallback()
105 kobject_uevent(&fw_sysfs->dev.kobj, KOBJ_ADD); in fw_load_sysfs_fallback()
107 timeout = MAX_JIFFY_OFFSET; in fw_load_sysfs_fallback()
110 retval = fw_sysfs_wait_timeout(fw_priv, timeout); in fw_load_sysfs_fallback()
111 if (retval < 0 && retval != -ENOENT) { in fw_load_sysfs_fallback()
118 if (retval == -ERESTARTSYS) in fw_load_sysfs_fallback()
119 retval = -EINTR; in fw_load_sysfs_fallback()
120 } else if (fw_priv->is_paged_buf && !fw_priv->data) in fw_load_sysfs_fallback()
121 retval = -ENOMEM; in fw_load_sysfs_fallback()
135 long timeout; in fw_load_from_user_helper() local
138 timeout = firmware_loading_timeout(); in fw_load_from_user_helper()
140 timeout = usermodehelper_read_lock_wait(timeout); in fw_load_from_user_helper()
141 if (!timeout) { in fw_load_from_user_helper()
144 return -EBUSY; in fw_load_from_user_helper()
161 fw_sysfs->fw_priv = firmware->priv; in fw_load_from_user_helper()
162 ret = fw_load_sysfs_fallback(fw_sysfs, timeout); in fw_load_from_user_helper()
203 * firmware_fallback_sysfs() - use the fallback mechanism to find firmware