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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 34F76C282CE for ; Fri, 5 Apr 2019 21:20:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E5B102173C for ; Fri, 5 Apr 2019 21:20:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qZe+YSjW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726206AbfDEVU4 (ORCPT ); Fri, 5 Apr 2019 17:20:56 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36983 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725967AbfDEVUz (ORCPT ); Fri, 5 Apr 2019 17:20:55 -0400 Received: by mail-wr1-f66.google.com with SMTP id w10so9580323wrm.4 for ; Fri, 05 Apr 2019 14:20:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=EXPnkHy1gWfK7q1D4bkzrGrCxnuv+mQGAVczOSf9e3M=; b=qZe+YSjWV6YkDITipRdGpNQlWMtsD7L/pm65BgteTmph9/Ta6YVTvO51kCfyvgj6EE 6s4K95NsSpwSAdZMAuwOCSfnfV25shNpOd7/tTIAItTuWRgdk5YE2c6gSxb6uus9Mwgt IbBtDDWdoi1LPqm6ykvHTol+mW+omrkjRYxTC+qYCT4WruxrUyfpgfOqQR17PCjjZW/N htezdSvn4fDuxsWoSoN2TSwvLhysLYJXl/rHOGn2GJyriR9//Hgi3j6h9cox9ZvigPRk jyAL7/dbn8cJxv/u+MHZ04PPUF63m2VqBHoxeS4T8us3tSanah/cGcPmos/by8L2fy1h 0Tgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=EXPnkHy1gWfK7q1D4bkzrGrCxnuv+mQGAVczOSf9e3M=; b=ooO33Ch7ncdMdmM7qClMKnC/EYZp/tRZmIFW9ccVHBx5P9OIkTE3S9p7paTSrQZs6f DpKywEMUYOBqtsUKRyApHSsNb3HJNq6B/SnfT6mNRt5Y/Bg5KQhZl+OxUK5vwfM2KBxd B4XXHJcyzJh/C1QpUasGDb+IK6wpOizA7ThWMAn8G+fthdD6mK6ggLUvdFoZ5J2yUWns CAWEa4RhFVeLTrONudqboBp6BSw4MOy9R89mzLHI4FvB78kpIlp+/zzqy6+PruWta/7U olfXB6/GN6qK5yMYrQWf+Nx2FuFqh5Z9Xewo2CxGxnpdS36EacVPB08Unctc/TbjsJZj e7AA== X-Gm-Message-State: APjAAAV7VwXC6O1JCuZM+Ox3ECWWBvohFTikTXWTsShJcWY59/7kPMYo OdX5JiOaot0t6+hWiAejrt2HCSsR X-Google-Smtp-Source: APXvYqxl1Z2XKFP8CIoecBNudIrnVW9hp63AEW1vV41ts/pbVE0NKrMcoJXe1n6DaXkynDpCwaHxmA== X-Received: by 2002:adf:ba81:: with SMTP id p1mr10422542wrg.192.1554499253703; Fri, 05 Apr 2019 14:20:53 -0700 (PDT) Received: from ?IPv6:2003:ea:8be1:dd00:c5f4:1013:b1cb:d123? (p200300EA8BE1DD00C5F41013B1CBD123.dip0.t-ipconnect.de. [2003:ea:8be1:dd00:c5f4:1013:b1cb:d123]) by smtp.googlemail.com with ESMTPSA id b134sm6662021wmd.26.2019.04.05.14.20.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Apr 2019 14:20:53 -0700 (PDT) Subject: Re: [PATCH net-next] net: phy: improve link partner capability detection From: Heiner Kallweit To: Florian Fainelli , Andrew Lunn Cc: David Miller , "netdev@vger.kernel.org" References: <20190405194821.GI23536@lunn.ch> <6a86f31f-dda8-77d9-aace-9ad1ad770a28@gmail.com> <20190405202729.GK23536@lunn.ch> <20190405204319.GM23536@lunn.ch> <7e6fc94d-5da9-b87d-a0d3-3e2ee5ff5961@gmail.com> <6cc85416-5ccd-ec90-ede5-11d9cfa298b3@gmail.com> <6a052004-e5d4-e63b-4a20-5e7a2381c726@gmail.com> Message-ID: Date: Fri, 5 Apr 2019 23:20:47 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <6a052004-e5d4-e63b-4a20-5e7a2381c726@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 05.04.2019 23:16, Heiner Kallweit wrote: > On 05.04.2019 23:11, Florian Fainelli wrote: >> On 4/5/19 1:51 PM, Heiner Kallweit wrote: >>> On 05.04.2019 22:43, Andrew Lunn wrote: >>>>> Right. BMSR_ESTATEN should not be set on a Fast PHY. Handling of this >>>>> case didn't change. >>>>> >>>>>> A Fast MAC connected to a Giga PHY. The MAC driver will of used >>>>>> phy_set_max_speed() to indicate its limits. In that case, MII_STAT1000 >>>>>> does exist and we should report what the peer is advertising. >>>>>> >>>>> That's what we're doing now with this patch. >>>> >>>> Hi Heiner >>>> >>>> What i don't get is why we need to do anything based on the MAC. All >>>> we need to do is look at BMSR_ESTATEN, and from that decided if we >>>> should look at MII_STAT1000 or not. When reporting what the peer can >>>> do, we should not care what the local MAC can do. >>>> >>> Do we have a misunderstanding? What you describe is exactly what we're >>> doing now. BMSR_ESTATEN is read by genphy_read_abilities(). >>> I just don't want to read BMSR whenever genphy_read_status() is called. >> >> You have to read the BMSR to determine the link status anyway, did you >> mean: have to check BMSR_ESTATEN whenever genphy_read_status() is called? >> > I would have to add extra logic to propagate BMSR_ESTATEN from > genphy_update_link() to genphy_read_status(). BMSR_ESTATEN has a fixed > value and therefore it's sufficient to read it initially. > In addition: BMSR_ESTATEN being set isn't a guarantee yet that the PHY supports gigabit. Still in MII_ESTATUS the gigabit bits couldn't be set. A Fast PHY could use some IP which is gigabit-prepared. I don't know if such a PHY exists, but it would be totally compliant with C22.