Skip to contentSkip to conversation

r8152: replace dev_info with dev_dbg for loading firmware

PATCH Applied Hayes Wang 3 participants 3 messages Apr 24, 2024 – Apr 26, 2024

Subsystems (4)
lore
Share & tools
lore

Hayes Wang

author
#0 lore raw

PATCH 1/1 r8152: replace dev_info with dev_dbg for loading firmware

Someone complains the message appears continuously. This occurs because the device is woken from UPS mode, and the driver re-loads the firmware.

When the device enters runtime suspend and cable is unplugged, the device would enter UPS mode. If the runtime resume occurs, and the device is woken from UPS mode, the driver has to re-load the firmware and causes the message. If someone wakes the device continuously, the message would be shown continuously, too. Use dev_dbg to avoid it.

Note that, the function could be called before register_netdev(), so I don't use netif_info() or netif_dbg().

---
 drivers/net/usb/r8152.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/r8152.c +1 -1
index 5d6aeb086fc7..51e9f5b2dccf 100644
@@ -5274,7 +5274,7 @@ static void rtl8152_apply_firmware(struct r8152 *tp, bool power_cut)
 
 	rtl_reset_ocp_base(tp);
 	strscpy(rtl_fw->version, fw_hdr->version, RTL_VER_SIZE);
-	dev_info(&tp->intf->dev, "load %s successfully\n", rtl_fw->version);
+	dev_dbg(&tp->intf->dev, "load %s successfully\n", rtl_fw->version);
 }
 
 static void rtl8152_release_firmware(struct r8152 *tp)
Signature · 1 line
2.44.0
#1 lore raw

PATCH 1/1 r8152: replace dev_info with dev_dbg for loading firmware

Quoted 24 lines

Someone complains the message appears continuously. This occurs because the device is woken from UPS mode, and the driver re-loads the firmware.

When the device enters runtime suspend and cable is unplugged, the device would enter UPS mode. If the runtime resume occurs, and the device is woken from UPS mode, the driver has to re-load the firmware and causes the message. If someone wakes the device continuously, the message would be shown continuously, too. Use dev_dbg to avoid it.

Note that, the function could be called before register_netdev(), so I don't use netif_info() or netif_dbg().

---
 drivers/net/usb/r8152.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/r8152.c index renamed from drivers/net/usb/r8152.c +0 -0

5d6aeb086fc7..51e9f5b2dccf 100644

drivers/net/usb/r8152.c static void rtl8152_apply_firmware(struct r8152 *tp, · line 5278

Quoted 6 lines
drivers/net/usb/r8152.c +1 -1
@@ -5274,7 +5274,7 @@ static void rtl8152_apply_firmware(struct r8152 *tp,
 bool power_cut)
 
 	rtl_reset_ocp_base(tp);
 	strscpy(rtl_fw->version, fw_hdr->version, RTL_VER_SIZE);
-	dev_info(&tp->intf->dev, "load %s successfully\n", rtl_fw->version);
+	dev_dbg(&tp->intf->dev, "load %s successfully\n", rtl_fw->version);

Since enabling dev_dbg involves re-compiling kernel if CONFIG_DYNAMIC_DEBUG not enabled,
Does it make sense to use "dev_info_ratelimited" here.

Thanks,
Hariprasad k

Quoted 6 lines
drivers/net/usb/r8152.c +0 -0
 }
 

static void rtl8152_release_firmware(struct r8152 *tp)
--
2.44.0

#2 lore raw
In reply to Hayes Wang
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

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

Quoted 11 lines · On Wed, 24 Apr 2024 16:45:32 +0800 you wrote:

Someone complains the message appears continuously. This occurs because the device is woken from UPS mode, and the driver re-loads the firmware.

When the device enters runtime suspend and cable is unplugged, the device would enter UPS mode. If the runtime resume occurs, and the device is woken from UPS mode, the driver has to re-load the firmware and causes the message. If someone wakes the device continuously, the message would be shown continuously, too. Use dev_dbg to avoid it.

[...]

Here is the summary with links:
- [net-next] r8152: replace dev_info with dev_dbg for loading firmware

    https://git.kernel.org/netdev/net-next/c/092d214138fd

You are awesome, thank you!

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