Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4993560rdb; Tue, 12 Dec 2023 16:03:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEqMDgpk/9a96WaVVegggdNdZeKcx8v2hZbDCyefX8TtxgFBj0sYbWGLIdzzShpAl7XnJDa X-Received: by 2002:a17:90a:d34e:b0:286:cf0b:3cff with SMTP id i14-20020a17090ad34e00b00286cf0b3cffmr4024743pjx.5.1702425780235; Tue, 12 Dec 2023 16:03:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702425780; cv=none; d=google.com; s=arc-20160816; b=rqsMlof9Zfh6xuMpSxw9JW8hMoufNXnZvdDhE/185wZqxJbaf+KKqLYzbeqC8uFsHy GDC0fD1RBZiAHBHBh7ElN5GZ+SR0n8PQq/XIHPc9OISY/DpJqm2inP+fF/3RXLB7orRa UD4FBtZ7yyaymLaZwE/KeCAKU2tiwgrzVGSvJTGBVU/HvXYJAW7lqfglqgfzC6LEWdTv Wc314x+ekb5JrWUbgYl6Xeby+YGixgBHvbq2nsP4s6NQ30VKwEtzQkXFiMy/msWQ4Xe/ O6TL5yUsii3Zlv6neXjFdy/j4h/I8YFT7TVy1bd+yKC8Bmjhwf85oZWi9caIfS90RcRn wvsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=1j8JaWPUr/J0udycqZlup2LSXZqOjnk8YhBqyAcNIjQ=; fh=FGPTW4l5wNnpfdNodB+lJYulkQBPQMt1F43VOLCfj38=; b=FYwihTttxjs72Cvv3keSbQG92h8+JdzlW4gq7iVAbhvX5gpLwckFqDgqMAjcKf/Bde yAhagNFRWEG8Jdia2WFTk8J3k5EQNquDBvRCWZA9Y3GBfqtCJLMQTS66wNsGGwAYK9gZ h1uPRVrQkeCUafldu+i6Q6hfRwwAiPo+2uvUTqgRu6CObPePmr/6Wl0H1UK/PQ7oPMau 6lWAcLHLCdQ+ATHDu6nlELNUahrlPBPHxz2+upORITbNjV6CnyMdAo7vXomLlnMRwtxY IXNeGFQ/6PjMXTz/j1kSJjUygIttFzvhrhK2piWE8wXHfezaxWV1DboE7xJUmbZlvOfW Cjhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b="TQQtTIA/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id co6-20020a17090afe8600b002886503a12csi9633018pjb.69.2023.12.12.16.02.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 16:03:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b="TQQtTIA/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4FAB480B81DA; Tue, 12 Dec 2023 16:02:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377492AbjLMACt (ORCPT + 99 others); Tue, 12 Dec 2023 19:02:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232536AbjLMACs (ORCPT ); Tue, 12 Dec 2023 19:02:48 -0500 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A28A1B3 for ; Tue, 12 Dec 2023 16:02:54 -0800 (PST) Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-28ad2f0b278so740927a91.0 for ; Tue, 12 Dec 2023 16:02:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1702425774; x=1703030574; darn=vger.kernel.org; h=mime-version:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=1j8JaWPUr/J0udycqZlup2LSXZqOjnk8YhBqyAcNIjQ=; b=TQQtTIA//BNtbbKq0alMNc+d1gLIC6F4V6/a3aHooU6chM8PLZw3sYEBcSbC+qV7mf HPWsGzGbRq4nza+5bKfBmtXS+pDeijMI8yceCQ4rx+pLqSdazX3INS3oKHkLvaVJySQ0 67L932DUOCYWv1EKH8B8GdKxV5/M77wz8TyFU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702425774; x=1703030574; h=mime-version:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=1j8JaWPUr/J0udycqZlup2LSXZqOjnk8YhBqyAcNIjQ=; b=dXMtIqzZlvaOWOFJA/q7tXqQiNXhofUX9IhtDoh62toh3ik2xaU1ArjQRtP4VaCj1X OGhLXM0Xr/orbL3+VQ+2cIfTEBtmoFm9sipO7LpA7VFq8QVMvYfI5Gc+gr8wPQ0cin14 eGjxOanmAmTofd5EHmcSe10wxgkmxNnU4L+bSOCJCIeJy4cyRsYA4FHhOJVrl9RlXN6p Aw20JCB7bk2kFBmwOf+mymlDJ6tDet0n/QZZikieHpTjfl3grUfrPzsmD1lUWvSX01lL 4uZUop1yS7yKQmiYhzanq500VyaYKgGWAmhYyp/ETqEArGIDl549CoFux0KNyt6+LIFe ykYQ== X-Gm-Message-State: AOJu0Yzqvm/Zj4VpYlyYuTaVJFrT838C9jay6cs2VnnGFRhZmplaEOPd Mq0jCWoacngb4g3rdHb1JyaVNA== X-Received: by 2002:a17:903:64e:b0:1d0:cd9e:424c with SMTP id kh14-20020a170903064e00b001d0cd9e424cmr3464483plb.78.1702425774049; Tue, 12 Dec 2023 16:02:54 -0800 (PST) Received: from stbirv-lnx-1.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id n16-20020a170903111000b001d3320f6143sm2336460plh.269.2023.12.12.16.02.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 16:02:53 -0800 (PST) From: Justin Chen To: netdev@vger.kernel.org Cc: Justin Chen , Doug Berger , Florian Fainelli , Broadcom internal kernel review list , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] net: mdio: mdio-bcm-unimac: Delay before first poll Date: Tue, 12 Dec 2023 16:02:49 -0800 Message-Id: <20231213000249.2020835-1-justin.chen@broadcom.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="0000000000008a7a05060c58e3ff" X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MIME_NO_TEXT, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 12 Dec 2023 16:02:58 -0800 (PST) --0000000000008a7a05060c58e3ff Content-Transfer-Encoding: 8bit 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. Reduce the timeout from 1000ms to 100ms as it is unlikely for the bus to take this long. Signed-off-by: Justin Chen --- drivers/net/mdio/mdio-bcm-unimac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/mdio/mdio-bcm-unimac.c b/drivers/net/mdio/mdio-bcm-unimac.c index e8cd8eef319b..1f89b1bdb90f 100644 --- a/drivers/net/mdio/mdio-bcm-unimac.c +++ b/drivers/net/mdio/mdio-bcm-unimac.c @@ -81,7 +81,9 @@ static inline unsigned int unimac_mdio_busy(struct unimac_mdio_priv *priv) static int unimac_mdio_poll(void *wait_func_data) { struct unimac_mdio_priv *priv = wait_func_data; - unsigned int timeout = 1000; + unsigned int timeout = 100; + + udelay(30); do { if (!unimac_mdio_busy(priv)) -- 2.34.1 --0000000000008a7a05060c58e3ff Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIQagYJKoZIhvcNAQcCoIIQWzCCEFcCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg gg3BMIIFDTCCA/WgAwIBAgIQeEqpED+lv77edQixNJMdADANBgkqhkiG9w0BAQsFADBMMSAwHgYD VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UE AxMKR2xvYmFsU2lnbjAeFw0yMDA5MTYwMDAwMDBaFw0yODA5MTYwMDAwMDBaMFsxCzAJBgNVBAYT AkJFMRkwFw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