From patchwork Wed Jan 18 10:01:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 45167 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2267606wrn; Wed, 18 Jan 2023 02:57:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXsKZBqMjqlF2Wn65YSdjO5N33PaKgrANjZfLB+O5JXpL9pkxJzXJQUilGsl00v1Uh6xgQzs X-Received: by 2002:a17:906:c283:b0:86a:833d:e7d8 with SMTP id r3-20020a170906c28300b0086a833de7d8mr6578699ejz.17.1674039441654; Wed, 18 Jan 2023 02:57:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674039441; cv=none; d=google.com; s=arc-20160816; b=LhvXcP+l5YNlrSr2foHzPzcgHr8PmPLkWLVKXZ+Wx+BBuNUHDe7k6dTyhIwlufNRNQ PK1N9GXYsl37b+O+e5Egnzd32FyCkYCfikaLsJv87y1CwPe+IDLIlroywX5D/sURZ3DS Z0x3T9Yw+5QfLCCc4P14Cgu2IqbQkD70QqO9WrGUyt6l2ObYoJx/37uyrvQWd3BzKulW KqZx5gna5uRPIB8u7wfHhB7YeLXQX223Gg/yLbpGb/a9LFERBEbCPnPZDqvB0jU1rbII SGnww83DOoEIoixKfTm4KXPI+CQZgHKtwFMmg+QaFDP9Vhyla2CnsAtehPrJCfos7pf3 K7eA== 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=ZH4+OHjOJvEjns1sGRC3xSqdKJqWf+w8GTyoq+9lXgo=; b=BYtTljYqi1SAoE8lfSFbPIp+6KQHY0YeP7xxCXkWlcVN3iU9dEsC1bvw8W4PslZ991 T5sqoS+heBH9/tkyy7G/MpkE0raGPjuEmCPYSU38ogWTlciarRFHc1ZMeHAUrkaZ8ylj /tzrro6MhiyxHQJOuct7sBoj5FKcZIPEWfkcnmLek5vW+MvoMWhohIBqr9ZAFpqRbI0V 05jXQl4BZxCBPR+ZW8gTS9Svl5dAG0x1P9cGgdkXhuePIPeybMfhEPV4mmxxQFbiL+UL lKz49LB96SdQ6j8bI2s439D+LW2AYyRj8UWGo6anB9lXcNH1LRI5vWGILMHJ9XipnUIv dImQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=2r2KHe1D; 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 gt8-20020a1709072d8800b0087091d24e3csi10539475ejc.88.2023.01.18.02.56.57; Wed, 18 Jan 2023 02:57:21 -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=2r2KHe1D; 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 S230076AbjARK4U (ORCPT + 99 others); Wed, 18 Jan 2023 05:56:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230008AbjARKxD (ORCPT ); Wed, 18 Jan 2023 05:53:03 -0500 Received: from mail.3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD8F988745; 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 DD86B169D; 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=1674036107; 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=ZH4+OHjOJvEjns1sGRC3xSqdKJqWf+w8GTyoq+9lXgo=; b=2r2KHe1DmFIf4Lgpk0io5RVoe+g9QAtgjFx+mClhOLyAFX8f28TFqxaDfxZZwLnuoC+S16 zcHLbBx0oLT2fZcsrPnykrHvGUFeLePaK7GSBQo4sc4GdN0z+v3iQTAZRRknRTB4IM05Jm 2zdasTrndyWqGfqaUXOZN9vkmzYCAFued1Y2z8qlQqcFaXf6wQH/YAAO44PJWdcUCn6U7o slzwPdEySB3eFWInF+kuMj4JDb+NiS0Tp6Um2UMvU8naJWJNksz+A9w71L+1nF5yEGqkpY FtqMp/nRosYWFdEGOXAT8+l2TyIiHGgXOpB21wlmahHIOK28ZlrACOGbGhhQ1g== From: Michael Walle Date: Wed, 18 Jan 2023 11:01:39 +0100 Subject: [PATCH net-next v2 5/6] net: phy: Decide on C45 capabilities based on presence of method MIME-Version: 1.0 Message-Id: <20230116-net-next-remove-probe-capabilities-v2-5-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?1755357581847434278?= X-GMAIL-MSGID: =?utf-8?q?1755357581847434278?= From: Andrew Lunn Some PHYs provide invalid IDs in C22 space. If C45 is supported on the bus an attempt can be made to get the IDs from the C45 space. Decide on this based on the presence of the C45 read method in the bus structure. This will allow the unreliable probe_capabilities to be removed. Signed-off-by: Andrew Lunn Signed-off-by: Michael Walle Reviewed-by: Jesse Brandeburg --- drivers/net/phy/phy_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 0d371a0a49f2..9ba8f973f26f 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -946,7 +946,7 @@ struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45) * probe with C45 to see if we're able to get a valid PHY ID in the C45 * space, if successful, create the C45 PHY device. */ - if (!is_c45 && phy_id == 0 && bus->probe_capabilities >= MDIOBUS_C45) { + if (!is_c45 && phy_id == 0 && bus->read_c45) { r = get_phy_c45_ids(bus, addr, &c45_ids); if (!r) return phy_device_create(bus, addr, phy_id,