Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp81386rwb; Mon, 28 Nov 2022 17:20:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf74Shm0CpjlBwz9icwk9n0y6JgYd/BE00OSNEyjBQkr5dBSB0mjSLVfYv96C132RSHNB2sY X-Received: by 2002:a63:230d:0:b0:476:aad3:9122 with SMTP id j13-20020a63230d000000b00476aad39122mr30165683pgj.402.1669684823924; Mon, 28 Nov 2022 17:20:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669684823; cv=none; d=google.com; s=arc-20160816; b=aE7KZF+Ob5aVSztp/SOz9+xa1b6qVZwJfyaHDX5USUUeeAUNiUpxDzJOgCJ9soDVff TVkhAMrRZoOrZgoFq7owaJTah8FdXLYLBAsDL2bmErS6CDX5C9wI/aN8vGbL93MK/DtW m+Cf6NXumP1+e69fXxkYvM8Tm+OrhcS72JCeCbzm8PcvuqZJK0KQmvkV/lG88wAMrN3j QQ618IJUOEZQDZMc+KNWAtpV1beWdhll1+X3M9YV4F6TbyRK6A4enFwrmsZIF08TvQ+G ZFlgt1T25Aay/+CAlrUj0Y5/3RZ4NlWBWxi2RI/1jF4hwQNFatCXqLw7Bv0wVnDUL+DM Y3HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=wbeLW34bc4cmMK+53LmuwvcRYDANepCHmKUoPCQ9gFM=; b=D38fQJ5HSMwd8oLGW87Ppea5ZcIajFcB/6kgVfAbA3Lz2RKbxKjV7MQ+IQuwYon3cX Y5CgsLOwYMoWx60jfZ88bumvYWu+iI0SPBkv9V8+KjxDTxlDUBtEH7rwzEui4IPeiq+F uahIOMv7zX4hIiYF2IZZQgAjZifAYOilvi0c2re0/U3YBfoHEnEFPrhNkX5fkYLFTHzE IDNzLVcQPxn061qn8IkmYly2bkxc4AfVrBHmt6kOe8CKYa2p4ASkRX2G8lnOhixfDwnS A6uwKmuXx9M+Sd18YNL0EX+5KUXA37TyDAAB6BYn/ClmuJaN1Sb0AqsHn6LaoiikrN0w scGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=EB8u3pcD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w9-20020a056a0014c900b00561f40cc9f3si14197805pfu.262.2022.11.28.17.20.13; Mon, 28 Nov 2022 17:20:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=EB8u3pcD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234816AbiK2Am7 (ORCPT + 83 others); Mon, 28 Nov 2022 19:42:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234129AbiK2Am5 (ORCPT ); Mon, 28 Nov 2022 19:42:57 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 141ACDFC7; Mon, 28 Nov 2022 16:42:55 -0800 (PST) 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=wbeLW34bc4cmMK+53LmuwvcRYDANepCHmKUoPCQ9gFM=; b=EB8u3pcD1VxhbU43/eb0ZkDYNu Vb5XBN+d8icIiOfdDV4d/tDentIerCE+IYddBREAKK2nMQx3FyOq8Kez1DywnIDUhkA/VvCryTsc9 ACAmIYHXdotnNxqObcNNwMbIBJQv62edD+tgeMaoqHAdWXAhkv+uA3mxrptE6oWtGbAIqTtSvYSCt bAu5W7n1V2BJbpVDx3je214Tpa+6x7NzwQBMcS5JyeF21RGp5DPdxnGMWRy69/zHTsKLA3aeZSv5A rgcd1WEF5hKw07tnyvYyOAjfb77VwOocMeBdAp6BPRpjsfdbV1T+zwEFsf7f58rdHXpa4u+xs8R96 BEgH4ZQw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35466) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ozoi3-0000DC-4K; Tue, 29 Nov 2022 00:42:51 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1ozohz-00011y-6r; Tue, 29 Nov 2022 00:42:47 +0000 Date: Tue, 29 Nov 2022 00:42:47 +0000 From: "Russell King (Oracle)" To: Sean Anderson Cc: Andrew Lunn , Heiner Kallweit , netdev@vger.kernel.org, Vladimir Oltean , Eric Dumazet , Paolo Abeni , linux-kernel@vger.kernel.org, Jakub Kicinski , Tim Harvey , "David S . Miller" Subject: Re: [PATCH net v2 2/2] phy: aquantia: Determine rate adaptation support from registers Message-ID: References: <20221128195409.100873-1-sean.anderson@seco.com> <20221128195409.100873-2-sean.anderson@seco.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 28, 2022 at 07:21:56PM -0500, Sean Anderson wrote: > On 11/28/22 18:22, Russell King (Oracle) wrote: > > This doesn't make any sense. priv->supported_speeds is the set of speeds > > read from the PMAPMD. The only bits that are valid for this are the > > MDIO_PMA_SPEED_* definitions, but teh above switch makes use of the > > MDIO_PCS_SPEED_* definitions. To see why this is wrong, look at these > > two definitions: > > > > #define MDIO_PMA_SPEED_10 0x0040 /* 10M capable */ > > #define MDIO_PCS_SPEED_2_5G 0x0040 /* 2.5G capable */ > > > > Note that they are the same value, yet above, you're testing for bit 6 > > being clear effectively for both 10M and 2.5G speeds. I suspect this > > is *not* what you want. > > > > MDIO_PMA_SPEED_* are only valid for the PMAPMD MMD (MMD 1). > > MDIO_PCS_SPEED_* are only valid for the PCS MMD (MMD 3). > > Ugh. I almost noticed this from the register naming... > > Part of the problem is that all the defines are right next to each other > with no indication of what you just described. That's because they all refer to the speed register which is at the same address, but for some reason the 802.3 committees decided to make the register bits mean different things depending on the MMD. That's why the definition states the MMD name in it. This is true of all definitions in mdio.h - the naming convention is of the format "MDIO_mmd_register_bit" where the bit is specific to a MMD, or "MDIO_register_bit" where it is non-specific (e.g. the status register 1 link status bit.) > Anyway, what I want are the PCS/PMA speeds from the 2018 revision, which > this phy seems to follow. I think we should add further entries for the PMA/PMD speed register. For example, 2.5G is bit 13 and 5G is bit 14. (vs bits 6 and 7 for the PCS MMD version of the speed register.) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!