From patchwork Fri May 4 13:56:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antoine Tenart X-Patchwork-Id: 10380705 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 902BD6037D for ; Fri, 4 May 2018 14:16:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 707C72948E for ; Fri, 4 May 2018 14:16:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6424829490; Fri, 4 May 2018 14:16:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1131C2948E for ; Fri, 4 May 2018 14:16:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=VqTC1dX//rzARW4l1KBkuVZ+jKERSMiV86B8Z2bzzgY=; b=jtpyV3HkFx8f3pChNfBhhYj19S tLJZ32UxohwzSZ7DYtURdRNt544falfluBDiKojhgpOHQH3vytRIBOMfbAJh3nH5PT8qp80B4i3Qy DD19ixxzupIytsFPyrY5dsDNYSeGGV39BBtK1BiETK/i32iVbxfEbNFt/qGS9/gZW/NbOw4gtsXom ++vsPsJmsWiewIkm1+bkAMQt++K4+Y6IPI2b0a7ldTucGkRLxYmp27PePk6aXqE2D2jdGrXdMOIDe 3D0w80yq7Kks11TfefOGIS6c72fZgkTNj08RPkwKmgWO3NU/YVW7//FGBltuBc9HBAXjY7Dz02cTw vhQNZ6eA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fEbVE-0005yt-8v; Fri, 04 May 2018 14:16:04 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fEbPk-0000bU-TZ for linux-arm-kernel@bombadil.infradead.org; Fri, 04 May 2018 14:10:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zD6PRoyaPlWiMEUFBTQLsOkOtFAy0zbxGVVqKoaeHro=; b=dZjgA+X3xfrEciTXoGxjCVxHf SBMtOaxXE1cYYZ+veFfb1ChaTyyeUxvHWQyi1PAcnP3yecXR7d61G0XUUZBebOVBRFVv8/2Kx5azV 64gLUrdITvhvuS/XVXfMn2TWZekCawgrr8S1wCMMKBsQ617wisT7Tlw4u8Z3QN8mTwzi0pBatDpxP TpFEay2V/wMKip3tsGB5g4+mbxv36DrsXfGU/fNUr2UAnJmTs/n66c6nDLV/3AqI3+O6cXg4B9chH 8kvLxdD9rCNXytLyUzcyR7mPBoueaj43exIB2qokPuOcI+MLGgocph5c8jvXeo7S+Mfd5r4e2+KOe C05+MvKiw==; Received: from mail.bootlin.com ([62.4.15.54]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fEbG8-00058a-Lo for linux-arm-kernel@lists.infradead.org; Fri, 04 May 2018 14:00:32 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id 0758820A33; Fri, 4 May 2018 16:00:12 +0200 (CEST) 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180504_150028_723724_74BF04D2 X-CRM114-Status: GOOD ( 14.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ymarkman@marvell.com, Antoine Tenart , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, maxime.chevallier@bootlin.com, nadavh@marvell.com, thomas.petazzoni@bootlin.com, miquel.raynal@bootlin.com, stefanc@marvell.com, mw@semihalf.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Russell King --- 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; }