Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4094435imm; Mon, 14 May 2018 02:28:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZquytmsood/NYFVmmgYExLAvOtVm2OjBiWHypPenVc7j9ZQGX+2RQqraPrIEWUwgA32YEDa X-Received: by 2002:a62:99d7:: with SMTP id t84-v6mr9702410pfk.252.1526290082578; Mon, 14 May 2018 02:28:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526290082; cv=none; d=google.com; s=arc-20160816; b=rpEBq96LAhiFapuDpFZAKaBaFeWm3m6uIjn9ia3F9onkniOu/G9gzDOj0UinBKUYbV dt21e8Cfze+i97FF7e37ZRXVU6cjxopokF6T7kFVez/QdJmcVubrBPWW1CSUMrilz96f MNakhX1B8ZM+v6kS3ntKCz7ROMGWfkoFy87RZSTCz8xCvvThe5KpACFpSRVf4jhk0s7Z zcsS0z3ImP0L+0SprbcQpGuU5B/0wOnQaBggKDM2UzCHEphuYtlfnzdSKfkRO3rTVLy+ +8pXnMmH5naxRxe4agUjV1Fv9J6Mz+oRuNqLCb4kmshispxUJ7PAJCgN9Co14j+3lV6s jDFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=ud7leelscLHQcx3ePc5qN7AKbyjFTNG8y9MAUhh4q34=; b=I6CZZzYVsPHJ6Ix0IwzMNBuFGH9IEvad60JQ00LQkeBNAYJqcuVNSVkNa47VSOaW/f w+75Xoqog8x+LPPlEA1O4efH4LwVDyKcT6CiSeUm+b3vKYpJ3DJqCswJZkDW7Dslcm8z WtElRjNIvN83db8W5WVyhVT+I/Y6hoUs1nHcxzalWUF85FU2JsIWuquah2GO2hus1+XA lNqcqYcNWK9TOz7lSYSZ391s3mb2tgUIpXDWe+G30oKk9q7+JQbCqJ0+aa0QwimMP8J9 Z3qlM6c953H00ltbzCDuSyVnEkwQs6jZag8eShIOJJvFCyneINjkSiMTauaG+1jJwqTu 3iPQ== 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 n3-v6si3224687pgc.56.2018.05.14.02.27.48; Mon, 14 May 2018 02:28:02 -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 S1752475AbeENJ0N (ORCPT + 99 others); Mon, 14 May 2018 05:26:13 -0400 Received: from mail.bootlin.com ([62.4.15.54]:37361 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752430AbeENJ0L (ORCPT ); Mon, 14 May 2018 05:26:11 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 7B233208B1; Mon, 14 May 2018 11:26:09 +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 4E9742073D; Mon, 14 May 2018 11:25:59 +0200 (CEST) Date: Mon, 14 May 2018 11:26:00 +0200 From: Antoine Tenart To: Russell King - ARM Linux Cc: Antoine Tenart , davem@davemloft.net, kishon@ti.com, gregory.clement@bootlin.com, andrew@lunn.ch, jason@lakedaemon.net, sebastian.hesselbarth@gmail.com, 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: Re: [PATCH net-next v2 02/13] net: phy: sfp: handle non-wired SFP connectors Message-ID: <20180514092600.GA20663@kwain> References: <20180504135643.23466-1-antoine.tenart@bootlin.com> <20180504135643.23466-3-antoine.tenart@bootlin.com> <20180508115247.GF16141@n2100.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180508115247.GF16141@n2100.armlinux.org.uk> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Russell, On Tue, May 08, 2018 at 12:52:47PM +0100, Russell King - ARM Linux wrote: > On Fri, May 04, 2018 at 03:56:32PM +0200, Antoine Tenart wrote: > > SFP connectors can be solder on a board without having any of their pins > > (LOS, i2c...) wired. In such cases the SFP link state cannot be guessed, > > and the overall link status reporting is left to other layers. > > > > In order to achieve this, a new SFP_DEV status is added, named UNKNOWN. > > This mode is set when it is not possible for the SFP code to get the > > link status and as a result the link status is reported to be always UP > > from the SFP point of view. > > This looks weird to me. SFP_DEV_* states track the netdevice up/down > state and have little to do with whether LOS or MODDEF0 are implemented. That's right. > I think it would be better to have a new SFP_MOD_* and to force > sm_mod_state to that in this circumstance. The idea was to avoid depending on the state machine, as this could be difficult to maintain in the future (it's hard to tell exactly what are all the possible paths). But I get your point about SFP_DEV_. I can have a look at adding a new SFP_MOD_, or I could add a broken flag into 'struct sfp', although having a SFP_MOD_ would be proper. Before doing so, we should decide whether or not this approach is valid, as there were comments from Florian and Andrew asking for a fixed-link solution. I think fixed-link wouldn't be perfect from the user point of view, but I understand the point. If we go with fixed-link, then this patch can be dropped (the two others net: sfp: patches could be kept). What do you think? Thanks, Antoine -- Antoine T?nart, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com