Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1033713pxy; Thu, 22 Apr 2021 21:17:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5vGhxSz9m3Vt3qEYn2sSKW7nePRBMk254N5HcC2Sf21+SZKNC8UuOHl/aDtYX36dhlQbO X-Received: by 2002:a17:907:76fc:: with SMTP id kg28mr2032573ejc.396.1619151472506; Thu, 22 Apr 2021 21:17:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619151472; cv=none; d=google.com; s=arc-20160816; b=pv3cXcqqSzwVmI4H2IwGujT4XeEYzFz6OV3JmeL4WCZkNoyKNwWdUOyDBteZficwXL v9+XrAHFFEKVXnfsxUN2W9Q0PcOSb+3zly/p0bnxCVUUEqHLH6UNVxB0nX9MBkOpyrtt x5nbkZh6SWmSasNupPfPH8t0wnESnDyO+WK4pj7V58IEWPszUzOjH9EcCUERqjjq92Th gP2j3zg8KJDts+jS0jD0K2eveIjZgwarlB7gNIdM29Birm8bmMUciVCt/aQw6emzlnif 87XY9decTO6Wy5EtMwQCKQXr18tN7zSGMPSPV3A3ljzGZI9l0FhA8VLV7oH4G/eFu1pr 8/1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=hPK7cG0zjnt5TeP27jRXX6nUc9rgjxQfRBDSkb6etdM=; b=q0Uei9hxLe99Dzb4TV0idIHtad9JJPPxQxU6+k3ZMIKgpYMBiO9SuZszMlN2HGz9JW Oc3KY5Ks9onqmWXbLVFGF8vsw6+3qZeZZwbRsT/OEcaR9VNyUSqs89d7G1NIv/FGy5UL 1/rSYqbVbi2aGFf/LnVty0eNsOGL1Z1kbzKpY9+qFtv/T6vUw18piKPO0GFUwsE/CX7T ppQzCVmiBWtP5l526cqSyjsnmTZSxzJnwdQVtml8WKq10pxpTz+X3kXl1OiWiyOJdQM1 EARlDvzTh8mLqWLYGQZYdJefHNe0zYUNnYt2So2+1xwCZLPa65EpT1tglJLlvI0xQnrz GCgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ABcxNFaW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l23si4586308ejb.573.2021.04.22.21.17.27; Thu, 22 Apr 2021 21:17:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ABcxNFaW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230437AbhDWERJ (ORCPT + 99 others); Fri, 23 Apr 2021 00:17:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbhDWERI (ORCPT ); Fri, 23 Apr 2021 00:17:08 -0400 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D602EC061574; Thu, 22 Apr 2021 21:16:30 -0700 (PDT) Received: by mail-il1-x12d.google.com with SMTP id p15so3946817iln.3; Thu, 22 Apr 2021 21:16:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hPK7cG0zjnt5TeP27jRXX6nUc9rgjxQfRBDSkb6etdM=; b=ABcxNFaWRXA4+Ao/XLy8ex+as4Wjge2NpRvhfycyIe7eGjGf4seefFjFm0WmD0a6Cz 1KgTFlKnijJARlQmdE+klWSDWuEub8losRomhubAH8aBhUpfG/xpd3yjDuyvJzYvnktn UdsnoXiA0F/iZm9aKAvvhzm6hy2WFWHRUt62GHL5rwHr797FihDR0iQPfG2cehhAl5WE XiPLowo/rxLwwVxf7Yg/no8y4i8sX8nmGG4nXNfr0qtuqB3GanmxUYA6xdSBeaHDCgEj 6ZHBb0g/cx3b68Uo7eSZ7qoCKHlgAD4RlrKb9KApXxhugluA+tVUxQgpxbKhGcDoJMzR 1Tew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hPK7cG0zjnt5TeP27jRXX6nUc9rgjxQfRBDSkb6etdM=; b=NVOKjISIGBVwC1SySC74oovpjQU6V41++dQ4pJfVz1Em4byIPy9duOhtzi3ZIa0eRv NXKvGdRuxaEfZ+g36tN/TlzvnVXa7qZay62xHpkO+Zq58nl+MHJkifsTpS37Um78nhHL vBu7tbAsKGb9ddJfXMGeeGR+gurfnF3PG/e9hPnrBLYFqF9gBsgcVkH4YrhA1eftfHml Yl6gNCIPcypuZOw6xfcDIQMWTiW4dtvRW402DnFn3DvZwnQOcei+A+TNStZCSiMu0SH2 arqTmzsjrqO3kiGL+9bVYwgtGQGKuiE6XM+mz+SIELoROgxf70I7guNwkCUjTS2T15d1 49Mg== X-Gm-Message-State: AOAM530//4HzpkpUkFY2oxcB1Ev72TvcYdldwuvHm0j5hsOUfXkZLLo8 DOlE+szsn/fpOTAAkTGyxxNXu6E97X+AL81kk5U= X-Received: by 2002:a05:6e02:d41:: with SMTP id h1mr1395747ilj.0.1619151390373; Thu, 22 Apr 2021 21:16:30 -0700 (PDT) MIME-Version: 1.0 References: <20210422040914.47788-1-ilya.lipnitskiy@gmail.com> <20210422040914.47788-6-ilya.lipnitskiy@gmail.com> In-Reply-To: From: Ilya Lipnitskiy Date: Thu, 22 Apr 2021 21:16:19 -0700 Message-ID: Subject: Re: [PATCH net-next 05/14] net: ethernet: mtk_eth_soc: reduce MDIO bus access latency To: Felix Fietkau Cc: John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Jakub Kicinski , Matthias Brugger , netdev@vger.kernel.org, Linux Kernel Mailing List , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 22, 2021 at 5:33 AM Felix Fietkau wrote: > > > On 2021-04-22 06:09, Ilya Lipnitskiy wrote: > > From: Felix Fietkau > > > > usleep_range often ends up sleeping much longer than the 10-20us provided > > as a range here. This causes significant latency in mdio bus acceses, > > which easily adds multiple seconds to the boot time on MT7621 when polling > > DSA slave ports. > > > > Use udelay via readx_poll_timeout_atomic, since the MDIO access does not > > take much time > > > > Signed-off-by: Felix Fietkau > > [Ilya: use readx_poll_timeout_atomic instead of cond_resched] > I still prefer the cond_resched() variant. No problem, I will respin with your original change. Looks like we can't take advantage of iopoll.h routine in this case, but that's not the end of the world! > On a fully loaded system, I'd > prefer to let the MDIO access take longer instead of wasting cycles on > udelay. > > - Felix Ilya