Linux-USB Archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] r8152: replace dev_info with dev_dbg for loading firmware
@ 2024-04-24  8:45 Hayes Wang
  2024-04-24  9:04 ` Hariprasad Kelam
  2024-04-26  2:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Hayes Wang @ 2024-04-24  8:45 UTC (permalink / raw
  To: kuba, davem; +Cc: netdev, nic_swsd, linux-kernel, linux-usb, Hayes Wang

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().

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 drivers/net/usb/r8152.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 5d6aeb086fc7..51e9f5b2dccf 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -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)
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH net-next] r8152: replace dev_info with dev_dbg for loading firmware
  2024-04-24  8:45 [PATCH net-next] r8152: replace dev_info with dev_dbg for loading firmware Hayes Wang
@ 2024-04-24  9:04 ` Hariprasad Kelam
  2024-04-26  2:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Hariprasad Kelam @ 2024-04-24  9:04 UTC (permalink / raw
  To: Hayes Wang, kuba@kernel.org, davem@davemloft.net
  Cc: netdev@vger.kernel.org, nic_swsd@realtek.com,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org



> 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().
> 
> Signed-off-by: Hayes Wang <hayeswang@realtek.com>
> ---
>  drivers/net/usb/r8152.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index
> 5d6aeb086fc7..51e9f5b2dccf 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -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
>  }
> 
>  static void rtl8152_release_firmware(struct r8152 *tp)
> --
> 2.44.0
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] r8152: replace dev_info with dev_dbg for loading firmware
  2024-04-24  8:45 [PATCH net-next] r8152: replace dev_info with dev_dbg for loading firmware Hayes Wang
  2024-04-24  9:04 ` Hariprasad Kelam
@ 2024-04-26  2:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-26  2:10 UTC (permalink / raw
  To: Hayes Wang; +Cc: kuba, davem, netdev, nic_swsd, linux-kernel, linux-usb

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-26  2:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-24  8:45 [PATCH net-next] r8152: replace dev_info with dev_dbg for loading firmware Hayes Wang
2024-04-24  9:04 ` Hariprasad Kelam
2024-04-26  2:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).