From: Heiner Kallweit Subject: [PATCH v2 net-next] net: phy: print stack trace in phy_error Date: Sun, 16 Dec 2018 19:18:26 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "netdev@vger.kernel.org" To: Andrew Lunn , Florian Fainelli , David Miller Return-path: Received: from mail-wm1-f65.google.com ([209.85.128.65]:52208 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730518AbeLPSSd (ORCPT ); Sun, 16 Dec 2018 13:18:33 -0500 Received: by mail-wm1-f65.google.com with SMTP id s14so10221222wmh.1 for ; Sun, 16 Dec 2018 10:18:32 -0800 (PST) Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: 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. Let's print the stack trace to facilitate search for the root cause of the error. Signed-off-by: Heiner Kallweit --- 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 21df28b98..d33e7b3ca 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -730,6 +730,8 @@ void phy_stop_machine(struct phy_device *phydev) */ static void phy_error(struct phy_device *phydev) { + WARN_ON(1); + mutex_lock(&phydev->lock); phydev->state = PHY_HALTED; mutex_unlock(&phydev->lock); -- 2.20.0