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.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_NEOMUTT 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 28BA5C43381 for ; Sun, 24 Feb 2019 15:49:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DA3A920652 for ; Sun, 24 Feb 2019 15:49:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="PQ9zzRZt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728298AbfBXPtJ (ORCPT ); Sun, 24 Feb 2019 10:49:09 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:41572 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725860AbfBXPtI (ORCPT ); Sun, 24 Feb 2019 10:49:08 -0500 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=+3w3z4PkCCRph0FdEqxqLvoVLkeAL1g0Xf1TB9aum8Q=; b=PQ9zzRZtgsO0aSbeQiMJVNjaX 6Fftzh41G9w5SOwxXmIJD0gMMXsI7YvhwJA/T3pUGEwGREdPBVWzicXVLP6urK9OnX2yjLsrApoUg eOcdrdmc2qigorLUuZIxzi1Vm4Blzd6qXo1nwHE15gDWm8hXH6ToTIl51bmP0ZGdes2vsc5dHC9M6 WVw6Y4QFURIXWJn/DaSqLAslIK9TCmMwy+iWHYTigqPgyJzt8IFGCdy3EkH0ovVkgd0rF7hLQgV/p 984aR+ZWespSLUp0ACwIxC1NGAhD+PY/CepjLa9lG2XlzRcaC4FX9/ov4yNhcgANPLmfA3CMzoKbB Z2s8FZszQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:51400) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1gxw1W-0007yZ-Np; Sun, 24 Feb 2019 15:49:02 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.89) (envelope-from ) id 1gxw1U-00044W-W0; Sun, 24 Feb 2019 15:49:01 +0000 Date: Sun, 24 Feb 2019 15:49:00 +0000 From: Russell King - ARM Linux admin To: Heiner Kallweit Cc: Andrew Lunn , Florian Fainelli , "netdev@vger.kernel.org" Subject: Re: No traffic with Marvell switch and latest linux-next Message-ID: <20190224154900.jmjuh4uz2lvtankg@shell.armlinux.org.uk> References: <33f9ef8d-df62-e154-f880-f886abf54e0a@gmail.com> <20190218182136.GE14879@lunn.ch> <188fcef7-81fe-cffc-af71-1f37725b8611@gmail.com> <20190223234235.GA26626@lunn.ch> <6dd3f82a-eea0-c9b4-8dd6-f2f313578b1f@gmail.com> <20190224150403.GF26626@lunn.ch> <20190224151555.xsopwkuicsop65rw@shell.armlinux.org.uk> <403607a0-16d8-15b6-f0aa-b8b13793d401@gmail.com> <20190224153449.gg3c3fyryztdj3vm@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sun, Feb 24, 2019 at 04:39:30PM +0100, Heiner Kallweit wrote: > On 24.02.2019 16:34, Russell King - ARM Linux admin wrote: > > On Sun, Feb 24, 2019 at 04:28:32PM +0100, Heiner Kallweit wrote: > >> On 24.02.2019 16:15, Russell King - ARM Linux admin wrote: > >>> On Sun, Feb 24, 2019 at 04:04:03PM +0100, Andrew Lunn wrote: > >>>>> I think what's not correct is that phydev->autoneg is set > >>>>> (by phy_device_create) for a fixed link. > >>>> > >>>> Fixed-link tries to emulate auto-neg: > >>>> > >>>> bmsr |= BMSR_LSTATUS | BMSR_ANEGCOMPLETE; > >>>> > >>>> Maybe it needs better emulation of auto-neg? > >>> > >>> Or maybe it needs to represent a fixed-speed PHY by clearing bit 1.3 > >>> (BMSR_ANEGCAPABLE). In any case, 0.12 (BMCR_ANENABLE) is not set, > >>> so according to 802.3-2015, we should not be setting 1.5 > >>> (BMSR_ANEGCOMPLETE). > >>> > >>> However, swphy does try to emulate autonegotiation - we do have cases > >>> where swphy is used in situations where the speed and duplex are not > >>> fixed. It returns an emulated link partner advertisement for the > >>> current speed, which would suggest that we should set BMCR_ANENABLE. > >>> > >> If we emulate auto-neg, then it's not needed to set the speed bits > >> in BMCR. Also what just comes to my mind, certain speeds like 1000BaseT > >> don't support forced mode. So we may have to go with auto-neg. > > > > Sure. > > > >> To avoid the original issue it should be sufficient to copy > >> supported -> advertising at a suited place. > > > Sorry, seems this wasn't clear enough. I don't mean to change > swphy but the user side. > > > Why bother - the software PHY emulation is an emulation to allow > > existing userspace that pre-dates the ethtool API to get some link > > parameters. If we augment the PHY emulation in non-standard ways, > > userspace will need to be updated to handle those non-standard > > ways. If userspace needs to be updated, why not just bite the > > bullet and update to ethtool APIs rather than adding more > > complication through an emulation layer? > > > It's not only userspace. Based on my limited knowledge of DSA this > code also uses e.g. genphy_read_status() with a fixed link. DSA has support for phylink, which is perfectly capable of supporting fixed links without using fixed-phy.c, although we have no way to create that without DT. Support could be added for non-DT though. That would avoid using phylib functions to read back from a fixed-link PHY. Since phylink presents to the MAC a fixed link in the same abstract manner as a real PHY, it should result in a more elegant implementation. DSA already has phylink support to support SFPs. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up