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=-1.1 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 ED129C282C2 for ; Thu, 7 Feb 2019 20:21:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B4C7521721 for ; Thu, 7 Feb 2019 20:21:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="T2H0qtH4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727385AbfBGUVd (ORCPT ); Thu, 7 Feb 2019 15:21:33 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:36980 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727124AbfBGUVd (ORCPT ); Thu, 7 Feb 2019 15:21:33 -0500 Received: by mail-wm1-f66.google.com with SMTP id g67so1231892wmd.2 for ; Thu, 07 Feb 2019 12:21:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=3jHK+Gr1T9kPPdxKU/pPQYajLKBARLOs5G300EksZoY=; b=T2H0qtH4FpEZHTMj7vTNTn/b9P6ubmqoTp7FOxvWl51sCCrB7T/Wp7uTGes8ohbqey QjF63JFk2HNmBcmQzIvKmJ5Um9+6MoxpY/whIRG39U+bB0b34Ptd4pSMnbjn+fKiD+dA vJ1x13ZUwnhcPzdh/RcmMT9+F33Tdhs7mKV5WDvsR+JzdgEN+YYwfT/ks6sh5caztmJH 90pLfma2ekKMjJ+1wLWIZLJc2VzGR9Q5a1vYnD41Zi5MGd+i9Gx8/3Rd11XpowKEfbF1 mxTTbubb7JJq+sTCIXVOKY5MfC/J+lBvm9Ijmn6mTTBLKHAsPoXh/P7QcHes1m6IREwH iH/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3jHK+Gr1T9kPPdxKU/pPQYajLKBARLOs5G300EksZoY=; b=THibtOCnjJfM0mms5CzTpSlqmEb8ZrL9fFMqDUgaQ+hd8ATpTTA/QFwCyg+kKml4BE v959c34sbDwRdwYuNCNDRaksLhVqOGnA6w22dI6PDkd9dEbZCcoBBzMHbn5biXSCfEQ0 jv6ZMFAVhSaf03gPIRLFNWyQJ2cKR5GzX7tYwUdWYyupDHiEwHH/vnPc4v16hBJQaxoq w0xX8gJw9ExOQ2ICARKkgqMDDfgF2oVjreKqKh9idfccKWTNGiC+Q8yR7n9HcKuJdmvx bVWmtED8eIndtOyaE14tmqRVlcRFdv+8Uzux/pAfVam84IHEGAIr2UpJf+iWbAlF5mU1 iiaw== X-Gm-Message-State: AHQUAuY9xKL/VkEWL/c7IvuGf7eSv8P5H7hYeXDZ4iUAZeDuHpUF750v 53PqqGDWgHS+18oeozgcVIAj7Pdk X-Google-Smtp-Source: AHgI3IYxZaBM+oL+9TYotZg0D1eaD/1r2McRwspQtqKkYBBPEoKhyYED5a8lAdlhdPvvtOkC9phHog== X-Received: by 2002:a7b:c84d:: with SMTP id c13mr8512176wml.112.1549570891337; Thu, 07 Feb 2019 12:21:31 -0800 (PST) Received: from ?IPv6:2003:ea:8bf1:e200:a906:e81:1a0f:97bd? (p200300EA8BF1E200A9060E811A0F97BD.dip0.t-ipconnect.de. [2003:ea:8bf1:e200:a906:e81:1a0f:97bd]) by smtp.googlemail.com with ESMTPSA id t63sm491194wmt.8.2019.02.07.12.21.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Feb 2019 12:21:30 -0800 (PST) Subject: Re: [PATCH net-next] net: phy: let genphy_c45_read_link manage the devices to check To: Andrew Lunn Cc: Florian Fainelli , David Miller , Russell King , "netdev@vger.kernel.org" References: <20190207195720.GP32483@lunn.ch> From: Heiner Kallweit Message-ID: <25962cfd-f759-10ab-e7a5-9816852412c1@gmail.com> Date: Thu, 7 Feb 2019 21:21:23 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <20190207195720.GP32483@lunn.ch> 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 07.02.2019 20:57, Andrew Lunn wrote: > On Thu, Feb 07, 2019 at 08:05:55PM +0100, Heiner Kallweit wrote: >> Let genphy_c45_read_link manage the devices to check, this removes >> overhead from callers. Devices VEND1 and VEND2 will never be checked, >> for now adopt the logic of the Marvell driver to also exclude PHY XS. >> >> At the moment we have very few clause 45 PHY drivers, so we are >> lacking experience whether other drivers will have to exclude further >> devices, or may need to check PHY XS. If we should figure out that >> list of devices to check needs to be configurable, I think best will >> be to add a device list member to struct phy_driver. > > Hi Heiner > > For the Aquantia PHY you probably need to exclude MDIO_MMD_C22EXT. > > There is no register 1D:1 listed in the datasheet. > Thanks, Andrew. Right, the Aquantia PHY doesn't seem to have the C22EXT MMD. Because the Aquantia PHY has no device 29 in its package the code should work. I also checked the 802.3 spec and it says that registers 29.0 to 29.4 are reserved. At another location the 802.3 spec states that read access to non-existing registers should return a zero value. Therefore current code (when reading a 0 from 29.1) may come to the false conclusion that device 29 reports link down. So it seems we have to exclude device C22EXT in general. I'll add that and submit a v2. > PHY XS is the interface towards the MAC. You cannot configure the MAC > to use the correct interface mode until the PHY has link to its peer > and the link mode has been determined. So you need the PHY to signal > link up independent of the MAC-PHY link, to kick off the configuration > of the MAC. When using phylink, the MAC can indicate it has a link to > the PHY using phylink_mac_change(). > OK, so excluding PHY XS is right. > Andrew > > Heiner