Skip to contentSkip to conversation

r8169: avoid duplicated messages if loading firmware fails and switch to warn level

PATCH Applied Heiner Kallweit 3 participants 3 messages Oct 16, 2024 – Oct 20, 2024

Subsystems (3)
lore
Share & tools
lore

Heiner Kallweit

author maintainer
#0 lore raw

PATCH 1/1 r8169: avoid duplicated messages if loading firmware fails and switch to warn level

In case of a problem with firmware loading we inform at the driver level, in addition the firmware load code itself issues warnings. Therefore switch to firmware_request_nowarn() to avoid duplicated error messages. In addition switch to warn level because the firmware is optional and typically just fixes compatibility issues.

---
 drivers/net/ethernet/realtek/r8169_firmware.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/realtek/r8169_firmware.c +3 -3
index ed6e721b1..bf055078a 100644
@@ -215,7 +215,7 @@ int rtl_fw_request_firmware(struct rtl_fw *rtl_fw)
 {
 	int rc;
 
-	rc = request_firmware(&rtl_fw->fw, rtl_fw->fw_name, rtl_fw->dev);
+	rc = firmware_request_nowarn(&rtl_fw->fw, rtl_fw->fw_name, rtl_fw->dev);
 	if (rc < 0)
 		goto out;
 
@@ -227,7 +227,7 @@ int rtl_fw_request_firmware(struct rtl_fw *rtl_fw)
 
 	return 0;
 out:
-	dev_err(rtl_fw->dev, "Unable to load firmware %s (%d)\n",
-		rtl_fw->fw_name, rc);
+	dev_warn(rtl_fw->dev, "Unable to load firmware %s (%d)\n",
+		 rtl_fw->fw_name, rc);
 	return rc;
 }
Signature · 1 line
2.47.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Heiner Kallweit

In case of a problem with firmware loading we inform at the driver level, in addition the firmware load code itself issues warnings. Therefore switch to firmware_request_nowarn() to avoid duplicated error messages. In addition switch to warn level because the firmware is optional and typically just fixes compatibility issues.

Thanks,

I agree that this is an appropriate use of firmware_request_nowarn() which allows for uniform logging of error conditions by rtl_fw_request_firmware().

I also agree that warnings are sufficient.

#2 lore raw
In reply to Heiner Kallweit
This patch was applied to netdev/net-next.git (main) by Andrew Lunn <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Andrew Lunn <[email protected]>:

Quoted 9 lines · On Wed, 16 Oct 2024 22:29:39 +0200 you wrote:

In case of a problem with firmware loading we inform at the driver level, in addition the firmware load code itself issues warnings. Therefore switch to firmware_request_nowarn() to avoid duplicated error messages. In addition switch to warn level because the firmware is optional and typically just fixes compatibility issues.

[...]

Here is the summary with links:
- [net-next] r8169: avoid duplicated messages if loading firmware fails and switch to warn level

    https://git.kernel.org/netdev/net-next/c/1c105bacb160

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html