Skip to contentSkip to conversation

patch "firmware_loader: use -ETIMEDOUT instead of -EAGAIN in" added to driver-core-linus

PATCH [email protected] 1 participant 1 message Jul 29, 2021

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

firmware_loader: use -ETIMEDOUT instead of -EAGAIN in

to my driver-core git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
in the driver-core-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

From 0d6434e10b5377a006f6dd995c8fc5e2d82acddc Mon Sep 17 00:00:00 2001
From: Anirudh Rayabharam <[email protected]>
Date: Wed, 28 Jul 2021 14:21:06 +0530
Subject: firmware_loader: use -ETIMEDOUT instead of -EAGAIN in
fw_load_sysfs_fallback

The only motivation for using -EAGAIN in commit 0542ad88fbdd81bb ("firmware loader: Fix _request_firmware_load() return val for fw load abort") was to distinguish the error from -ENOMEM, and so there is no real reason in keeping it. -EAGAIN is typically used to tell the userspace to try something again and in this case re-using the sysfs loading interface cannot be retried when a timeout happens, so the return value is also bogus.

-ETIMEDOUT is received when the wait times out and returning that is much more telling of what the reason for the failure was. So, just propagate that instead of returning -EAGAIN.

---
 drivers/base/firmware_loader/fallback.c | 2 --
 1 file changed, 2 deletions(-)
drivers/base/firmware_loader/fallback.c +0 -2
index 91899d185e31..1a48be0a030e 100644
@@ -535,8 +535,6 @@ static int fw_load_sysfs_fallback(struct fw_sysfs *fw_sysfs, long timeout)
 	if (fw_state_is_aborted(fw_priv)) {
 		if (retval == -ERESTARTSYS)
 			retval = -EINTR;
-		else
-			retval = -EAGAIN;
 	} else if (fw_priv->is_paged_buf && !fw_priv->data)
 		retval = -ENOMEM;
 
Signature · 1 line
2.32.0