From patchwork Fri Jan 20 22:40:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 4340 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp462799wrn; Fri, 20 Jan 2023 14:41:13 -0800 (PST) X-Google-Smtp-Source: AMrXdXvubDwijvU125TjyINHV3IzSM3/FRhU1PCoqu+OoGja9lq8XRkjugAkwmYYS3d/qsfjQsZi X-Received: by 2002:a05:6402:12d8:b0:49e:eaac:e783 with SMTP id k24-20020a05640212d800b0049eeaace783mr2975663edx.3.1674254473162; Fri, 20 Jan 2023 14:41:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674254473; cv=none; d=google.com; s=arc-20160816; b=VnBMw3onBWeCqzExTj0WMc7yi0tOowwcxTd3JK42Ilyu3w4mz2Ze+B1ahDAD4Q5j1g 7aBWANY44n7PVuJeSpy9bj1Pk9YTYQF4Q6b8dRHzT9C8jkcNmcp5IGwUtlBhDVONxJOo S0zS1wV4Aa8F4xKETM7Q/gGryeQtNsggI1wtw0wpnpCT0IUgQR/QO51j09n5VY1SOi7s rVWVcWUlKr36rlZ2gUaDr0r181dmTdDsESo4iQg2sqF8DdsBIr8CRO4dfGvUzJsxYI1B pA2MLcNNrEOmpN+/DIqy4ZJMdkP9FD3bCWTthrk9rl2zESD68WRozp1E8vRzcG+4Ludg QE2Q== 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=L5ySbynlRd03+mC00y1MsXYQTBq0njvvGbWSbHrwuRo=; b=qqOpl1rL7JJXnCbqJ90AXp67nIQZzhQwk5obrLlNFrr9Dt+aZvZ0+McdjpEYQ5X8jI D58cXDpbDZ7zR0Vv2rr9XV2kYbEPnRQ7KhSGbEb3Jx9gPhl6X9v0lZeDdc1N1LCmf/DV zTxp+yKpoVFjeLsaFTZE0lSTlfATU17hmSKS2zm/pgW0hS3sxeff1SL5jz5Jyjy9WJSE wVXEWAabBlEbNscGXrc6j1bugwajlPpbCVYwJMRsY9v7e8RnS6vEI0ZfDNDBwMYFLFf7 T/WBktMFSEzvOrA1c34qN+1MQOqVfE3uGY36j+VlbxINi1bK11b+urEb8fyCNXqIwEI/ NjyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=VVJo3ZVl; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b17-20020a056402279100b0049e369ed236si14751061ede.260.2023.01.20.14.40.49; Fri, 20 Jan 2023 14:41:13 -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=pass header.i=@walle.cc header.s=mail2022082101 header.b=VVJo3ZVl; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229678AbjATWkZ (ORCPT + 99 others); Fri, 20 Jan 2023 17:40:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbjATWkX (ORCPT ); Fri, 20 Jan 2023 17:40:23 -0500 Received: from mail.3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCD1D7F997; Fri, 20 Jan 2023 14:40:21 -0800 (PST) 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 X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id A704911FB; Fri, 20 Jan 2023 23:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1674254419; 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=L5ySbynlRd03+mC00y1MsXYQTBq0njvvGbWSbHrwuRo=; b=VVJo3ZVlk6cFNWqbF7TwzaJ47eFqfK7oyM7NJ6UvXE3gsmhXs7dvsvW7iX0qBVZcU/DzVi Cx6iyZiRT2oLujXfX3qd4AFkRXsmNN9AU5m7Nw9NLoU9AHenfQB4AeTGXp4SQGtnpuw8wq 8Ngc2uZAyGegjvD8IjeU+mlB3AhAz8XTZpmFkQV2fQXzLwnwpaFPkw2TNisIqDC4Y7IdIg uQh6iX+nFEOLYPanu1jeTO14SpIGtevHgGlPHj5hfejIrBoncAtUyR5NCqFB5N2O6sklHw MjBcPRR3ulFH8Yeoh+eP2hbOUSPGuC7Ntg3NN3zwsW8n3HxxKgv7yXrbzmJlbA== From: Michael Walle To: Yisen Zhuang , Salil Mehta , "David S . Miller" , Jakub Kicinski , Paolo Abeni , Florian Fainelli , Broadcom internal kernel review list , Andrew Lunn , Heiner Kallweit , Russell King , =?utf-8?q?Marek_Beh=C3=BAn?= , Xu Liang Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Walle Subject: [PATCH net-next 0/5] net: phy: C45-over-C22 access Date: Fri, 20 Jan 2023 23:40:06 +0100 Message-Id: <20230120224011.796097-1-michael@walle.cc> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam: Yes 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_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755583058420905286?= X-GMAIL-MSGID: =?utf-8?q?1755583058420905286?= After the c22 and c45 access split is finally merged. This can now be posted again. The old version can be found here: https://lore.kernel.org/netdev/20220325213518.2668832-1-michael@walle.cc/ Although all the discussion was here: https://lore.kernel.org/netdev/20220323183419.2278676-1-michael@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 gpy_probe() will fail. Introduce C45-over-C22 support and use it if the MDIO bus doesn't support C45. Also enable it when a PHY is promoted from C22 to C45. Changes since RFC v2: - Reased to latest net-next - new check_rc argument in mmd_phy_indirect() to retain old behavior - determine bus capabilities by bus->read and bus->read_c45 - always set phydev->c45_over_c22 if PHY is promoted 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 (5): net: phy: add error checks in mmd_phy_indirect() and export it 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/phy/bcm84881.c | 2 +- drivers/net/phy/marvell10g.c | 2 +- drivers/net/phy/mxl-gpy.c | 33 +------- drivers/net/phy/phy-core.c | 48 ++++++++--- drivers/net/phy/phy.c | 6 +- drivers/net/phy/phy_device.c | 80 ++++++++++++++++--- drivers/net/phy/phylink.c | 8 +- include/linux/phy.h | 12 ++- 9 files changed, 128 insertions(+), 67 deletions(-)