Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2659353pxb; Tue, 13 Apr 2021 07:14:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzccWuMZ5/ikUwsLOkEGejkvRvWeVQDQ7QIo9NM8gDPkfO6PAiynkZWj5ElXNZvuUUj7Swb X-Received: by 2002:a17:906:c218:: with SMTP id d24mr5950944ejz.363.1618323295947; Tue, 13 Apr 2021 07:14:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618323295; cv=none; d=google.com; s=arc-20160816; b=HtutCIMS90u0UdfO5CRsYD8QuP+/5/jkEZh/mpbu1PNSUuU268GF26N+q/uAW6aiRl uJ39yQYIE5sbCWSMkwzic8xoSfoIt5R7XmSEj6X2/tJkxd5aIX0wxgUlG3fTLPsHk5cN iesYmqKQK9+Z+nJg6wV17D9zgvI0uqDHFeqLy73do9ZNE2KU/ASNMMg6rIzkAtRGw3nV XnYtiLtBRec826VEnzOt1BzBxe2VPXdwHyvUjCNnesCffEMYmlSSS8bnOPMZjFcJ4+Yp Thzl3JwZ7D1bvyydqm1UhCxjEnT1WA6GaplYRyjD4Q3KilifD5cGNRSe2OJljQWjrcXH wpzw== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=R9GQ7/qe2L3QkVEv8Za/HbNqMJ4ZTy0S5naUqEnTVwM=; b=EOzVw5fK9yttugsT0RIr04IdFcyG2zzsy3VIwMTI91h9xSjar4Tqh3OJUx2SBjuio7 0fscsuv9bcOFv1UtU3ZYggY6XAku8s16ffIAB66T4r6zENtl1unX2e5aLUq9USq7DlqM gEqv9rstEdd79Iu/Opbb7fIz4b4UeHdsRJI2gZjhhYztkZy2eYP9l0NK0YeevHszOKNv fYKyB+i9coAtmsW84QbcvdazZgaBt/DQAnN4UVUsrq1SmQFCNCVk3nEr+dK801fFjq1H bxTTDOR856iQLa4IGVSRSAaNtBb6SBBRAqIJ+Vej7zgLOPaJWTY0fLQKn+a8X8KMxxGc PCvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b="WAckju/L"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q23si1015581ejy.319.2021.04.13.07.14.28; Tue, 13 Apr 2021 07:14:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b="WAckju/L"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232408AbhDMJYY (ORCPT + 99 others); Tue, 13 Apr 2021 05:24:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343489AbhDMJYT (ORCPT ); Tue, 13 Apr 2021 05:24:19 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3BE1C061574; Tue, 13 Apr 2021 02:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: 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=R9GQ7/qe2L3QkVEv8Za/HbNqMJ4ZTy0S5naUqEnTVwM=; b=WAckju/LOTKXAc/kphJjfY7DD sT68bHNciI2f1uCn3fZSzA36ODiMWgs5I4VrTQ3w3GA2wUrHGKy1d/U+6ZvYI0Kn0uHrlsJbgM+9p IFh6+ltCtepzF699CmZZfzzVBmezbYWhd4/MnWWRyPfoGZ3HDfWuSdoMXgj3VPIhdsZBUKV0NRp3j JWiyDycmutW4o5RmOs+Npj73u/urCrsxF1OZZ61NwFu5EPzl2uKCyJ3TVGERcMPEkZuyA4yLUeWgA sHU8bfiAWy1moA/1ug+ZIeTVCeP8EgR8wyvjrKSN35fzei+r+FmjBltVSKIcNt1tT+vTly7j0NNsc JYaYYAVag==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:52370) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lWFGw-0005SJ-1a; Tue, 13 Apr 2021 10:23:50 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1lWFGu-00085G-VI; Tue, 13 Apr 2021 10:23:48 +0100 Date: Tue, 13 Apr 2021 10:23:48 +0100 From: Russell King - ARM Linux admin To: Ivan Bornyakov Cc: Andrew Lunn , system@metrotek.ru, hkallweit1@gmail.com, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 1/2] net: phy: marvell-88x2222: check that link is operational Message-ID: <20210413092348.GM1463@shell.armlinux.org.uk> References: <614b534f1661ecf1fff419e2f36eddfb0e6f066d.1618227910.git.i.bornyakov@metrotek.ru> <20210413071930.52vfjkewkufl7hrb@dhcp-179.ddg> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210413071930.52vfjkewkufl7hrb@dhcp-179.ddg> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: Russell King - ARM Linux admin Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 13, 2021 at 10:19:30AM +0300, Ivan Bornyakov wrote: > On Tue, Apr 13, 2021 at 01:40:32AM +0200, Andrew Lunn wrote: > > On Mon, Apr 12, 2021 at 03:16:59PM +0300, Ivan Bornyakov wrote: > > > Some SFP modules uses RX_LOS for link indication. In such cases link > > > will be always up, even without cable connected. RX_LOS changes will > > > trigger link_up()/link_down() upstream operations. Thus, check that SFP > > > link is operational before actual read link status. > > > > Sorry, but this is not making much sense to me. > > > > LOS just indicates some sort of light is coming into the device. You > > have no idea what sort of light. The transceiver might be able to > > decode that light and get sync, it might not. It is important that > > mv2222_read_status() returns the line side status. Has it been able to > > achieve sync? That should be independent of LOS. Or are you saying the > > transceiver is reporting sync, despite no light coming in? > > > > Andrew > > Yes, with some SFP modules transceiver is reporting sync despite no > light coming in. So, the idea is to check that link is somewhat > operational before determing line-side status. Indeed - it should be a logical and operation - there is light present _and_ the PHY recognises the signal. This is what the commit achieves, although (iirc) doesn't cater for the case where there is no SFP cage attached. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!