diff mbox series

[net-next] r8169: avoid duplicated messages if loading firmware fails and switch to warn level

Message ID d9c5094c-89a6-40e2-b5fe-8df7df4624ef@gmail.com (mailing list archive)
State Accepted
Commit 1c105bacb160b5918e917ab811552b7be69fc69c
Delegated to: Netdev Maintainers
Headers show
Series [net-next] r8169: avoid duplicated messages if loading firmware fails and switch to warn level | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 5 this patch: 5
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 17 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-10-19--00-00 (tests: 777)

Commit Message

Heiner Kallweit Oct. 16, 2024, 8:29 p.m. UTC
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.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/ethernet/realtek/r8169_firmware.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Simon Horman Oct. 17, 2024, 3:54 p.m. UTC | #1
On Wed, Oct 16, 2024 at 10:29:39PM +0200, Heiner Kallweit 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.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

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.

Reviewed-by: Simon Horman <horms@kernel.org>
patchwork-bot+netdevbpf@kernel.org Oct. 20, 2024, 4:10 p.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Andrew Lunn <andrew@lunn.ch>:

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.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> 
> [...]

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!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/realtek/r8169_firmware.c b/drivers/net/ethernet/realtek/r8169_firmware.c
index ed6e721b1..bf055078a 100644
--- a/drivers/net/ethernet/realtek/r8169_firmware.c
+++ b/drivers/net/ethernet/realtek/r8169_firmware.c
@@ -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;
 }