From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: [PATCH net-next] net: phy: print error message in phy_error Date: Sun, 16 Dec 2018 09:02:47 -0800 Message-ID: <860777a9-4e51-e472-d376-f5758326c624@gmail.com> References: <5b0ec181-0b51-6e4a-ca1a-097d44c2b7e9@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: "netdev@vger.kernel.org" To: Heiner Kallweit , Andrew Lunn , David Miller Return-path: Received: from mail-oi1-f193.google.com ([209.85.167.193]:41844 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730213AbeLPRCw (ORCPT ); Sun, 16 Dec 2018 12:02:52 -0500 Received: by mail-oi1-f193.google.com with SMTP id j21so8362353oii.8 for ; Sun, 16 Dec 2018 09:02:51 -0800 (PST) In-Reply-To: <5b0ec181-0b51-6e4a-ca1a-097d44c2b7e9@gmail.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: Le 12/16/18 à 7:52 AM, Heiner Kallweit a écrit : > So far phy_error() silently stops the PHY state machine. If the network > driver doesn't inform about a MDIO error then the user may wonder why > his network is down. So let's inform the user. > > Signed-off-by: Heiner Kallweit Reviewed-by: Florian Fainelli Kind of similar to the netdev watchdog on a TX timeout, I wonder if we should not just put a WARN() here to get a complete stack trace to help debug those events? > --- > drivers/net/phy/phy.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c > index 890ae1d73..a898fa411 100644 > --- a/drivers/net/phy/phy.c > +++ b/drivers/net/phy/phy.c > @@ -739,6 +739,8 @@ static void phy_error(struct phy_device *phydev) > phydev->state = PHY_HALTED; > mutex_unlock(&phydev->lock); > > + phydev_err(phydev, "stopping PHY state machine due to error\n"); > + > phy_trigger_machine(phydev); > } > > -- Florian