netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usbnet: smsc95xx: Reduce logging noise
@ 2017-03-11  1:45 Guenter Roeck
       [not found] ` <1489196721-12888-1-git-send-email-linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2017-03-11  1:45 UTC (permalink / raw)
  To: Steve Glendinning
  Cc: UNGLinuxDriver, netdev, linux-usb, linux-kernel, Guenter Roeck

An insert/remove stress test generated the following log message sequence.

usb 7-1.1: New USB device found, idVendor=0424, idProduct=ec00
usb 7-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
smsc95xx 7-1.1:1.0 (unnamed net_device) (uninitialized):
				Failed to read reg index 0x00000114: -22
smsc95xx 7-1.1:1.0 (unnamed net_device) (uninitialized):
				Error reading MII_ACCESS
smsc95xx 7-1.1:1.0 (unnamed net_device) (uninitialized):
				MII is busy in smsc95xx_mdio_read

... repeat 100+ times ...

smsc95xx 7-1.1:1.0 (unnamed net_device) (uninitialized):
				MII is busy in smsc95xx_mdio_read
smsc95xx 7-1.1:1.0 (unnamed net_device) (uninitialized):
				timeout on PHY Reset
smsc95xx 7-1.1:1.0 (unnamed net_device) (uninitialized):
				Failed to init PHY
smsc95xx 7-1.1:1.0 (unnamed net_device) (uninitialized):
				Failed to read reg index 0x00000000: -22
smsc95xx: probe of 7-1.1:1.0 failed with error -22
usb usb7: USB disconnect, device number 1
usb 7-1: USB disconnect, device number 2
usb 7-1.1: USB disconnect, device number 3

Use netdev_dbg() instead of netdev_warn() for the repeating messages
to reduce logging noise.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/net/usb/smsc95xx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 831aa33d078a..f69e9e031973 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -100,8 +100,8 @@ static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index,
 		 | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 		 0, index, &buf, 4);
 	if (unlikely(ret < 0)) {
-		netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n",
-			    index, ret);
+		netdev_dbg(dev->net, "Failed to read reg index 0x%08x: %d\n",
+			   index, ret);
 		return ret;
 	}
 
@@ -174,7 +174,7 @@ static int __must_check __smsc95xx_phy_wait_not_busy(struct usbnet *dev,
 	do {
 		ret = __smsc95xx_read_reg(dev, MII_ADDR, &val, in_pm);
 		if (ret < 0) {
-			netdev_warn(dev->net, "Error reading MII_ACCESS\n");
+			netdev_dbg(dev->net, "Error reading MII_ACCESS\n");
 			return ret;
 		}
 
@@ -197,7 +197,7 @@ static int __smsc95xx_mdio_read(struct net_device *netdev, int phy_id, int idx,
 	/* confirm MII not busy */
 	ret = __smsc95xx_phy_wait_not_busy(dev, in_pm);
 	if (ret < 0) {
-		netdev_warn(dev->net, "MII is busy in smsc95xx_mdio_read\n");
+		netdev_dbg(dev->net, "MII is busy in smsc95xx_mdio_read\n");
 		goto done;
 	}
 
-- 
2.7.4

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

* Re: [PATCH] usbnet: smsc95xx: Reduce logging noise
       [not found] ` <1489196721-12888-1-git-send-email-linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
@ 2017-03-13 22:32   ` David Miller
  2017-03-14  2:13     ` Guenter Roeck
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2017-03-13 22:32 UTC (permalink / raw)
  To: linux-0h96xk9xTtrk1uMJSBkQmQ
  Cc: steve.glendinning-nksJyM/082jR7s880joybQ,
	UNGLinuxDriver-UWL1GkI3JZL3oGB3hsPCZA,
	netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

From: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
Date: Fri, 10 Mar 2017 17:45:21 -0800

> An insert/remove stress test generated the following log message sequence.
...
> Use netdev_dbg() instead of netdev_warn() for the repeating messages
> to reduce logging noise.
> 
> Signed-off-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>

The problem I have with changes like this is that outside of your
stress test situation these messages are extremely useful but will
now be hidden making diagnosis of problems more difficult.

Perhaps you can check the error code or some piece of USB device
state to see if there was a disconnect, and elide the log message
in that case specifically.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] usbnet: smsc95xx: Reduce logging noise
  2017-03-13 22:32   ` David Miller
@ 2017-03-14  2:13     ` Guenter Roeck
  0 siblings, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2017-03-14  2:13 UTC (permalink / raw)
  To: David Miller
  Cc: steve.glendinning, UNGLinuxDriver, netdev, linux-usb, linux-kernel

On 03/13/2017 03:32 PM, David Miller wrote:
> From: Guenter Roeck <linux@roeck-us.net>
> Date: Fri, 10 Mar 2017 17:45:21 -0800
>
>> An insert/remove stress test generated the following log message sequence.
> ...
>> Use netdev_dbg() instead of netdev_warn() for the repeating messages
>> to reduce logging noise.
>>
>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>
> The problem I have with changes like this is that outside of your
> stress test situation these messages are extremely useful but will
> now be hidden making diagnosis of problems more difficult.
>

In general I agree, but in this case the calling code also generates
another set of error messages, which I considered a bit excessive.

No problem, though, we can live with the noise.

Guenter

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

end of thread, other threads:[~2017-03-14  2:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-11  1:45 [PATCH] usbnet: smsc95xx: Reduce logging noise Guenter Roeck
     [not found] ` <1489196721-12888-1-git-send-email-linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2017-03-13 22:32   ` David Miller
2017-03-14  2:13     ` Guenter Roeck

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 NNTP newsgroup(s).