From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_PASS 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 4B82CC43381 for ; Sun, 24 Feb 2019 16:33:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 01B5A20652 for ; Sun, 24 Feb 2019 16:33:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GI/XpOuN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728412AbfBXQdB (ORCPT ); Sun, 24 Feb 2019 11:33:01 -0500 Received: from mail-oi1-f194.google.com ([209.85.167.194]:40025 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725860AbfBXQdA (ORCPT ); Sun, 24 Feb 2019 11:33:00 -0500 Received: by mail-oi1-f194.google.com with SMTP id x187so5417799oia.7 for ; Sun, 24 Feb 2019 08:32:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:references:from:openpgp:autocrypt:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ZGvxk5mT1awxMJvlh27877W1SSRPu88DUTb7OLkEYJQ=; b=GI/XpOuNkOu0NHfd5FWWML0JjiDpxK5/WJYt6M7z6P2BFhVBD10K2DbRwT1F0gSwOM LrUhc+eUp1AN8FhVjoiz8UegWBWhe6MA18RytWlYnc7NpX4V88iVOtf8aKFDZiapRh4i mm+kYF0Cu9eW4cg9Zg5A7/OEMhDLOXY44UzA5+aWyY+dDTyj5bRYq0a0GVxG0jP0MJY0 x1xnG/KHd+IjXUxvfwiNYtk11O8ejPsUv/T6yZkmRVG8Bmhq/sfxdhorUxMO0uoaMK7P FUT1NI/shFfvpAkj5sSLb7qxF3wU3JNNezbC2ITCk6lsTArSw1bG+oWU37dHoKYvsr0n gPcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:openpgp:autocrypt:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=ZGvxk5mT1awxMJvlh27877W1SSRPu88DUTb7OLkEYJQ=; b=iqvKRG9ZlfbWVPAJIJfq7V8M86SvxmKlaGkcW8UCfQE+7tKsoXXeyyU8O5Se3zeWdl Uy3CQPrMCjNrUe7Mrls50/FYR0lKr9aZOLqlOolEzRQ+MhFtHDSxJXV0oPnmisWkXQ41 0qFTJNol6IaVgIs58mTDkw31ObX/HozEDgPBJYLKDFr0TFDvSNhJlATVXa2bb86dUr80 PMLhv5qRrFuSoDmFxq8lyUPQq69VirDFwXNc5uRzDCtdh4SKNEntuDb9NrqxW7WrEMwp LUeuafMGmi7s/wbjYNg0wBCT3py53ksywCxZS+2Rb+QQXV7ZBRjib+XeOS9FRkAUny+j jumQ== X-Gm-Message-State: AHQUAuae8r1mBAFfGwDTBjQ7I9CMBDA5+iwP/koLf6GsjdP/Uldp/mSz QFmToOA1zOHkfsRcvM5TEvht7ZTl X-Google-Smtp-Source: AHgI3IaC65bDld4/3y8xGx8Knuw1+04sxUyj/5eyVCrf5ApPP12yC1t5FKfFuocfBSfcHmn9mja9jw== X-Received: by 2002:aca:5f03:: with SMTP id t3mr8748745oib.113.1551025978930; Sun, 24 Feb 2019 08:32:58 -0800 (PST) Received: from [192.168.1.2] (ip68-228-73-187.oc.oc.cox.net. [68.228.73.187]) by smtp.googlemail.com with ESMTPSA id d11sm2969698otp.18.2019.02.24.08.32.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Feb 2019 08:32:57 -0800 (PST) To: Russell King - ARM Linux admin , Heiner Kallweit Cc: Andrew Lunn , "netdev@vger.kernel.org" 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> <20190224154900.jmjuh4uz2lvtankg@shell.armlinux.org.uk> From: Florian Fainelli Openpgp: preference=signencrypt Autocrypt: addr=f.fainelli@gmail.com; prefer-encrypt=mutual; keydata= mQGiBEjPuBIRBACW9MxSJU9fvEOCTnRNqG/13rAGsj+vJqontvoDSNxRgmafP8d3nesnqPyR xGlkaOSDuu09rxuW+69Y2f1TzjFuGpBk4ysWOR85O2Nx8AJ6fYGCoeTbovrNlGT1M9obSFGQ X3IzRnWoqlfudjTO5TKoqkbOgpYqIo5n1QbEjCCwCwCg3DOH/4ug2AUUlcIT9/l3pGvoRJ0E AICDzi3l7pmC5IWn2n1mvP5247urtHFs/uusE827DDj3K8Upn2vYiOFMBhGsxAk6YKV6IP0d ZdWX6fqkJJlu9cSDvWtO1hXeHIfQIE/xcqvlRH783KrihLcsmnBqOiS6rJDO2x1eAgC8meAX SAgsrBhcgGl2Rl5gh/jkeA5ykwbxA/9u1eEuL70Qzt5APJmqVXR+kWvrqdBVPoUNy/tQ8mYc nzJJ63ng3tHhnwHXZOu8hL4nqwlYHR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ighVdPkSF 6XFgQaosWxkV0OELLy2N485YrTr2Uq64VKyxpncLh50e2RnyAJ9qfUATKC9NgZjRvBztfqy4 a9BQwACgnzGuH1BVeT2J0Ra+ZYgkx7DaPR0= Subject: Re: No traffic with Marvell switch and latest linux-next Message-ID: <7005686d-45cb-a8af-de34-873c9e34a021@gmail.com> Date: Sun, 24 Feb 2019 08:32:56 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190224154900.jmjuh4uz2lvtankg@shell.armlinux.org.uk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Le 2/24/19 à 7:49 AM, Russell King - ARM Linux admin a écrit : > 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. I had a branch at some point that provided feature parity with what DT registration is capable of doing, including representing links between switches etc [1]. I am not entirely sure it makes to support such a configuration for platform devices, since they are not so many these days that would not use DT (except x86 maybe?). It would make sense to support ACPI-based registration for PHYLINK, if there was a standard for describing PHYs, SFP/SFFs which is not apparently the case. [1]: https://github.com/ffainelli/linux/commits/dsa-lbk-pdata2 > > 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. > The added difficulty here and the reason why Andrew went with the approach that is used by the code currently is because neither do the CPU or DSA ports are backed by a net_device. It is somewhere on my TODO to permit the use of PHYLINK without the need of a net_device to cover those specific DSA cases unless we just brute force the whole thing and allocate a net_device structure but not register that net_device? Yes in fact, why don't we do that? -- Florian