Received: by 2002:ab2:604e:0:b0:1f4:60f3:cb4a with SMTP id a14csp14566lqm; Fri, 5 Apr 2024 07:32:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWaoBBe84GThSf/+3Iik9E9dceiquJCKGQkJxUVFY3ejlVe2a4Vp1dP0bizP9Y1xok+XaPtiLCI6j14BIdZ5aEHZQCTgbKJ4RZVJ6wviA== X-Google-Smtp-Source: AGHT+IHGn3jcoaGTWKdWtaTUNva6hqY3vRsBOWPIvHQ/8js9nAZSUqoEz4msLhpESDb5RlMQu7mA X-Received: by 2002:a17:907:11cd:b0:a4f:193e:9600 with SMTP id va13-20020a17090711cd00b00a4f193e9600mr2326803ejb.18.1712327578794; Fri, 05 Apr 2024 07:32:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712327578; cv=pass; d=google.com; s=arc-20160816; b=KVyipD5y8QYlCzcBYosM4bKrQ7nZ/H9/v7+SIjmd1Q9YTY4uHtMcxxfk4xWxgDykH4 IltzBnrMBUiZMMOfSWZs9hd3ZvuwI6SOoUZPRb1oJGqNrDnnGGSP2soURwmKzJ6TTrs2 jzYNWFBckD+pXe9oRvAKs8jZFtPl0yCKEPPf+XYJwNIjlBWetdcDsj3PYPEo01aM66Dr 31guAxlTvp2C8Y9Q9SFcobPMST2A59PcmMQr+2CWMFnIKTB2cSFxiJjZn2nVr2rIPMvo JB6DkcE3l0UBGbLU3t/FoZESsIjivX1x57pnU/Oyy8uLQf4O7CDrk+cnx4dIDGWqdqvh AI0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=BS81x8TgiZotkdmg7KJCaBTl5pwcK5PQXZyvnJwjgzU=; fh=urrF2gorgBXxnCcVB5NhR4Spbu+xH6IYpQ+LkkGRnPw=; b=jKIz2aNLwwaKy0yBp7StIIdmoTT1XOtzsOux2Y5++azgLlXZyOs+pv1NoyBEaoQIaM AbqnzhVQZ0gy9e57jWHVQ5wMptcy0viuQbTqFuYbnn5xVx5nCqcLgg1NdKi1FeWSfNFn xOy1tvRMJ3KEsKzX5YOz6+sCjur/fYwsHJcSr21cYOi45IHp0f2Ewscosdl5zrpDqh2O O7EmCNrldJ1UvGhZztfQwOsHFuPo8WZyL1BWHonhOJo3edAf+Id07YbTys7DnFGdZ+9a CGfdiXLLMkUNFlYl9t9KL0Jfw9r07NmiQgQaBbL9rbwKSOB1RApYFgfPSOa3O4eoIFmg wULg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ggW49QXl; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-133165-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133165-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id lc24-20020a170906f91800b00a5195fbe5e7si765093ejb.668.2024.04.05.07.32.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 07:32:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133165-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ggW49QXl; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-133165-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133165-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 32B8D1F23AAE for ; Fri, 5 Apr 2024 14:32:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE18D16F27D; Fri, 5 Apr 2024 14:32:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ggW49QXl" Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63AD879F3; Fri, 5 Apr 2024 14:32:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712327568; cv=none; b=js7GfxzPfZMOHB6rDc1rzrxySkJNcz1qZr99gbPYogqhzO5yoiMbIkzAGCzrTd9Hej8bri89+pLFiz1uyCuQgV/Bu2pESrftPfkfRsUTZrLXQOZ+t8T9hWfLRXR9/77v9y6CWWIhjGyldH1Kfpo61FthhyLgLKfjhh68JzfJ4rw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712327568; c=relaxed/simple; bh=+oo3aoyeQYFyc18BS/Ko8Z7rugy4H+kTpGy/XFlZNaw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MtN2oXrM8GFl7o5AfvgJy9vZEgwWGSywmQmnVTRM/6UZOe6YDoE1Orm0gH4aJAwQ11AtdMO+TALE5SXcEAube5S9udZooyxYwizswvM1nKo7MI2byUIzUn+Z7njiElSlODHzG78Elzy0AZ5Pczeoa4eJpHDs3BJ6YOAleL2kHCo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ggW49QXl; arc=none smtp.client-ip=209.85.208.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-56e2e09fc27so1464662a12.0; Fri, 05 Apr 2024 07:32:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712327565; x=1712932365; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=BS81x8TgiZotkdmg7KJCaBTl5pwcK5PQXZyvnJwjgzU=; b=ggW49QXlevp0AievJMN1YSQ2eBmP8twPi5t7HqxnCoVRNQaOJadgQOsRfxu8/cZHiN Ei+/LALmMcZzZ1BjXELKV8FJFiFqX+oPS5c65IiFeHWGfYpgG0Bdk1u45W1J2IYt4B3o c3LSfZXk/A6hafj0PW7r9ZnWLZjSSOIP4IjQBUBKMbEtWl849hx/xCG3cHe4Dj2BHTkp G39ENaX+b6/ePlSBMFsTucm+u7enrvVU5EEsPHn9iNUN3A0FkbMahtPFJvN3Fzqkww3O EvbmNr9hK1PHJgI1dn0YcFmCJXFnry+ym9AGEu/VghQ/VtIJFJsdLwmRtbOaKBQPs0Yq Pjpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712327565; x=1712932365; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BS81x8TgiZotkdmg7KJCaBTl5pwcK5PQXZyvnJwjgzU=; b=FMZJA4mEDi9wBgQoAlasqCLJ++URUcWX5nDn9FZ0re/gp4+Ry8XqXenmMW/eVDXvOH yHgV7sYPakg3D5VoR9sDbAcuSLu3QD2vn6TlV/oQvz/xgljpzYTdPInGdmOuacYVZZS7 MkBBhd/mTFgeGkkv7IDHTIGRelvTDiqNl4jzaLRTemCeqoBq20d+bOsWgu0TssR7BkPU gksd5ZJcffclKkQBUvv2TZK7Ytl3VKnpRBBItuCASaztzZg3ivDTmxinQSNB8FFZCChr /qG3x5UWx2q3+QLnTFdjI+FCJ5zUGRt65jlKEicNRoD/ad+ddPHUfR8ASdAO9qhd5f5H pryA== X-Forwarded-Encrypted: i=1; AJvYcCXsPC+YufjxWgRPhvfNMT3D1lkMD0M/wmH8q018RneUQgCPPdSxKs9VsNYJYmDqJxq6pQgvIzu/69qcKOHoctpnbnTD9LVTm/T9kcsO X-Gm-Message-State: AOJu0YyG1ro7r4Lhc3++pfjwC0/fKXtCzAy0c/b05Gi7zMwJkZat7aNn itnqhR+Qv8GZYKWm8d86qoNPMNcuZBTuhcXKDesADZOyIsfv451+ X-Received: by 2002:a50:bb29:0:b0:56d:c85a:7893 with SMTP id y38-20020a50bb29000000b0056dc85a7893mr70911ede.8.1712327564348; Fri, 05 Apr 2024 07:32:44 -0700 (PDT) Received: from skbuf ([2a02:2f04:d700:2000::b2c]) by smtp.gmail.com with ESMTPSA id h1-20020a0564020e8100b005682a0e915fsm841041eda.76.2024.04.05.07.32.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 07:32:43 -0700 (PDT) Date: Fri, 5 Apr 2024 17:32:40 +0300 From: Vladimir Oltean To: Pawel Dembicki Cc: netdev@vger.kernel.org, Linus Walleij , Simon Horman , Russell King , Andrew Lunn , Florian Fainelli , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v8 01/16] net: dsa: vsc73xx: use read_poll_timeout instead delay loop Message-ID: <20240405143240.rwm5klyy7nm7lvdm@skbuf> References: <20240403103734.3033398-1-paweldembicki@gmail.com> <20240403103734.3033398-2-paweldembicki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240403103734.3033398-2-paweldembicki@gmail.com> On Wed, Apr 03, 2024 at 12:37:17PM +0200, Pawel Dembicki wrote: > Switch the delay loop during the Arbiter empty check from > vsc73xx_adjust_link() to use read_poll_timeout(). Functionally, > one msleep() call is eliminated at the end of the loop in the timeout > case. > > As Russell King suggested: > > "This [change] avoids the issue that on the last iteration, the code reads > the register, tests it, finds the condition that's being waiting for is > false, _then_ waits and end up printing the error message - that last > wait is rather useless, and as the arbiter state isn't checked after > waiting, it could be that we had success during the last wait." > > Suggested-by: Russell King > Reviewed-by: Andrew Lunn > Reviewed-by: Linus Walleij > Reviewed-by: Florian Fainelli > Signed-off-by: Pawel Dembicki > --- Reviewed-by: Vladimir Oltean