From patchwork Wed Jan 18 10:01:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 45165 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2267341wrn; Wed, 18 Jan 2023 02:56:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXu6fc6oIQHMQdqHCKx0hady6wGJf3/XYi02lHKVsw/SSyVRCsPASs6f76WS+1TEQRQoVf+J X-Received: by 2002:a17:902:8304:b0:194:9de0:bed1 with SMTP id bd4-20020a170902830400b001949de0bed1mr5812538plb.32.1674039403272; Wed, 18 Jan 2023 02:56:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674039403; cv=none; d=google.com; s=arc-20160816; b=ey6A+66mJh0OidvR7P6HZ2TARFeaU0ZoZsnAidFt54/hn13XNCWPdnOCs0Rw+2fg4B QI1u0xRphulK4ST44783Nd6Sy663iQ2yDYM3b3JqeGolbMpzJoz9gzwtFVAmv8VFMxtk /8mOtXj5n1E/0gvBKzg56Fm/3QIDOG+6PdDMSy3RVhfjjrYkKSTsqsoSVFBcnQ+gKnyj caHM1GThAq/Nbdepr9BEb606saKr7coqMXRXUWAjZJPg6e5Xes0jPYPmq3dVMhxqcPzu TxJrvKFqjSs1fk5HYKAWiHGQrxIkNa9pJHmbmoQvxlE3kkoSgYqp2LEiIVAHxyuA3Lxr Bu4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=mwRgH1gwGvw1Zmyg8lEWyK1RUMWeRROk6pcDON7Mutc=; b=hu+XQMRybzmbRRUOIZU1LBzyUV6Uv5JhlxrC6qsWZSa0QA1+9yrXqd1tagIIDyvxe6 412gzQYE4bD6shr/sPaRe3VN1C/EqZpUugronrgDdx+zR7P78341gjc/+kb6UQSd9Pm+ J9ZY6SPZ+TWI/7iOcBUu5rSZUyuET2MfMO7FGwtjHar4awkW1aCniSz9WL6u9eZug/r5 +61DzJCSGUANNmFwgvw7f9CFUakC15TqOrxCDap1GKTzdn9xW6NrYIoZU61orJjX7L4o JKH+ScSMwe4IHK+fXerC0S54gCnEibtUW6UERuppUvn5iL38+xkEMyCEvsOcIaoKyzHg IGvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=sL7klO90; 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 b23-20020a170902b61700b00194821e608dsi11370825pls.387.2023.01.18.02.56.31; Wed, 18 Jan 2023 02:56:43 -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=sL7klO90; 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 S229909AbjARK4J (ORCPT + 99 others); Wed, 18 Jan 2023 05:56:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230002AbjARKxB (ORCPT ); Wed, 18 Jan 2023 05:53:01 -0500 Received: from mail.3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 926C888744; Wed, 18 Jan 2023 02:01:48 -0800 (PST) Received: from mwalle01.sab.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 403D11696; Wed, 18 Jan 2023 11:01:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1674036106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mwRgH1gwGvw1Zmyg8lEWyK1RUMWeRROk6pcDON7Mutc=; b=sL7klO901P68+Qf+oOucnTQ8o7LJqALT6i87nmTOHVWPOS9ZYlXtiknTB/H8z//VkltPnb UztiV9XdRDU5w++sTB8S4n9hEz4uwMs5H6JSVhAdg07jAhK2O5B0+DDv56MqvpmlTPTOVG Bdnqi9+Oi61wYHTPU4EWyb81JqFpSw1jtqsaaDKW6TbkpXPTRDfdMPyt37OO1t2W/dCSta tJAhIrZ68UvwOcCHU3CPygVZ/L2zVoGL6wP2g/NfT+DzQe+VOMXSxGDsGfaF5qdRk6p3t9 2kYLiT8zedHyBMw554J6/N5RiVOWfwIwYvnxaCY8VPMRyDTl2QL2tXiB4bxLLg== From: Michael Walle Date: Wed, 18 Jan 2023 11:01:38 +0100 Subject: [PATCH net-next v2 4/6] net: mdio: scan bus based on bus capabilities for C22 and C45 MIME-Version: 1.0 Message-Id: <20230116-net-next-remove-probe-capabilities-v2-4-15513b05e1f4@walle.cc> References: <20230116-net-next-remove-probe-capabilities-v2-0-15513b05e1f4@walle.cc> In-Reply-To: <20230116-net-next-remove-probe-capabilities-v2-0-15513b05e1f4@walle.cc> To: Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Lorenzo Bianconi , Matthias Brugger , Bryan Whitehead , UNGLinuxDriver@microchip.com, Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Joel Stanley , Andrew Jeffery Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-aspeed@lists.ozlabs.org, Andrew Lunn , Michael Walle , Jesse Brandeburg X-Mailer: b4 0.11.1 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?1755357541168361694?= X-GMAIL-MSGID: =?utf-8?q?1755357541168361694?= From: Andrew Lunn Now that all MDIO bus drivers which set probe_capabilities to MDIOBUS_C22_C45 have been converted to use the name API for C45 transactions, perform the scanning of the bus based on which methods the bus provides. Signed-off-by: Andrew Lunn Signed-off-by: Michael Walle Reviewed-by: Jesse Brandeburg --- drivers/net/phy/mdio_bus.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index a664eeb1868d..5b2f48c09a6a 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -711,9 +711,7 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) goto error_reset_gpiod; } - if (bus->probe_capabilities == MDIOBUS_NO_CAP || - bus->probe_capabilities == MDIOBUS_C22 || - bus->probe_capabilities == MDIOBUS_C22_C45) { + if (bus->read) { err = mdiobus_scan_bus_c22(bus); if (err) goto error; @@ -721,9 +719,7 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) prevent_c45_scan = mdiobus_prevent_c45_scan(bus); - if (!prevent_c45_scan && - (bus->probe_capabilities == MDIOBUS_C45 || - bus->probe_capabilities == MDIOBUS_C22_C45)) { + if (!prevent_c45_scan && bus->read_c45) { err = mdiobus_scan_bus_c45(bus); if (err) goto error;