Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5372305rdb; Wed, 13 Dec 2023 07:01:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJRCfBAGqZ6MKVGsXgxHH711Tspy9IBCjAHNLWIEMchkOPlojspBTweEmhGXIQgyRXAsSe X-Received: by 2002:a05:6a00:3a15:b0:6d0:8b0d:b8c1 with SMTP id fj21-20020a056a003a1500b006d08b0db8c1mr5635056pfb.35.1702479706106; Wed, 13 Dec 2023 07:01:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702479706; cv=none; d=google.com; s=arc-20160816; b=H8SQgbVc2kMKdihRdknadplJ2iAG1XQZ1hQtHpryf7O/URQjU8aUtK+vop5SAqmbmN EinzdIkLxgXjyxUei+djAZ5ryBTWXO1z/EDAJUgEy5Dg/0YCags1l3SURdaT/wLaH72V lInkDPe8y4DuFDDBJ9CB/XCwjv+B8WYmoYX+oi6/Ma5mAMoOeul2030sUCCJ/2q5T8x9 y8uvwok3/6MByYpZq7AkCtBXpEAT7E9MxXZiexVqN6whO17tS8LiT69AIafuK8oGF0gP Rnnp6ov4PjW6x9JwlkBZscz2YwwuMAcrJbvAE7YY36WRf6zeXYOI3QjkwwD0nityJu6B PcHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=kIJRGB7mIa7tpVmwJASBbdkeVUIyBOjlKcbZ7uMeRys=; fh=BoV1PfXn9sBjgnH2FipdQKF4lU5DEYSMchN65QVSRRs=; b=L5BdCCTf8RZR/vV/jw6fkI/oG8Z+KMptyk89qB4FC1tlccXKT9GSR6pgwWVqVENaDP 8wzKICRGuK10jzaIeQr9H6zt1dWpnGZeGwDpT5uXOzsa3OozsdlNYjcxHRLemoNsV9lx xbo0e4DfHVs0BjXYaA6l7Ghp/Uu4QQzXRiJmjic8ZoFGU44P72C7nXr9oq5mSVS9hRf4 9wd2LrdLjNqmz4LWHBUWImM8+sh+wpzaKlmokbexBcsHYN3zJDp8Rl+JmsJx8sxc6pr5 QiZjRUMzvRGBRs59BdpsOYPFNmirMrz51J9Ajls6yxwcGh6/wCcwuheuLQ+c7DN2sIFE X1XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=S1KJdxEy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id k6-20020aa788c6000000b006cbf2bc1af9si9594105pff.0.2023.12.13.07.01.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 07:01:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=S1KJdxEy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 21E7A8035AD8; Wed, 13 Dec 2023 07:01:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442080AbjLMPBP (ORCPT + 99 others); Wed, 13 Dec 2023 10:01:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442024AbjLMPBK (ORCPT ); Wed, 13 Dec 2023 10:01:10 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6F19A0; Wed, 13 Dec 2023 07:01:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=kIJRGB7mIa7tpVmwJASBbdkeVUIyBOjlKcbZ7uMeRys=; b=S1KJdxEy3S2wKw5HhAOIvi4LZD 3ZfMhG1j55QLofJe0a1KlTx/ytZ0QoqhEiCPDZKrMbFXuhy5LLAsyuVosSCkr37rNcJtciMxCYmdU 2ZjhuNRlXkCZ88l4XatA0AGMZHLi1QiD3/EIFZA0O/U7lYOH7mi1uRX2p5Hf2b1nbDo3E/MZ15o50 emD/ARxdip9ud/rVF3K4AB1pizPDNk2g1kLr/8wyrkeobVlLfKIbFM2ELQERUb3SsoDjphFv8Wik7 VVcJFtdsBgI8PBB/aEQEQwNPC1Qubz+pniOZBspd+XbG5VLwkApUD3xnGkcZ9qEydEZHK2ZBaw5pM 8fM+Cjvg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:58630) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rDQjV-00005J-0l; Wed, 13 Dec 2023 15:01:09 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rDQjV-0001Zs-U5; Wed, 13 Dec 2023 15:01:09 +0000 Date: Wed, 13 Dec 2023 15:01:09 +0000 From: "Russell King (Oracle)" To: Andrew Lunn Cc: Justin Chen , netdev@vger.kernel.org, Doug Berger , Florian Fainelli , Broadcom internal kernel review list , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , open list Subject: Re: [PATCH] net: mdio: mdio-bcm-unimac: Delay before first poll Message-ID: References: <20231213000249.2020835-1-justin.chen@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Russell King (Oracle) X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 13 Dec 2023 07:01:43 -0800 (PST) On Wed, Dec 13, 2023 at 11:57:52AM +0100, Andrew Lunn wrote: > On Tue, Dec 12, 2023 at 04:02:49PM -0800, Justin Chen wrote: > > With a clock interval of 400 nsec and a 64 bit transactions (32 bit > > preamble & 16 bit control & 16 bit data), it is reasonable to assume > > the mdio transaction will take 25.6 usec. Add a 30 usec delay before > > the first poll to reduce the chance of a 1000-2000 usec sleep. > > #define MDIO_C45 0 > > suggests the hardware can do C45? The timing works out different then. > Maybe add a comment by the udelay() that is assumes C22, to give a > clue to somebody who is adding C45 support the delay needs to be > re-evaluated. Note, however, that the driver only supports C22 operations (it only populates the read|write functions, not the c45 variants). However, it doesn't explicitly set the MDIO_C22 bit in the configuration register, so what ends up being spat out on the bus would be dependent on the boot loader configuration. However, I'm wondering why unimac_mdio_poll() isn't written as (based on current code): return read_poll_timeout(unimac_mdio_readl(priv, MDIO_CMD), val, !(val & MDIO_START_BUSY), 2000, 2000000); rather than open-coding the io polling. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!