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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0CFB8C433EF for ; Mon, 18 Jul 2022 16:07:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iOW/gAA8eiqbkOyYtkVUHnCGDVeYowH5rxUcpmBRDVs=; b=ij3f3xB42mCkxu fEGBNj8gWgifEwy8R8LgN80tWTdQZKUFdQGffbPv5Ai3hh4w3cgg1YSGOVwgPXUJNZ/WjKDyFq2XD V9lsjAyu2x6cYgxllEDkL3ZbzTUFqydS1engwKJnshjoHiZALKBt9ar6ajChwiEiCEzHXW8sTzkvY XF26F8HzNga2GiBzld6VAqokITN3lH9a0bWz2ArMGifC/4GVs/bp/DaRKWjJ5TRy8LLHtbrWE4cST xZZhCeRapHLicQ5q8GJv8aOGwCMsQvOWx+RvkbmRyz5cuIeoo2v9mHMS2o02akxEiOSMzJpu/RlH/ mdeZLVYW9r8kp1xfvxQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDTGa-00GW3X-1d; Mon, 18 Jul 2022 16:06:40 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDTGV-00GVze-No for linux-arm-kernel@lists.infradead.org; Mon, 18 Jul 2022 16:06:37 +0000 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_090635_819061_D29C760A X-CRM114-Status: GOOD ( 19.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel