Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B2EFC282D9 for ; Wed, 30 Jan 2019 17:28:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF3442086C for ; Wed, 30 Jan 2019 17:28:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="fHiw4nPy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732562AbfA3R2Y (ORCPT ); Wed, 30 Jan 2019 12:28:24 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:32866 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727169AbfA3R2Y (ORCPT ); Wed, 30 Jan 2019 12:28:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: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=ZlezFp7WUGH26gj3nvaOUswrTqZ9ODT4p8NeMgMgtOU=; b=fHiw4nPys9kz+8a0Z3SyQBZ3IH PG7HqIogTUlnFY3bLx0Aiml3woYGyhugsV0d2WhG2uwaOc071jJWRLzLPmZYZFAWxgTSL6ycUsjyc Dt74wPsFs0xbX3gTEiYOb6j16PM1bGfw0mnmxAeTtFRB0naE/hfc/AqgFlqkMYtqH5bo=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1gotes-0005oQ-8T; Wed, 30 Jan 2019 18:28:18 +0100 Date: Wed, 30 Jan 2019 18:28:18 +0100 From: Andrew Lunn To: John David Anglin Cc: Russell King , Vivien Didelot , Florian Fainelli , netdev@vger.kernel.org Subject: Re: net: phylink: dsa: mv88e6xxx: flaky link detection on switch ports with internal PHYs Message-ID: <20190130172818.GJ21904@lunn.ch> References: <49eec816-9238-c893-0860-602aa8965515@bell.net> <20190122202834.GB12052@lunn.ch> <09fce2e0-9dd2-ea30-7e7d-72f04eede68b@bell.net> <20190122223649.GD3634@lunn.ch> <20190123002240.GF3634@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Jan 30, 2019 at 12:08:39PM -0500, John David Anglin wrote: > On 2019-01-22 7:22 p.m., Andrew Lunn wrote: > > >From my Espressobin > > > > cat /proc/interrupts > > ... > > 44: 0 0 mv88e6xxx-g1 3 Edge mv88e6xxx-g1-atu-prob > > 46: 0 0 mv88e6xxx-g1 5 Edge mv88e6xxx-g1-vtu-prob > > 48: 38 24 mv88e6xxx-g1 7 Edge mv88e6xxx-g2 > > 51: 0 1 mv88e6xxx-g2 1 Edge !soc!internal-regs@d0000000!mdio@32004!switch0@1!mdio:11 > > 52: 0 0 mv88e6xxx-g2 2 Edge !soc!internal-regs@d0000000!mdio@32004!switch0@1!mdio:12 > > 53: 38 23 mv88e6xxx-g2 3 Edge !soc!internal-regs@d0000000!mdio@32004!switch0@1!mdio:13 > > > > These are PHY interrupts. > If we come back to my trying to use the INTn pin on the esspressobin, I > have found that clearing and resetting the interrupt > enable bits in the global control register (offset 0x4) restarts link > detection when the device is stuck.  This suggests that the > INTn connection to MPP2_23 is low when the the GIC interrupt is enabled > on this pin.  Possibly, this is caused by the fact > that EEIntEn is set to 1 on reset.  INTn then goes low when EEPROM > loading is done.  Another possibility might be race conditions > in processing interrupts. > > Thoughts? Hi David You need active low interrupts. Without it, i think you are always going to have race conditions which will cause interrupts to get stuck/lost. I would suggest you remove the interrupt from your device tree and use the mv88e6xxx polling method. If i remember correctly, it currently polls 10 per second, so PHY link up/down is going to be 5 times faster on average than when phylib is polling the PHY. Andrew