Skip to contentSkip to conversation

r8169: remove "PHY reset until link up" log spam

PATCH Superseded Peter Wu 4 participants 13 messages Jul 23, 2013

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Peter Wu

author
#0 lore raw

This message was added in commit a7154cb8 (June 2004) and is printed every ten seconds when no cable is connected.

---
Using ethtool to silence *all* link warnings is still a manual operation, in my opinion not acceptable so let's remove this message.

The r8169 constantly resets the device when no link is connected, contrary the r8168 vendor driver which only resets the link when some PCI config fields have been modified. As the current reset logic in r8168 seems to work for broken device (which I do not have have and therefore cannot test), I did not attempt to "clean this up".

---
 drivers/net/ethernet/realtek/r8169.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/realtek/r8169.c +0 -2
index 880015c..63f04af 100644
@@ -3689,8 +3689,6 @@ static void rtl_phy_work(struct rtl8169_private *tp)
 	if (tp->link_ok(ioaddr))
 		return;
 
-	netif_warn(tp, link, tp->dev, "PHY reset until link up\n");
-
 	tp->phy_reset_enable(tp);
 
 out_mod_timer:
Signature · 1 line
1.8.3.3
#1 lore raw

Hello.

Quoted 1 line · Peter Wu

This message was added in commit a7154cb8 (June 2004) and is printed

Please also specify that commit's summary line in parens.

Quoted 3 lines

every ten seconds when no cable is connected.

WBR, Sergei

author
#2 lore raw

PATCH v2 1/1 r8169: remove "PHY reset until link up" log spam

This message was added in commit a7154cb8 (June 2004, [PATCH] r8169:
link handling and phy reset rework) and is printed every ten seconds when no cable is connected. (Before that commit, "Reset RTL8169s PHY" would be printed instead.)

---

Quoted 4 lines · On Tuesday 23 July 2013 16:22:57 Sergei Shtylyov wrote:
Quoted 1 line · Peter Wu

This message was added in commit a7154cb8 (June 2004) and is printed

Please also specify that commit's summary line in parens.

Done, while at it I have also noted that an other spam message would be logged.

---
 drivers/net/ethernet/realtek/r8169.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/realtek/r8169.c +0 -2
index 880015c..63f04af 100644
@@ -3689,8 +3689,6 @@ static void rtl_phy_work(struct rtl8169_private *tp)
 	if (tp->link_ok(ioaddr))
 		return;
 
-	netif_warn(tp, link, tp->dev, "PHY reset until link up\n");
-
 	tp->phy_reset_enable(tp);
 
 out_mod_timer:
Signature · 1 line
1.8.3.3
#3 lore raw

Peter Wu <[email protected]> :

Quoted 3 lines

This message was added in commit a7154cb8 (June 2004, [PATCH] r8169:
link handling and phy reset rework) and is printed every ten seconds when no cable is connected.

+ and runtime power management is disabled.

It isn't completely academic: Fedora has it enabled.

You have the implicit ack of David, so please keep the facts right.

Signature · 1 line
Ueimor
author
#4 lore raw
Quoted 7 lines · On Tuesday 23 July 2013 22:23:12 Francois Romieu wrote:

Peter Wu <[email protected]> :

Quoted 3 lines

This message was added in commit a7154cb8 (June 2004, [PATCH] r8169:
link handling and phy reset rework) and is printed every ten seconds when no cable is connected.

+ and runtime power management is disabled.
It isn't completely academic: Fedora has it enabled.

I have not really considered runtime PM before, aren't the ethtool operations actually broken with runtime PM enabled? Or does the ethtool core take care of waking devices (which I doubt)? I don't see any attempt to wake devices in the r8169 ethtool operations.

Quoted 1 line

You have the implicit ack of David, so please keep the facts right.

I am not trying to hide details, before I send the third revision of third commit message, what other details may I have overseen? If you want to, you can also create a patch with an appropriate commit message, I don't mind.

Regards,
Peter

#5 lore raw

Peter Wu <[email protected]> :
[...]

Quoted 4 lines

I have not really considered runtime PM before, aren't the ethtool operations actually broken with runtime PM enabled ? Or does the ethtool core take care of waking devices (which I doubt) ? I don't see any attempt to wake devices in the r8169 ethtool operations.

ethtool core bails out.

See dev_ethtool, netif_device_present, rtl8169_net_suspend and netif_device_detach.

[...]

Quoted 3 lines
Quoted 1 line

You have the implicit ack of David, so please keep the facts right.

