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 6EC3BC678D5 for ; Tue, 7 Mar 2023 20:36:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230009AbjCGUgc (ORCPT ); Tue, 7 Mar 2023 15:36:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229668AbjCGUgb (ORCPT ); Tue, 7 Mar 2023 15:36:31 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0356A7AA2; Tue, 7 Mar 2023 12:36:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=BVb4tiMdT2faXd9FacvIsPER+ODtFm7SXnJKt/bIKr0=; b=XGkkYfMl0eR2Y5wzxKDMDPNrn6 +rpYYkyAcD+KC/5LdUYdjbbzDP670KJnpZC8xkvFvh47FJPVoC7PHNTwgCmmKukCe5q8dYb6edElx CRu9TxI/bt8+LUNptGEYi6cAxXM526j2XXdeBPT/O7+jny9MlxoCJ7uNlgqOzjpnyjs0=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pZe2A-006haZ-W3; Tue, 07 Mar 2023 21:35:42 +0100 Date: Tue, 7 Mar 2023 21:35:42 +0100 From: Andrew Lunn To: Klaus Kudielka Cc: Michael Walle , 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 , 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, Jesse Brandeburg Subject: Re: [PATCH net-next v2 4/6] net: mdio: scan bus based on bus capabilities for C22 and C45 Message-ID: <72530e86-9ba9-4a01-9cd2-68835ecae7a0@lunn.ch> References: <20230116-net-next-remove-probe-capabilities-v2-0-15513b05e1f4@walle.cc> <20230116-net-next-remove-probe-capabilities-v2-4-15513b05e1f4@walle.cc> <449bde236c08d5ab5e54abd73b645d8b29955894.camel@gmail.com> <100c439a-2a4d-4cb2-96f2-5bf273e2121a@lunn.ch> <712bc92ca6d576f33f63f1e9c2edf0030b10d3ae.camel@gmail.com> <0e10aa8492eadb587949d8744b56fccaabbd183b.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0e10aa8492eadb587949d8744b56fccaabbd183b.camel@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Summary: Still 4 calls to mdio_bus_scan_c22, but also *2* calls to mdio_bus_scan_c45, approx. 190*100 reads by the switch driver Those calls to mdio_bus_scan_c45 are caused by 743a19e38d02 net: dsa: mv88e6xxx: Separate C22 and C45 transactions. Some families of the mv88e6xxx do support C45 bus transactions. That includes the 6171 you have. Before, we never scanned the C45 bus, but now we do. But something does not add up. Doing an additional c45 scan should only double the number of reads by the switch driver. The only part of a c45 scan which is not linear is mv88e6xxx_g2_smi_phy_wait() which is implemented by mv88e6xxx_wait_mask(). That loops reading a register waiting for a bit to change. Maybe print out the value of i, and see if it is looping more times for C45 than C22? Andrew