Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp430554pxy; Thu, 22 Apr 2021 05:35:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYc1ctY0hwC1bIkAkJutWcj0Dtk0D/UosZ9cUrMjPbOYWBAkxke+GNrXWNbypiediywdkz X-Received: by 2002:a17:906:7c52:: with SMTP id g18mr3122500ejp.362.1619094907779; Thu, 22 Apr 2021 05:35:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619094907; cv=none; d=google.com; s=arc-20160816; b=MCsrIU9LzxDfR1K+bwu6w6Fa8/LhxOpRQ16aMHj5aqcNVcQ+2lclZ8VWDwuKXfdV8x ZaFILp8WH796EID8FLFUhg4qTmt6/mRCQATWF3x6eDU7hWOGTDMN+2iJW2rc5Ov3uApz e1PjyjG2+UJpNlJrsATu1HYURV3fH1fpBUevSsZ5JOS4FfuV5nBEZ/IbNXQdzCGTw94K 6WiUUDK6VJuHwh8DmhVZwnyxyXLYyAspDCFV8wuMQ83jN/r6FODl399oF4Xzt1Kjkn2Z 0UHkzpCxVErf2mo74FUkPTf32a5ZnOuILv74kv5EemFsmiJjLgLnVncvVWUnqCCRd/l1 1JGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=B7Q4T6dJAsdsQ+Ix5yA7JOmBt+U9csvMzUwRnH4jDQU=; b=FMc7dWiYSmuoWgMx06uBJXJi/2MhWmWg6TVd48AZu39cZf6ggzD0SbDax4j/s4sZdo qY7YwRR4IPROTeS6mn+BOsyQOazCYvrojUe4Y05IcTO4an+mXffuNnF/wVdlfiHNsuRY oc0b8llSljt453plto8m+aMuLcQouIFM/2dgvnGPj67i75eM4DxEVdPiUGFFVE9f9UMP fzoHeN50pGXw3CJh3edpduhXQkvPMyBKnym6i5gJaJw9OJ7hI+m7jSHjTFMLEE6uDR+6 JloMBkqh4nW1TmmCdjfnmZLEa7sf1eV4kHLZicPOUv5eymeJ0RazBAqXCRonHC4FUl9d iMZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=og3af5XO; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id le19si2351155ejb.535.2021.04.22.05.34.42; Thu, 22 Apr 2021 05:35:07 -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=fail header.i=@nbd.name header.s=20160729 header.b=og3af5XO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236008AbhDVMeS (ORCPT + 99 others); Thu, 22 Apr 2021 08:34:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230510AbhDVMeS (ORCPT ); Thu, 22 Apr 2021 08:34:18 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A36A1C06174A; Thu, 22 Apr 2021 05:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:To:Subject:Sender:Reply-To:Cc: 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=B7Q4T6dJAsdsQ+Ix5yA7JOmBt+U9csvMzUwRnH4jDQU=; b=og3af5XO5faTW0xLx1tDv9FdVv 7pDXIJug5QDv2LZlIJDJU2Yn3RvRtsrsMqcA61T8C+Ra849DZN3EAJurepVm7qpPRR5EcMB/HxIMf 6J+2uOyl3Bys4hgd1nldqZg9u64987ep5WQmqZlhP28vlNodwXutRz10l3RuNQTDZnSo=; Received: from p4ff13bc6.dip0.t-ipconnect.de ([79.241.59.198] helo=nf.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1lZYWS-0004UX-1s; Thu, 22 Apr 2021 14:33:32 +0200 Subject: Re: [PATCH net-next 05/14] net: ethernet: mtk_eth_soc: reduce MDIO bus access latency To: Ilya Lipnitskiy , John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Jakub Kicinski , Matthias Brugger , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20210422040914.47788-1-ilya.lipnitskiy@gmail.com> <20210422040914.47788-6-ilya.lipnitskiy@gmail.com> From: Felix Fietkau Message-ID: Date: Thu, 22 Apr 2021 14:33:31 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <20210422040914.47788-6-ilya.lipnitskiy@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. On a fully loaded system, I'd prefer to let the MDIO access take longer instead of wasting cycles on udelay. - Felix