Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3512894imw; Mon, 18 Jul 2022 09:23:03 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t8pFXGOshTMx22nna/mn8Z9i37ouOO8XUTpQv4FA/1Hyd0EQQdcAbOPrYgU82UCBINceOF X-Received: by 2002:a4a:98a6:0:b0:41b:e04e:70ce with SMTP id a35-20020a4a98a6000000b0041be04e70cemr9642073ooj.25.1658161382695; Mon, 18 Jul 2022 09:23:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658161382; cv=none; d=google.com; s=arc-20160816; b=fDLCB6FVpkUeic9jGVPbpeCF7NQIy4NuFlRxwJ5YducJQzfHw7CFx73fhB+vUtAsDD 1ROGO/TQrgYZnzFahCFWpBHlkFcFleRkQDRUr7ZbTvm1hhoD6T4iVUuXP9ByOJ+SNSzT ZSHiX9dM84DWzFZZZR2TC9tGURupxCcL+zeYQSsLRdKtZtdM4B+0STck+K3bgB/Q4708 TlE0C8FZsOdpOEkqSh9aCJ2ZgTo11Amac4y74m59c1OAkCEtbdXHUE7Q3rMFyYE2SPYf +2BrU0up1TYFNjBgAMCQoA8hUb9/VqG6xA6QpNgWMo3m+NMfyCn8KCKNDM/OB2ucpYV9 BaZQ== 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=W/h2DA8cfEG16WKUgNpJElu4U35pORu6Lpisgp/aztg=; b=roKQAht2fUtS6aJONtyhGsA0IhotMvgcRARGMwF/rcaRVgwvBE7einLF4WmeL/9yRr WhbJsCiV86ZfV+TMEDdcTuOqI9RG+c/xFssYqzyAvTodkevGk5Bw4FoE9FasTFEYIDWK BIfKjLfcPs/7osBAKyvEd3gHN+wUEQi6Ao/g6wM266bWBLL/SgDDqMHQz0yRdO9T97QB CMk3mNoXTPy45uQ0K+uLWpXqIertKGL6oCYB3Nq3AhPX68/LoK5b2zfnH41F4GIibpIL NRofSIfHSNoRMiItoUcTTycWRtS+jjAK31ZvvAm3cPdfvV9e2l6b+i8T+WfqVo7zP+Xd dhtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=QLN6WX2q; 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 103-20020a9d0870000000b0061ca762f7efsi1956544oty.28.2022.07.18.09.22.49; Mon, 18 Jul 2022 09:23:02 -0700 (PDT) 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=QLN6WX2q; 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 S235414AbiGRQGg (ORCPT + 99 others); Mon, 18 Jul 2022 12:06:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234822AbiGRQGd (ORCPT ); Mon, 18 Jul 2022 12:06:33 -0400 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 17E7019C2B; Mon, 18 Jul 2022 09:06:32 -0700 (PDT) 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=W/h2DA8cfEG16WKUgNpJElu4U35pORu6Lpisgp/aztg=; b=QLN6WX2qBSYbabOQyYw4ip+w6g 7r+HEHPGop9B4DUJzTW8luJJgMAeQpgv4CYSDE8/MUr03o3lppKVSnGpqO5y7NTAEYI/cm25r4NVg 3nH3lnbQ+Ptnz/KkOoQw+y6U47QXpESbK34xTHJwOigwLN6/2WK2UATYKkd8b2w38UmmWzhu03NY0 QLq9TscLbgSVFuEh71JUputnS/98gE1EXF4Uw+eBjIvBXHVv0UvKJZfAffXfOUnQOB0ZVErrkxJC7 3ZTO32hTTUEPvKWgfhjNA7GwY2Syn6ROYIFeboIDs9p6AXvCBtb/EpbLESPC7Uo6y0dwHC54d9Q5l kH0jMfBw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:33416) 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 1oDTGN-0001nK-7M; Mon, 18 Jul 2022 17:06:27 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1oDTGL-000253-Bw; Mon, 18 Jul 2022 17:06:25 +0100 Date: Mon, 18 Jul 2022 17:06:25 +0100 From: "Russell King (Oracle)" To: Andrew Lunn Cc: Sean Anderson , "David S . Miller" , Jakub Kicinski , Madalin Bucur , netdev@vger.kernel.org, Paolo Abeni , Eric Dumazet , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Alexandru Marginean , Heiner Kallweit , Vladimir Oltean Subject: Re: [PATCH net-next v3 08/47] net: phylink: Support differing link speeds and interface speeds Message-ID: References: <20220715215954.1449214-1-sean.anderson@seco.com> <20220715215954.1449214-9-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 Sat, Jul 16, 2022 at 10:06:01PM +0200, Andrew Lunn wrote: > This seem error prone when new PHY_INTERFACE_MODES are added. I would > prefer a WARN_ON_ONCE() in the default: so we get to know about such > problems. > > I'm also wondering if we need a sanity check here. I've seen quite a > few boards a Fast Ethernet MAC, but a 1G PHY because they are > cheap. In such cases, the MAC is supposed to call phy_set_max_speed() > to indicate it can only do 100Mbs. PHY_INTERFACE_MODE_MII but a > link_speed of 1G is clearly wrong. Are there other cases where we > could have a link speed faster than what the interface mode allows? Currently, phylink will deal with that situation - the MAC will report that it only supports 10/100, and when the PHY is brought up, the supported/advertisement masks will be restricted to those speeds. > Bike shedding a bit, but would it be better to use host_side_speed and > line_side_speed? When you say link_speed, which link are your > referring to? Since we are talking about the different sides of the > PHY doing different speeds, the naming does need to be clear. Yes, we definitely need that clarification. I am rather worried that we have drivers using ->speed today in their mac_config and we're redefining what that means in this patch. Also, the value that we pass to the *_link_up() calls appears to be the phy <-> (pcs|mac) speed not the media speed. It's also ->speed and ->duplex that we report to the user in the "Link is Up" message, which will be confusing if it always says 10G despite the media link being e.g. 100M. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!