From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1CE24446BF5 for ; Tue, 11 Aug 2026 13:47:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786456044; cv=none; b=DcbonOWGnvpHRjOJp01DDeWANtJcSBsHL5PO2uvdp/hpr2+WTXflA187Jdwqs+np38aifztt4BpeMGiLYUh67sON1n+RgZ7W3g4OrkPt2qby14XPeSsfKBxM4iMUmSjdZRyLYuICr7ssrdzzVJ36vwf3p99HEfK7BzOWd7AnX0k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786456044; c=relaxed/simple; bh=ZzMudb7c/mo+GvAQg5QmRQnHcOqCd2Q95K343LStNgY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fRWIqjSxzAbIKbaQx9cMIyffDItJbbxA24uJh72nSR5CXiym2N5vIq2ejXqqrmfJ8LzeIzAxdWEr5I7iROF/D8tQpfLG7WeQBtli6G33w5eIC6aEIW1RA1eaeRWAo6WYTXjgc0vn90Yzlxrcjgw2xwGNpmmp2xfDarrs34RihmQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=CorzIymT; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CorzIymT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786456036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GrGKMdz/1jegWEqmKxWWQdw6mFlOdld/a4bzJBeswoA=; b=CorzIymTK4M0VcbYU3Gw+EE4qtnRKhaEAV/CT5MChnSuK6Hchvwp9MQBMfdPnUPgH+6Fat WKZckW5Dd9G/0hxv4wo1HehufpqvzD/S1VOLEEOimOFQBWVJXuhVJyzXcOm0ow9XSVQi1l kjumSRmj2KecvnIhww/I77tyAkyhuf4= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-385-Pgm37mB7OB2CcqKbUHkTeg-1; Tue, 11 Aug 2026 09:47:12 -0400 X-MC-Unique: Pgm37mB7OB2CcqKbUHkTeg-1 X-Mimecast-MFC-AGG-ID: Pgm37mB7OB2CcqKbUHkTeg_1786456030 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C9E121800651; Tue, 11 Aug 2026 13:47:09 +0000 (UTC) Received: from p16v.redhat.com (unknown [10.44.49.196]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1E1D9195DF91; Tue, 11 Aug 2026 13:47:05 +0000 (UTC) From: Ivan Vecera To: netdev@vger.kernel.org Cc: Arkadiusz Kubalewski , Jakub Kicinski , Jiri Pirko , Min Li , Paolo Abeni , Petr Oros , Richard Cochran , Vadim Fedorenko , linux-kernel@vger.kernel.org Subject: [PATCH net-next v7 1/3] dpll: zl3073x: scale poll interval proportionally to timeout Date: Tue, 11 Aug 2026 15:46:58 +0200 Message-ID: <20260811134700.1211010-2-ivecera@redhat.com> In-Reply-To: <20260811134700.1211010-1-ivecera@redhat.com> References: <20260811134700.1211010-1-ivecera@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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, -- 2.54.0