From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: [PATCH RFC net-next 2/3] net: phy: sfp: Issue warning when using Generic PHY driver(s) Date: Tue, 6 Nov 2018 15:29:12 -0800 Message-ID: <20181106232913.17216-3-f.fainelli@gmail.com> References: <20181106232913.17216-1-f.fainelli@gmail.com> Cc: andrew@lunn.ch, rmk+kernel@armlinux.org.uk, davem@davemloft.net, Florian Fainelli To: netdev@vger.kernel.org Return-path: Received: from mail-pl1-f194.google.com ([209.85.214.194]:46466 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730409AbeKGI5B (ORCPT ); Wed, 7 Nov 2018 03:57:01 -0500 Received: by mail-pl1-f194.google.com with SMTP id c13-v6so6932840plz.13 for ; Tue, 06 Nov 2018 15:29:22 -0800 (PST) In-Reply-To: <20181106232913.17216-1-f.fainelli@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: 1000BaseT SFP modules typically include an Ethernet PHY device, and while the Generic PHY driver will be able to bind to it, it usually will not work at all without a specialized PHY driver. Issue a warning in that case to help toubleshoot things. Signed-off-by: Florian Fainelli --- drivers/net/phy/sfp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index fd8bb998ae52..228205d8ce84 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -1203,6 +1203,9 @@ static void sfp_sm_probe_phy(struct sfp *sfp) } sfp->mod_phy = phy; + if (phy_driver_is_genphy(phy) || phy_driver_is_genphy_10g(phy)) + dev_warn(sfp->dev, "Using Generic PHY driver with a SFP!\n"); + phy_start(phy); } -- 2.17.1