Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4874330pxb; Tue, 5 Oct 2021 12:14:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLZZyv2UJ4q0Sy3a8PYUrJWHFe6nx+5JGwlA9lhV+yHphBtzbQqccGhGvvTbbqkIQ1YiF5 X-Received: by 2002:a17:907:6d9f:: with SMTP id sb31mr17486731ejc.109.1633461244977; Tue, 05 Oct 2021 12:14:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633461244; cv=none; d=google.com; s=arc-20160816; b=weO7Uu6yzBniao6KbzYaczAjgHecngjaYoliDZ41Frp+g9XOxFN+6IplWqzBGu1Deg bt2rVJMxmmYAIRn1gTPsemDbKtFdKD5Upp3VByT/IQjQfn7+mnOK+rLgiRxGDJLq0J15 DnCn7TLwKqRwRnKOr4vhGGfHrh57hEB2wxYDl4XfRqJs1RumuM4inboCeR0WZuaBCeXP k4WKm2VWmxL+xTPX61EjDsc+45ENNsK0jcLgxEGqol/84KmE6hHeJdPKPaITutujeur6 3SHdfa9uSprWQe0qPuClJLxvTgk3uiWZArbD6PHA+aTYBb+1WFSngXVr07GgBXt/7ztG KlSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ZySrRcpaEzMbdQfBG5rx663ZoIC8b9XdJJknPEQby6E=; b=GatpAfMAYF24fSZgUJpzeAmAt6vJAjVmp7TWnfjwO8lunC6JgXFBrhvMb5IF4jJ+z+ xrk8V0AuxfUNENY7c7fOeIn7Dj9EiAkdW8k3n+wTkEPcPOsYo20asPpKOnEsdSN70x5l 7SaMLDdaGIQ0Wc+T/2PzrQNuJWGardnA3m9TsADVWnwYHoEEd84WgHyWu4v9JyRHD6or bBK+4DIaRwtQFpFKMGzcMM3CrsxvL1R2UysyyS/YWZ2mUoCnkyuINEo5asGL8HmmQs0k UdGn2MMGUHPFocyBUDMysOQNf6Skgwv57yOnqpecEz/DwTqxDgYZblauDaPDXlWY6xbb GQ5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=xXnrgXUN; 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 q6si28540231edd.367.2021.10.05.12.13.40; Tue, 05 Oct 2021 12:14:04 -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=xXnrgXUN; 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 S235163AbhJETOL (ORCPT + 99 others); Tue, 5 Oct 2021 15:14:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229662AbhJETOK (ORCPT ); Tue, 5 Oct 2021 15:14:10 -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 09681C061749; Tue, 5 Oct 2021 12:12:19 -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=ZySrRcpaEzMbdQfBG5rx663ZoIC8b9XdJJknPEQby6E=; b=xXnrgXUNhYZDL1pqeuvnObDIJY x8+Auwk7wGQzqn4IGVKmqobsSCpf/Ws7CsKL8m03Tw2jASiOS1Dq32C5lJFo/LKjgldKGVZ/rN2JM yeYwLcK61j6R+lg9su82T+HpTFr2gvrotWOYclUqsk+A6qojfRURERWOO9H6Hy7rOMYyGr38UEMN1 RMyLWAgBxaIzih3FJc8qR589iS/G5+eUMJlr4T+LyNPU1yO4wlkoISepj6bcQHIWi1FnjH7Cbpt2m 7pdVD74GQTRy3rF8eIlK+2gejVurRTp0KdnKz26c9pVfeBdBdV217Xues118cI0ypK5oMyVPMJEat ndIeFiJA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:54964) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mXprM-0000fu-SO; Tue, 05 Oct 2021 20:12:16 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mXprL-0000FY-Qm; Tue, 05 Oct 2021 20:12:15 +0100 Date: Tue, 5 Oct 2021 20:12:15 +0100 From: "Russell King (Oracle)" To: Sean Anderson Cc: netdev@vger.kernel.org, "David S . Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org, Andrew Lunn , Heiner Kallweit Subject: Re: [RFC net-next PATCH 16/16] net: sfp: Add quirk to ignore PHYs Message-ID: References: <20211004191527.1610759-1-sean.anderson@seco.com> <20211004191527.1610759-17-sean.anderson@seco.com> <66fd0680-a56b-a211-5f3e-ac7498f1ff9b@seco.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <66fd0680-a56b-a211-5f3e-ac7498f1ff9b@seco.com> Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 05, 2021 at 12:45:28PM -0400, Sean Anderson wrote: > > > On 10/5/21 6:33 AM, Russell King (Oracle) wrote: > > On Mon, Oct 04, 2021 at 03:15:27PM -0400, Sean Anderson wrote: > > > Some modules have something at SFP_PHY_ADDR which isn't a PHY. If we try to > > > probe it, we might attach genphy anyway if addresses 2 and 3 return > > > something other than all 1s. To avoid this, add a quirk for these modules > > > so that we do not probe their PHY. > > > > > > The particular module in this case is a Finisar SFP-GB-GE-T. This module is > > > also worked around in xgbe_phy_finisar_phy_quirks() by setting the support > > > manually. However, I do not believe that it has a PHY in the first place: > > > > > > $ i2cdump -y -r 0-31 $BUS 0x56 w > > > 0,8 1,9 2,a 3,b 4,c 5,d 6,e 7,f > > > 00: ff01 ff01 ff01 c20c 010c 01c0 0f00 0120 > > > 08: fc48 000e ff78 0000 0000 0000 0000 00f0 > > > 10: 7800 00bc 0000 401c 680c 0300 0000 0000 > > > 18: ff41 0000 0a00 8890 0000 0000 0000 0000 > > > > Actually, I think that is a PHY. It's byteswapped (which is normal using > > i2cdump in this way).The real contents of the registers are: > > > > 00: 01ff 01ff 01ff 0cc2 0c01 c001 000f 2001 > > 08: 48fc 0e00 78ff 0000 0000 0000 0000 f000 > > 10: 0078 bc00 0000 1c40 0c68 0003 0000 0000 > > 18: 41ff 0000 000a 9088 0000 0000 0000 0000 > > Ah, thanks for catching this. > > > It's advertising pause + asym pause, 1000BASE-T FD, link partner is also > > advertising 1000BASE-T FD but no pause abilities. > > > > When comparing this with a Marvell 88e1111: > > > > 00: 1140 7949 0141 0cc2 05e1 0000 0004 2001 > > 08: 0000 0e00 4000 0000 0000 0000 0000 f000 > > 10: 0078 8100 0000 0040 0568 0000 0000 0000 > > 18: 4100 0000 0002 8084 0000 0000 0000 0000 > > > > It looks remarkably similar. However, The first few reads seem to be > > corrupted with 0x01ff. It may be that the module is slow to allow the > > PHY to start responding - we've had similar with Champion One SFPs. > > Do you have an an example of how to work around this? Even reading one > register at a time I still get the bogus 0x01ff. Reading bytewise, a > reasonable-looking upper byte is returned every other read, but the > lower byte is 0xff every time. I think the Champion One modules just don't respond to the I2C transactions, so we keep retrying for a while. We try every 50ms for 12 retries, which seems to be long enough for their modules. > > It looks like it's a Marvell 88e1111. The register at 0x11 is the > > Marvell status register, and 0xbc00 indicates 1000Mbit, FD, AN > > resolved, link up which agrees with what's in the various other > > registers. > > That matches some supplemental info on the manufacturer's website > (which was frustratingly not associated with the model number of > this particular module). The interesting thing is, many modules use 88e1111, which is about the only PHY that I'm aware that supports I2C access mode natively. So, it's really surprising that you're getting corrupted data, unless... There's been a history of using too strong pull-ups on the SFP I2C lines. The SFP MSA gives a minimum value of the resistors (4.7k). SFP+ lowers the minimum value and raises the maximum clock frequency. Some SFP modules are unable to drive the I2C bus low against the lower resistances resulting in corrupted data (or worse, it can corrupt the EEPROMs.) Other problems on some platforms have been with I2C level shifters locking up, but that doesn't look like what's happening here - they lockup at logic low not logic high. Even so-called "impossible to lockup" level shifters have locked up despite their manufacturer stating that it is impossible. Is it always the same addresses? What if you read from a different offset? What if you re-read after it seems to have cleared? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!