I am not trying to hide details, before I send the third revision of third commit message, what other details may I have overseen ?

Use netif_dbg instead of removing the message ?

Quoted 2 lines

If you want to, you can also create a patch with an appropriate commit message, I don't mind.

[...]
- when no cable is connected.
+ when no cable is connected and runtime power management is disabled.

That's it. Your patch, your credit.

Signature · 1 line
Ueimor
#6 lore raw
In reply to Peter Wu
Quoted 22 lines · On Tue, 23 Jul 2013 11:55:57 +0200 Peter Wu <[email protected]> wrote:

This message was added in commit a7154cb8 (June 2004) and is printed every ten seconds when no cable is connected.

---
Using ethtool to silence *all* link warnings is still a manual operation, in my opinion not acceptable so let's remove this message.

The r8169 constantly resets the device when no link is connected, contrary the r8168 vendor driver which only resets the link when some PCI config fields have been modified. As the current reset logic in r8168 seems to work for broken device (which I do not have have and therefore cannot test), I did not attempt to "clean this up".

---
 drivers/net/ethernet/realtek/r8169.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/realtek/r8169.c +0 -0
index 880015c..63f04af 100644

drivers/net/ethernet/realtek/r8169.c static void rtl_phy_work(struct rtl8169_private *tp) · line 3694

Quoted 8 lines
drivers/net/ethernet/realtek/r8169.c +0 -2
@@ -3689,8 +3689,6 @@ static void rtl_phy_work(struct rtl8169_private *tp)
 	if (tp->link_ok(ioaddr))
 		return;
 
-	netif_warn(tp, link, tp->dev, "PHY reset until link up\n");
-
 	tp->phy_reset_enable(tp);
 
 out_mod_timer:

Why not implement netif msg flag to allow user to control this?

author
#7 lore raw
Quoted 31 lines · On Tuesday 23 July 2013 08:54:36 Stephen Hemminger wrote:

On Tue, 23 Jul 2013 11:55:57 +0200

Quoted 28 lines · Peter Wu

This message was added in commit a7154cb8 (June 2004) and is printed every ten seconds when no cable is connected.

---
Using ethtool to silence *all* link warnings is still a manual operation, in my opinion not acceptable so let's remove this message.

The r8169 constantly resets the device when no link is connected, contrary the r8168 vendor driver which only resets the link when some PCI config fields have been modified. As the current reset logic in r8168 seems to work for broken device (which I do not have have and therefore cannot test), I did not attempt to "clean this up".
---

 drivers/net/ethernet/realtek/r8169.c | 2 --
 1 file changed, 2 deletions(-)
(quoted diff) +0 -0

b/drivers/net/ethernet/realtek/r8169.c index 880015c..63f04af 100644

drivers/net/ethernet/realtek/r8169.c +0 -0
@@ -3689,8 +3689,6 @@ static void rtl_phy_work(struct rtl8169_private *tp)
 
 	if (tp->link_ok(ioaddr))
 
 		return;
 
Quoted 7 lines
Quoted 6 lines
drivers/net/ethernet/realtek/r8169.c +0 -2
-	netif_warn(tp, link, tp->dev, "PHY reset until link up\n");
-
 

tp->phy_reset_enable(tp);

out_mod_timer:

Why not implement netif msg flag to allow user to control this?

Which user wants to get log spam every ten seconds? I see no purpose except when a developer asks a user to turn this on, or except if you are a developer. This message was added almost ten years ago, Realtek must certainly have improved their hardware not to be so crappy?

See also <http://marc.info/?l=linux-netdev&m=137452974325684&w=2> where David

Quoted 3 lines · Miller

In every case where this issue has popped up, we have decided that printing messages when the cable is simply unplugged is very undesirable.

Regards,
Peter

#8 lore raw
Quoted 45 lines · On Tue, 23 Jul 2013 18:07:15 +0200 Peter Wu <[email protected]> wrote:
Quoted 31 lines · On Tuesday 23 July 2013 08:54:36 Stephen Hemminger wrote:

On Tue, 23 Jul 2013 11:55:57 +0200

Quoted 28 lines · Peter Wu

This message was added in commit a7154cb8 (June 2004) and is printed every ten seconds when no cable is connected.

---
Using ethtool to silence *all* link warnings is still a manual operation, in my opinion not acceptable so let's remove this message.

The r8169 constantly resets the device when no link is connected, contrary the r8168 vendor driver which only resets the link when some PCI config fields have been modified. As the current reset logic in r8168 seems to work for broken device (which I do not have have and therefore cannot test), I did not attempt to "clean this up".
---

 drivers/net/ethernet/realtek/r8169.c | 2 --
 1 file changed, 2 deletions(-)
