Received: by 10.192.165.148 with SMTP id m20csp79811imm; Fri, 4 May 2018 07:01:47 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoN8j+K984J4NXeTzZcwav2R5kHlrQ5sKWw28rkv8zHPcEDQbHi3lz3fNplZSgxUJnUkIG8 X-Received: by 2002:a65:628a:: with SMTP id f10-v6mr22525924pgv.6.1525442506928; Fri, 04 May 2018 07:01:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525442506; cv=none; d=google.com; s=arc-20160816; b=AKL8fOKwIiSnFrYgZFwpLQZip5XU3CokXSyrjjl8BQL5zkWVzMqnW+N/g294fmiWzZ xNm4ZgFwb55Q2d1vZkMOyaEajMXEH6qVh4qohZfPqjXLI74B1JAj9lsuDbMhyugJFXwK 09B9OSLy51mIMCHWdI86gredSb+8cFDpp44CaLAZ1m7HTi/OUnWknUUQu3hjh6SU2q/4 ZZYqlPfRoS+Oyip2pODYryVIUGf213+daBR/sYNHpFTcZBIje5xWa+paI575FHysLD7I 3eLPtB5TgAeLAb2MvGFTkP7Sk96Hof3rjYKK7ipQgTN9G1062AclVR88YGps8zSkmZMw lGfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=zD6PRoyaPlWiMEUFBTQLsOkOtFAy0zbxGVVqKoaeHro=; b=0U5Ojwsx2++jdfJgH90udVLTG3OyyPKSQfC6ceKPuPG0OeAPEHy00JLeVw0OYLqMxm VSBWwuOFwgZX7TtHUnXAVcpc8lHRUpk3CIO4nbIHZW0GniKbCTUkA7qkGx1aUFPDlGz1 QzGeM53lCoDg7ML/MRqdLdTm31pjCX5pqjygpnUdlfV3eloWT0dLjA6ObkjASfhQzff5 8eu7SYdvuqSKsr7ufApTJp9SPwwRciS7M2fKs0epKPiNrcZw6VKcuTne5LBa1KAj7pA2 cZG600jj7Ss5Ck5Rpv4A+8LjoJ7YjnCRIMwKlGrPv9O3q1GQS/eh8O0BhHAXiD3NC6D2 IA3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v31-v6si16386154plg.157.2018.05.04.07.01.31; Fri, 04 May 2018 07:01:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751989AbeEDOAT (ORCPT + 99 others); Fri, 4 May 2018 10:00:19 -0400 Received: from mail.bootlin.com ([62.4.15.54]:60405 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751651AbeEDOAO (ORCPT ); Fri, 4 May 2018 10:00:14 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 0758820A33; Fri, 4 May 2018 16:00:12 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id C896D207DA; Fri, 4 May 2018 16:00:01 +0200 (CEST) From: Antoine Tenart To: davem@davemloft.net, kishon@ti.com, linux@armlinux.org.uk, gregory.clement@bootlin.com, andrew@lunn.ch, jason@lakedaemon.net, sebastian.hesselbarth@gmail.com Cc: Antoine Tenart , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, maxime.chevallier@bootlin.com, miquel.raynal@bootlin.com, nadavh@marvell.com, stefanc@marvell.com, ymarkman@marvell.com, mw@semihalf.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next v2 03/13] net: phy: sfp: warn the user when no tx_disable pin is available Date: Fri, 4 May 2018 15:56:33 +0200 Message-Id: <20180504135643.23466-4-antoine.tenart@bootlin.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180504135643.23466-1-antoine.tenart@bootlin.com> References: <20180504135643.23466-1-antoine.tenart@bootlin.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/net/phy/sfp.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index 8e323a4b70da..d4f503b2e3e2 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -1093,6 +1093,15 @@ static int sfp_probe(struct platform_device *pdev) if (!sfp->gpio[GPIO_MODDEF0] && !sfp->gpio[GPIO_LOS]) sfp->sm_dev_state = SFP_DEV_UNKNOWN; + /* 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; } -- 2.17.0