Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3196630rwb; Mon, 16 Jan 2023 05:08:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXs4SO8w4pSozZMJELSFse8LqjNEkI4QCFW6w4xXAeq+aGi2tvOP/1H/8/wkexasMkdZVABX X-Received: by 2002:a17:907:9a98:b0:7c1:d4c:f08c with SMTP id km24-20020a1709079a9800b007c10d4cf08cmr82645729ejc.4.1673874514755; Mon, 16 Jan 2023 05:08:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673874514; cv=none; d=google.com; s=arc-20160816; b=YspEMZ9k847VgKeX8R2Quqt7yyhrCCJ7csl47yofgAGgwy5pte9IF1p1sYHGSjUnR3 T9Vhu1zbd9ENJFoGUprihoWlh+XOP5qrpOz4eLJzjbDj3wngrD/V9smYUSYMrvKCMHSe iUcSOTeYf2x+VWtZXSpbyWtNcTT05JTLCzdkqwBMbvTOEMYPu3defUUeiUjKoTIiCA58 j30DGCl2wQKorVd3jHKWxuxtsdQdFK9+I1UF0Fv2lL0WkS84cKBVj9cFeuuZy0TDD9Ts U+zr/XXJryB9WcIuwZn+xghvoZAoRM2nb62utVZ6M6JvNmMkkT+HOWDJ70MLOfjVCJd0 eEdA== 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=AmefAQEWD+GXbgOk3BMV9ynZkxYglIuiK7s798TPecY=; b=ll5+YXsdFNZENRJ50VCO+NAbLYwIFSBAJznAYaaIAySpGpgCShd8hmrAqshsA2LIm7 1YrcMFGJOvmBfGUFSE3/iNDAfs4rxeLsf3YT1KDordwtf1pvG8gF5gMoGwDlQo2kGCUy RoCO0k7Ra15NS3JDyHZSXXc6vc7TeJc1RmqVG1B66n8Ia3vn0+SIQWZycI5pno4ACN97 RPUDiT4NLEK/ymsy8eczLgF+LTfcmT7fKLLqJUsYFOLHAnQWojwjlx5+PfM5BdLTPdNI QZc3qTFSmyQExwfd1uOW1V0RkkIBczJh1fLewZGVk+RV9ES+muadVn0dUl6N0S3+1ezw dikw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=sLKvbJrI; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di15-20020a170906730f00b007ae4ed48290si33132868ejc.279.2023.01.16.05.08.21; Mon, 16 Jan 2023 05:08:34 -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=sLKvbJrI; 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 S230340AbjAPM6N (ORCPT + 51 others); Mon, 16 Jan 2023 07:58:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231348AbjAPM47 (ORCPT ); Mon, 16 Jan 2023 07:56:59 -0500 Received: from mail.3ffe.de (0001.3ffe.de [159.69.201.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2081620059; Mon, 16 Jan 2023 04:55:45 -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 12FAB16EC; Mon, 16 Jan 2023 13:55:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1673873738; 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=AmefAQEWD+GXbgOk3BMV9ynZkxYglIuiK7s798TPecY=; b=sLKvbJrI4kgqXVv0pEyIqGsNsTL/zk7yE0HThyFFkMmz/0rL8L46ETSp/M2C0OK5DLoXWT hIZ5SC4WG761f39d6rCOdGeKQX6iOI5FJp0GUBhh5L1nRnI/5bZbFJw/myihMni8gH/jyz hWsb962vtJC7Uof5rECX095OR++UDFZnmcNWvPM2WM4T7frVlwzFjAY0HafVGNTVYH6eIa 9odv6m9nZ3CVvnGVh+x8ybF5zJAvxIiaBwMrs6o1/lItG+yZCcHPSsF8YXi7ENJArrdPx9 XtMC2MoIHkjkhaTJrsB+UC+OY6qqAW/BSZhNftyh8yjqV+XOvVJx+yF/uOJBOA== From: Michael Walle Date: Mon, 16 Jan 2023 13:55:17 +0100 Subject: [PATCH net-next 5/6] net: phy: Decide on C45 capabilities based on presence of method MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230116-net-next-remove-probe-capabilities-v1-5-5aa29738a023@walle.cc> References: <20230116-net-next-remove-probe-capabilities-v1-0-5aa29738a023@walle.cc> In-Reply-To: <20230116-net-next-remove-probe-capabilities-v1-0-5aa29738a023@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 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 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 --- 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, -- 2.30.2