summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorAntoine Tenart <antoine.tenart@bootlin.com>2018-05-22 12:17:59 +0200
committerDavid S. Miller <davem@davemloft.net>2018-05-23 20:34:27 +0200
commita1f5d1f0dfccea54e1d9c2da16fd8c9b54f81a75 (patch)
tree45131e0a7be8cd5b9fefd8b9c42e77eb4574b0e8 /drivers/net/phy
parentMerge branch 'nfp-abm-add-basic-support-for-advanced-buffering-NIC' (diff)
downloadlinux-a1f5d1f0dfccea54e1d9c2da16fd8c9b54f81a75.tar.xz
linux-a1f5d1f0dfccea54e1d9c2da16fd8c9b54f81a75.zip
net: phy: sfp: warn the user when no tx_disable pin is available
In case no Tx disable pin is available the SFP modules will always be emitting. This could be an issue when using modules using laser as their light source as we would have no way to disable it when the fiber is removed. This patch adds a warning when registering an SFP cage which do not have its tx_disable pin wired or available. Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> Acked-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/sfp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 4ab6e9a50bbe..a91d12209a81 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -1065,6 +1065,15 @@ static int sfp_probe(struct platform_device *pdev)
if (poll)
mod_delayed_work(system_wq, &sfp->poll, poll_jiffies);
+ /* We could have an issue in cases no Tx disable pin is available or
+ * wired as modules using a laser as their light source will continue to
+ * be active when the fiber is removed. This could be a safety issue and
+ * we should at least warn the user about that.
+ */
+ if (!sfp->gpio[GPIO_TX_DISABLE])
+ dev_warn(sfp->dev,
+ "No tx_disable pin: SFP modules will always be emitting.\n");
+
return 0;
}