From patchwork Tue Jan 22 19:16:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John David Anglin X-Patchwork-Id: 1029485 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bell.net Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43kdd45hfGz9s4s for ; Wed, 23 Jan 2019 06:23:52 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726647AbfAVTXv (ORCPT ); Tue, 22 Jan 2019 14:23:51 -0500 Received: from belmont80srvr.owm.bell.net ([184.150.200.80]:37503 "EHLO mtlfep02.bell.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725925AbfAVTXv (ORCPT ); Tue, 22 Jan 2019 14:23:51 -0500 X-Greylist: delayed 461 seconds by postgrey-1.27 at vger.kernel.org; Tue, 22 Jan 2019 14:23:50 EST Received: from bell.net mtlfep02 184.150.200.30 by mtlfep02.bell.net with ESMTP id <20190122191608.NIYR27401.mtlfep02.bell.net@mtlspm01.bell.net> for ; Tue, 22 Jan 2019 14:16:08 -0500 Received: from [192.168.0.138] (really [64.231.92.241]) by mtlspm01.bell.net with ESMTP id <20190122191608.YEIG17436.mtlspm01.bell.net@[192.168.0.138]>; Tue, 22 Jan 2019 14:16:08 -0500 To: Russell King From: John David Anglin Openpgp: preference=signencrypt Cc: Andrew Lunn , Vivien Didelot , Florian Fainelli , netdev@vger.kernel.org Subject: net: phylink: dsa: mv88e6xxx: flaky link detection on switch ports with internal PHYs Message-ID: <49eec816-9238-c893-0860-602aa8965515@bell.net> Date: Tue, 22 Jan 2019 14:16:09 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 Content-Language: en-US X-Cloudmark-Analysis: v=2.2 cv=O6bWhF1W c=1 sm=0 tr=0 a=jJmVOGxBrKxWvcjqaG+oVg==:17 a=3JhidrIBZZsA:10 a=r77TgQKjGQsHNAKrUKIA:9 a=FBHGMhGWAAAA:8 a=QTR841BtkRpgYtYWoY8A:9 a=QEXdDO2ut3YA:10 a=iJddFlBKhyIzmVO2r1sA:9 a=l6ZAJouCkPoA:10 a=9gvnlMMaQFpL9xblJ6ne:22 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org I've been hacking on a espressobin board to try to improve ptp support, etc.  However, I have a big problem with link detection on the wan, lan0 and lan1 ports. I have a standard bridge configuration using systemd-networkd.  Currently, I'm working with linux v4.20.2. From power on, none of the wan, lan0, lan1 or br0 achieve link (LOWER_UP).  networkctl shows no carrier for these ports.  Disconnecting and reconnecting cables is not detected and makes no difference to link state.  I  added a debug printout in mv88e6352_port_link_state, but the routine is not called.  As far as I can tell, link state changes are not detected using PHY interrupts.  And yet, if the card is rebooted, link detection seems to magically work. I know that the 88E6341 port registers detect port link (also RJ45 LED) correctly. The attached patch fixes link detection at power on.  However, link state still doesn't update if a cable is disconnected or moved. I'm puzzled as to how this is supposed to work.  Thoughts? Regards, Dave Anglin diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 9b8dd0d0ee42..c1ec13b320ee 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -405,6 +405,7 @@ static void phylink_resolve(struct work_struct *w) case MLO_AN_PHY: link_state = pl->phy_state; phylink_resolve_flow(pl, &link_state); + phylink_get_mac_state(pl, &link_state); phylink_mac_config(pl, &link_state); break;