From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49779C54E94 for ; Tue, 24 Jan 2023 21:20:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234954AbjAXVUj (ORCPT ); Tue, 24 Jan 2023 16:20:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234844AbjAXVUh (ORCPT ); Tue, 24 Jan 2023 16:20:37 -0500 Received: from mail.3ffe.de (0001.3ffe.de [159.69.201.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0E2D3A8C; Tue, 24 Jan 2023 13:20:35 -0800 (PST) Received: from 3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) (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 161CC38; Tue, 24 Jan 2023 22:20:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1674595234; 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=iefToLm/HhuY9nOOwIdvaLvUm7L0h1oW0ep+0Gv8q4g=; b=IN9x24bRydV5+CHB0ToGcAJ1Rq57g0jZeXSCW9gRyUhem7tMrw2mL1XLIYPFnmThxDstIT Jdcw60/nd4iY+IQIm+1LXHumWzBhLLvYBONHgb6C1dc7+FvFbnKE/vwweT/czkhj/BqNmC BpRsxcSgZP3wCFt6uISYdGUDgaCq4IeaZaiaoFmWhEYOgO87RXnLwdvajdGf5mAglDyvJk l8DHS7lwN9PFmebDdvn0VRcY7I9oiTup7NdfHDfpJ0zmTTwlyprZ1aGTTIHVnoms5Tcmtp iRPZpSwXQ/fFlxsy8CrEQuRgyCluPszqFtwJHYftljDreq5IjcmZB5qHs4Oqvw== MIME-Version: 1.0 Date: Tue, 24 Jan 2023 22:20:33 +0100 From: Michael Walle To: Andrew Lunn Cc: "Russell King (Oracle)" , Yisen Zhuang , Salil Mehta , "David S . Miller" , Jakub Kicinski , Paolo Abeni , Florian Fainelli , Broadcom internal kernel review list , Heiner Kallweit , =?UTF-8?Q?Marek_Beh=C3=BAn?= , Xu Liang , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 0/5] net: phy: C45-over-C22 access In-Reply-To: References: <20230120224011.796097-1-michael@walle.cc> User-Agent: Roundcube Webmail/1.4.13 Message-ID: X-Sender: michael@walle.cc Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 2023-01-24 22:03, schrieb Andrew Lunn: >> Btw. for the DT case, it seems we need yet another property >> to indicate broken MDIO busses. > > I would prefer to avoid that. I would suggest you do what i did for > the none DT case. First probe using C22 for all devices known in DT. > Then call mdiobus_prevent_c45_scan() which will determine if any of > the found devices are FUBAR and will break C45. Then do a second probe > using C45 and/or C45 over C22 for those devices in DT with the c45 > compatible. I tried that yesterday. Have a look at of_mdiobus_register() [1]. There the device tree is walked and each PHY with a reg property is probed. Afterwards, if there was a node without a reg property, the bus is scanned for the missing PHYs. If we would just probe c22 first, the order of the auto scanning might change, if there is a c45 phy in between two c22 phys. I was thinking to just ignore the case that the autoscan would discover a broken PHY. (1) scan c22 (2) scan c45 (maybe using c45-over-c22) (3) do the autoscan -michael [1] https://elixir.bootlin.com/linux/v6.2-rc5/source/drivers/net/mdio/of_mdio.c#L149 > > Andrew