Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2301290pxb; Fri, 25 Mar 2022 15:01:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwel+MC1/b8K9oGHHEs3ESSXz4WVeRrvgyMXNoaQtTOAJZZRwCfJkBlfhyq+n1ODBYE8bp9 X-Received: by 2002:a63:d917:0:b0:372:aede:b9d2 with SMTP id r23-20020a63d917000000b00372aedeb9d2mr1238212pgg.449.1648245677216; Fri, 25 Mar 2022 15:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648245677; cv=none; d=google.com; s=arc-20160816; b=SpVy94hSteyY2YaEXYMWOurmTpSTl9CoMRkjCVUCRzbeb+KFlRE6mXcIObw7MPFfR6 ZpPHltubiAS7UbA7efoU391CVxtA0xgzqaJb0Wp9jbTWOXHoDMyjqHV2fDe07WRS6gwM 8Dwch+yutDHS+9lXMm6lUpCLb8Lqc5xcVBNxzvnkkc8HW22WUhj/HpM/Oh5mGIq0Rk47 kgd5qV6NSmlIJYekGLpvbzQGD46FeZS66CsAfWGGoTe2RiukvDmh6KAPZsgrtv3H90Iy Rjvx72R9Q/76vSgtj7dznjHk4GliMNUlJ0O+6ZwOoSZD3tMzNcgKzZcvhh/4AC5SuwDv ps2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=RBr8QAEuo8HHbbztFI4VB6EfKz9bI4G2lxNCA6d5X+s=; b=tndhhBsZ8A6mGGF0oGT+dV4XBjb/fubd4xTgRBBEtyDAxAlc43fxYG34ZKKB0QEmVH FAlneIffnm3fY3E49vbEkuR2htHF/H6MaUwfldUE11uMEocClqRm9Ttyw5SHDhzOo0nb KbmsMcEYyupicV9aRZx3y2BdjnQYhXNp3h9PW6hYhmmnJnNvn4I/ykPrcOq4gpbMhfIQ AO34xEvPxJC12SvGY8a7qxk2yZfMcE22gnNh2g7BoG36yezrOtJBVq219/NpUjX+10bT dmMiDxhdz+VaMq3teJusdo9h9wz+PDlsSa+nJ+43M3UlxM2GUq7lNGeTlJ8ZEld08M3w E6xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=jXNr0n2L; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id ls14-20020a17090b350e00b001bd14e03046si4127738pjb.30.2022.03.25.15.01.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 15:01:17 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=jXNr0n2L; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8D3C14D9DF; Fri, 25 Mar 2022 14:35:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233454AbiCYVhG (ORCPT + 99 others); Fri, 25 Mar 2022 17:37:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233435AbiCYVhE (ORCPT ); Fri, 25 Mar 2022 17:37:04 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 370EC49CA0; Fri, 25 Mar 2022 14:35:26 -0700 (PDT) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 58EB022247; Fri, 25 Mar 2022 22:35:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1648244125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=RBr8QAEuo8HHbbztFI4VB6EfKz9bI4G2lxNCA6d5X+s=; b=jXNr0n2LpUG6EMjEhNvNjTXchnP+C+AQyZkK2EkBwoJcNZlY9W1qnKsZ1KUsG62oUlApzz EGG5tWzz9uNLdUwVxwsJKoNTwWks6KG+f5ESEFh4vN9BPQwDDwuPjQcTEi0kn2RjuKUCUj vF8XU1QtvfFMo8jA7mFkxkcfg5JDR6o= From: Michael Walle To: Andrew Lunn , Heiner Kallweit , Russell King , Jakub Kicinski , Paolo Abeni Cc: "David S . Miller" , Xu Liang , Alexandre Belloni , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Walle Subject: [PATCH RFC net-next v2 0/8] net: phy: C45-over-C22 access Date: Fri, 25 Mar 2022 22:35:10 +0100 Message-Id: <20220325213518.2668832-1-michael@walle.cc> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi, This is the result of this discussion: https://lore.kernel.org/netdev/240354b0a54b37e8b5764773711b8aa3@walle.cc/ The goal here is to get the GYP215 and LAN8814 running on the Microchip LAN9668 SoC. The LAN9668 suppports one external bus and unfortunately, the LAN8814 has a bug which makes it impossible to use C45 on that bus. Fortunately, it was the intention of the GPY215 driver to be used on a C22 bus. But I think this could have never really worked, because the phy_get_c45_ids() will always do c45 accesses and thus on MDIO bus drivers which will correctly check for the MII_ADDR_C45 flag and return -EOPNOTSUPP the function call will fail and thus gpy_probe() will fail. This series tries to fix that and will lay the foundation to add a workaround for the LAN8814 bug by forcing an MDIO bus to be c22-only. At the moment, the probe_capabilities is taken into account to decide if we have to use C45-over-C22. What is still missing from this series is the handling of a device tree property to restrict the probe_capabilities to c22-only. Since net-next is closed, this is marked as RFC to get some early feedback. Changes since RFC v1: - use __phy_mmd_indirect() in mdiobus_probe_mmd_read() - add new properties has_c45 c45_over_c22 (and remove is_c45) - drop MDIOBUS_NO_CAP handling, Andrew is preparing a series to add probe_capabilities to mark all C45 capable MDIO bus drivers Michael Walle (8): net: phy: mscc-miim: reject clause 45 register accesses net: phy: mscc-miim: add probe_capabilities net: phy: add error checks in __phy_mmd_indirect() and export it net: phy: add error handling for __phy_{read,write}_mmd net: phy: support indirect c45 access in get_phy_c45_ids() net: phy: add support for C45-over-C22 transfers phy: net: introduce phy_promote_to_c45() net: phy: mxl-gpy: remove unneeded ops .../net/ethernet/hisilicon/hns/hns_ethtool.c | 4 +- drivers/net/mdio/mdio-mscc-miim.c | 7 ++ drivers/net/phy/bcm84881.c | 2 +- drivers/net/phy/marvell10g.c | 2 +- drivers/net/phy/mxl-gpy.c | 31 +------ drivers/net/phy/phy-core.c | 47 +++++++--- drivers/net/phy/phy.c | 6 +- drivers/net/phy/phy_device.c | 87 ++++++++++++++++--- drivers/net/phy/phylink.c | 8 +- include/linux/phy.h | 12 ++- 10 files changed, 136 insertions(+), 70 deletions(-) -- 2.30.2