Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp409271pxb; Thu, 31 Mar 2022 08:08:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzACTfsjvaPB8VTsr+qBzFXddgfyk1XM03lmc6pmd7Pt7mQpXV0wtTRIXs7fWQzGDfm9J7i X-Received: by 2002:a05:6870:5893:b0:da:b3f:321b with SMTP id be19-20020a056870589300b000da0b3f321bmr2837097oab.203.1648739310122; Thu, 31 Mar 2022 08:08:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648739310; cv=none; d=google.com; s=arc-20160816; b=HmP3tbJaEbdIgnrm4rvQc7W15Andz78GesZd/v/pJLH5y5Cxmm2rxpRVFvOAL6/0QR dlWkrPpYmG2R2AmIuxHcqggylKQaWD7BFozCPjalsz+UZPzwyPpW4DyL0MtDwupT6M33 VxVq+r+D5Gllnt+vRLQslqpvb+l9kdvcV7NqeSeLopWm2VlGM35OmyhOptBWbRsrbV+O iKt/7D18EKPkMCjjIF5U144VlIDPhNXSDC0qofUrMAw8LToCpskf9rAmCfvBU3Nm/odm pIxeTy70IOOo7JeKB+UjK9mEp2EqAoc0KCCdDg48U15GceMdoFZJQSiLHPUGFw9+D9xS kF2A== 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=Z81mBq9n6F6GvxliPO/Y2+LeA5qWcREr5/0B8kb5LaM=; b=QHruPsZsqb8Vki/f7BeR+sA7BbXQpOj7xoyUc+ntoUlPbClEHv6kL5nN/1WDmZ8NQT Ul20Izl9b+hu0T5p6TiReCvzKF91MlBxFxcvrGaDxKi30WT8TTIZ2HHPHBD4Hhw1A6aH n4vo9PBpqY8ZGwqP4iLcG1S/ajAGV9+Vie5Y7PAeqVSZiPXudzRtO9tmUVks5zoe6h1i 89GZu4RqW54JKt5JPUsKT8haFHYJ5qAzj8DHgqfG9w6EJeR1SOC7tCyoF2a8M7Nt8SIG g8KgYZrFxQtJQnP7RQf3zU2ZVfp17sdZQfIJAPrn5M+8tF6QYmq4/21gPd0e0OHpP+65 0/Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=nLSSZPWZ; 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 n18-20020a056870559200b000deeaa422f6si15439239oao.226.2022.03.31.08.08.14; Thu, 31 Mar 2022 08:08:29 -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=nLSSZPWZ; 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 S235318AbiCaLwm (ORCPT + 99 others); Thu, 31 Mar 2022 07:52:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231276AbiCaLwl (ORCPT ); Thu, 31 Mar 2022 07:52:41 -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 F31A3204A87; Thu, 31 Mar 2022 04:50:53 -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=Z81mBq9n6F6GvxliPO/Y2+LeA5qWcREr5/0B8kb5LaM=; b=nLSSZPWZkz+/pIAbjaTTubmC5s UMD2QOgYnp424zA+TSDhHgSRqD6hpcqFaH66YXcK/JY0FLkARmWVQfELouFvHEem0r5l+ZnTnEb+U QonJkg9Xnq8GvC2hi3Xui9EshyWZrLLrB0jOWzw6oQGxHlXXpGMcbOfJ34Uv1/DwT+Jr9oxtePZUz vle1jDo4biTcHchlI8UmhJo6AIpJ9dgWzLEw2ctTOq95wiEB7eiyX/BllHuDPqY2Qbiu9QmxTMVwl axMwulNbVnIbSEp335NZf5rvTXAzi3phwoXvn0Ypb52yoAtvIBUmZMvDBmS4A1cT2vpBXE1CoSK4d 8cr5tLEA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:58052) 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 1nZtK8-0004kC-4n; Thu, 31 Mar 2022 12:50:43 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1nZtK6-0007ao-IH; Thu, 31 Mar 2022 12:50:42 +0100 Date: Thu, 31 Mar 2022 12:50:42 +0100 From: "Russell King (Oracle)" To: Andrew Lunn Cc: Michael Walle , Heiner Kallweit , Jakub Kicinski , Paolo Abeni , "David S . Miller" , Xu Liang , Alexandre Belloni , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC net-next 4/5] net: phy: introduce is_c45_over_c22 flag Message-ID: References: <20220323183419.2278676-1-michael@walle.cc> <20220323183419.2278676-5-michael@walle.cc> <8304fb3578ee38525a158af768691e75@walle.cc> <30012bd8256be3be9977bd15d1486c84@walle.cc> <0d4a2654acd2cc56f7b17981bf14474e@walle.cc> 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, T_SCC_BODY_TEXT_LINE 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 Thu, Mar 24, 2022 at 07:55:28PM +0100, Andrew Lunn wrote: > > The > > > only valid case i can think of is for a very oddball PHY which has C45 > > > register space, but cannot actually do C45 transfers, and so C45 over > > > C22 is the only option. > > > > And how would you know that the PHY has the needed registers in c22 > > space? Or do we assume that every C45 PHY has these registers? > > I think it is a reasonable assumption at the moment. We have around > 170 MDIO bus masters in Linux. All but one can do C22. I don't think that is correct. I'm aware of the Marvell XMDIO driver that is C45 only, and also xgene's non-rgmii "xfi" variant which is also C45 only. Note that the xfi variant doesn't reject C22 and makes no distinction between a C22 and C45 access (so a C22 access to phy_id = 0 reg = 0 hits C45 phy_id = 0 mmd 0 reg 0. MDIO drivers are IMHO an utter mess and are in dire need of fixing... and I'm coming to the conclusion that the bodge of passing both C22 and C45 accesses through the same read/write functions is a huge mistake, one that is crying out for fixing to prevent more prolification of this kind of mess. Yes, it's a lot of work, but I think it needs to be done. Retrofitting the MDIO drivers with checks etc sounds nice, but if we assume that patches will continue to be applied to net-next with little review, we have a losing battle - it would be better to have interfaces designed to make this kind of mistake impossible. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!