From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta0.migadu.com (out-194.mta0.migadu.com [91.218.175.194]) (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 8AE1A3B05B8 for ; Wed, 12 Aug 2026 10:05:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786529159; cv=none; b=ko9xEXY7YUrun0yOtcevqre6Bipi5QNQk3B+N+aMDZPooWMtH7c8rTkEBoFTB6lR6wb1HB5+uWO4myr/lbMubzfO/yokHJM+vuO6J2X+Nu3y0EGLdihajPKdI+/iyUgbHIUS2Dij22w4O2Bj+43KvURiTlvuUQVNNw8/hNoI/LQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786529159; c=relaxed/simple; bh=CZkiz6vLX+dQevDtX1mEJjBU1kNDEQ3un6l+FtA+J5w=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MBrNhMP8xuyqUxD+KinLb7C08fQ54f2ZN0Zi7ocZIY/GYqejUvq4HojUFqo3A79NvDTVgtpKD3NzzxrjZfKvdhjdU/P652F7VhhlMUBt70UrtAVVlmth+EehAOprTpcb9BzZmm7PsFwf/h8qWChUkXr36//KsCdyv4asa6QkqUk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=RN84PRf9; arc=none smtp.client-ip=91.218.175.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="RN84PRf9" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=CZkiz6vLX+dQevDtX1mEJjBU1kNDEQ3un6l+FtA+J5w=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1786529155; v=1; x=1787133955; b=RN84PRf9eAvYFcBOtMdMHdZIgeXFCE6D5O+A4jjvrIfvje8P1lgll5D8hOpnyNKBO5KznZFG 9604p4MWOjfRWLHNmIcOsik+j5jWNOm62jxeDt2hJAdh+t9/qNCixhbu6gRtWf1htWGhkisqo9h j1IJMrgne8HszaNoyPJp/Qes= X-Envelope-To: linux-kernel@vger.kernel.org Received: from [IPV6:2a03:83e0:111e:2:c6:2f62:38ca:59d8] (2620:10d:c092:500::5:4188) by smtp.migadu.com with ESMTPS id 0bad5567c72d80c5; Wed, 12 Aug 2026 10:05:55 +0000 X-Migadu-Scanner: mta11.migadu.com Authentication-Results: mta11.migadu.com; none Message-ID: <7178de38-aede-48d2-b6d4-031ce09a21d1@linux.dev> Date: Wed, 12 Aug 2026 11:05:46 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v7 1/3] dpll: zl3073x: scale poll interval proportionally to timeout To: Ivan Vecera , netdev@vger.kernel.org Cc: Arkadiusz Kubalewski , Jakub Kicinski , Jiri Pirko , Min Li , Paolo Abeni , Petr Oros , Richard Cochran , linux-kernel@vger.kernel.org References: <20260811134700.1211010-1-ivecera@redhat.com> <20260811134700.1211010-2-ivecera@redhat.com> Content-Language: en-US From: Vadim Fedorenko In-Reply-To: <20260811134700.1211010-2-ivecera@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/08/2026 14:46, Ivan Vecera wrote: > Replace the fixed 10 us poll sleep in zl3073x_poll_zero_u8() with > timeout_us / 50, scaling the sleep interval proportionally to the > timeout for all callers. > > Testing showed that existing callers (mailbox, HWREG, DF read, > frequency measurement and phase error polls with 25-50 ms timeouts) > typically completed in low hundreds of sleep cycles with the fixed > 10 us interval. With the scaled interval the cycle count drops to > single digits. The longer PTP-related timeouts (up to 3000 ms for > phase step) added in the following patches benefit most, avoiding > on the order of 10^5 bus transactions per wait. > > Signed-off-by: Ivan Vecera > --- > drivers/dpll/zl3073x/core.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/dpll/zl3073x/core.c b/drivers/dpll/zl3073x/core.c > index 5b2d77f2c2288e..2e8b52c8de5e26 100644 > --- a/drivers/dpll/zl3073x/core.c > +++ b/drivers/dpll/zl3073x/core.c > @@ -322,7 +322,7 @@ int zl3073x_write_u48(struct zl3073x_dev *zldev, unsigned int reg, u64 val) > int zl3073x_poll_zero_u8(struct zl3073x_dev *zldev, unsigned int reg, > u8 mask, unsigned int timeout_us) > { > -#define ZL_POLL_SLEEP_US 10 > + unsigned int sleep_us = timeout_us / 50; > unsigned int val; > > /* Check the register is 8bit */ > @@ -336,7 +336,7 @@ int zl3073x_poll_zero_u8(struct zl3073x_dev *zldev, unsigned int reg, > reg = ZL_REG_ADDR(reg) + ZL_RANGE_OFFSET; > > return regmap_read_poll_timeout(zldev->regmap, reg, val, !(val & mask), > - ZL_POLL_SLEEP_US, timeout_us); > + sleep_us, timeout_us); > } > > int zl3073x_mb_op(struct zl3073x_dev *zldev, unsigned int op_reg, u8 op_val, Reviewed-by: Vadim Fedorenko