(quoted diff) +0 -0

b/drivers/net/ethernet/realtek/r8169.c index 880015c..63f04af 100644

drivers/net/ethernet/realtek/r8169.c +0 -0
@@ -3689,8 +3689,6 @@ static void rtl_phy_work(struct rtl8169_private *tp)
 
 	if (tp->link_ok(ioaddr))
 
 		return;
 
Quoted 7 lines
Quoted 6 lines
drivers/net/ethernet/realtek/r8169.c +0 -2
-	netif_warn(tp, link, tp->dev, "PHY reset until link up\n");
-
 

tp->phy_reset_enable(tp);

out_mod_timer:

Why not implement netif msg flag to allow user to control this?

Which user wants to get log spam every ten seconds? I see no purpose except when a developer asks a user to turn this on, or except if you are a developer. This message was added almost ten years ago, Realtek must certainly have improved their hardware not to be so crappy?

Quoted 8 lines

See also <http://marc.info/?l=linux-netdev&m=137452974325684&w=2> where David

Quoted 3 lines · Miller

In every case where this issue has popped up, we have decided that printing messages when the cable is simply unplugged is very undesirable.

Regards,
Peter

I meant the general link up/down message, not the silly polling message

#9 lore raw

This is what I was talking about, some patch like this.

drivers/net/ethernet/realtek/r8169.c +3 -2
@@ -1496,11 +1496,12 @@ static void __rtl8169_check_link_status(
 		if (pm)
 			pm_request_resume(&tp->pci_dev->dev);
 		netif_carrier_on(dev);
-		if (net_ratelimit())
+		if (netif_msg_ifup(tp))
 			netif_info(tp, ifup, dev, "link up\n");
 	} else {
 		netif_carrier_off(dev);
-		netif_info(tp, ifdown, dev, "link down\n");
+		if (netif_msg_ifdown(tp))
+			netif_info(tp, ifdown, dev, "link down\n");
 		if (pm)
 			pm_schedule_suspend(&tp->pci_dev->dev, 5000);
 	}
#10 lore raw
In reply to Peter Wu

Peter Wu <[email protected]> :
[...]

Quoted 1 line

Which user wants to get log spam every ten seconds ?

In my world users - be they big workstations or runtime pm enabled laptops - may not even care about log [1].

Quoted 2 lines

I see no purpose except when a developer asks a user to turn this on, or except if you are a developer.

Exactly. You'll easily guess which side I'm on with my load of problem reports that have no simple solution and slowly ages while bugfixes flow through -stable.

Quoted 2 lines

This message was added almost ten years ago, Realtek must certainly have improved their hardware not to be so crappy ?

With due respect to Realtek, git log or Realtek's own Release.txt file do not exactly paint the world as a faery of unicorns.

(Realtek is not alone: manufacturers can be quite creative)

[1] Linus is not a real user.

Signature · 1 line
Ueimor
author
#11 lore raw
Quoted 7 lines · On Tuesday 23 July 2013 22:23:40 Francois Romieu wrote:

Peter Wu <[email protected]> :
[...]

Quoted 1 line

Which user wants to get log spam every ten seconds ?

In my world users - be they big workstations or runtime pm enabled laptops - may not even care about log [1].

So I am not a real user either because I keep journalctl open / tailf log files? I see what you are trying to note, but I doubt the usefulness of this specific message. This message appears if:
(1) The device has just been brought up.
(2) Has not been connected before while being up.
(3) Is enabled all the time (runtime PM?)
(4) No reset it pending.

Only the last point cannot easily be determine from a log context, but these do not seem to appear on recent devices? (I've never experienced link issues with Realtek Ethernet cards, wireless is another thing)

Quoted 5 lines
Quoted 2 lines

This message was added almost ten years ago, Realtek must certainly have improved their hardware not to be so crappy ?

With due respect to Realtek, git log or Realtek's own Release.txt file do not exactly paint the world as a faery of unicorns.

Or even using the file header as revision log... anyway, you cannot make money by selling just crap right? There is enough competition on this market.

Regards,
Peter

#12 lore raw

Peter Wu <[email protected]> :
[...]

Quoted 2 lines

Or even using the file header as revision log... anyway, you cannot make money by selling just crap right ?

Let's stop discussing this topic before it gets depressing, ok ?

And, no, you are not a real user anymore. Get over it.

Signature · 1 line
Ueimor