From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 81F30414DF6; Fri, 4 Sep 2026 05:38:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788500330; cv=none; b=PTzYPFudUYCaxnype7fMYc+R19o4mYTPWjbLgB8TBfWcQyOSWEW+R8cf6fUfr96bHt0VzGmqpgFnzt6RICsMEz7NyYVSyys1kj6+0QzDsena2xGFA1G4nDPiqgjYqezwK+dYO8zIRufRssvwMfbJO4iY/zwoisBHVatPqijbELA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788500330; c=relaxed/simple; bh=UICByc2tyvI7hUzE8fwlu9sFU6WnZGEDIcRnoU9gy78=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tqMIhXXA2/L0yMLKwGfIzTeLb5wr+IIK+9GSFwXuJ+5RHFaz+XMHFh+PVLI713JKmFwZJ8CQZLqGrNIofoMBvC5roCzoP7hFsleYYEfZmvSJLaN9b9jli6+4vhzF/ALyQz2su1RNpQFQKHTuCO02FhYMbIyMrLYZ87OjazD03b4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ik/Ve3qO; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ik/Ve3qO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB4F11F00A3D; Fri, 4 Sep 2026 05:38:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788500329; bh=7U/zFcdBT+KC6Rmbx3gncSPnmHS9uyXXq6cLCxpXOi8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ik/Ve3qONP7N5cP1tGW1B/7dDpJyizeXWaaYARRSVfDmYC7tYqMmkXtdLVatEXpWh agYP1BH3q28OAkxdYGma7ge32pa/tklnWu6lhUTvINgxf6XTi6OfvvKfy3BRjEtN9Q sBnFnb5o2H2ioFbTaCTCBABGm8ybGwwAWFZLcleM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Indrek Kruusa , Felix Yan , Daniel Lezcano , Jernej Skrabec Subject: [PATCH 6.18 019/552] clocksource/drivers/timer-sun4i: Advertise a real minimum delta Date: Fri, 4 Sep 2026 06:52:56 +0200 Message-ID: <20260904045748.260757901@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260904045747.813364717@linuxfoundation.org> References: <20260904045747.813364717@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Felix Yan commit d21808328225ab8cee46885bf9a0dffcefbe630e upstream. sun4i_clkevt_next_event() compensates for the timer stop/start synchronization delay by programming evt - TIMER_SYNC_TICKS into the hardware interval register. The clockevent device currently advertises TIMER_SYNC_TICKS as min_delta_ticks, so the clockevents core is allowed to call set_next_event() with evt == TIMER_SYNC_TICKS. That programs a zero-tick interval. With oneshot/highres/nohz timer operation this can leave the next event stuck, which was observed as a boot hang on Allwinner D1 after the clockevents core started reusing forced minimum-delta events. Advertise one extra tick instead, so the smallest event accepted by the core still programs at least one hardware tick after the synchronization compensation. Fixes: 12e1480bcb49 ("clocksource: sun4i: Report the minimum tick that we can program") Reported-by: Indrek Kruusa Closes: https://lore.kernel.org/linux-riscv/CA+fTLhgLmTY+exGujKf8OYYQvcEW5X5NJ_5sLq2AYL6zER2c0A@mail.gmail.com/ Assisted-by: Codex:gpt-5.5 Signed-off-by: Felix Yan Signed-off-by: Daniel Lezcano Tested-by: Indrek Kruusa Acked-by: Jernej Skrabec Cc: stable@vger.kernel.org Link: https://lore.kernel.org/linux-riscv/CA+fTLhgLmTY+exGujKf8OYYQvcEW5X5NJ_5sLq2AYL6zER2c0A@mail.gmail.com/ Link: https://patch.msgid.link/20260624220434.4183732-1-felixonmars@archlinux.org Signed-off-by: Greg Kroah-Hartman --- drivers/clocksource/timer-sun4i.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/clocksource/timer-sun4i.c +++ b/drivers/clocksource/timer-sun4i.c @@ -208,7 +208,7 @@ static int __init sun4i_timer_init(struc sun4i_timer_clear_interrupt(timer_of_base(&to)); clockevents_config_and_register(&to.clkevt, timer_of_rate(&to), - TIMER_SYNC_TICKS, 0xffffffff); + TIMER_SYNC_TICKS + 1, 0xffffffff); /* Enable timer0 interrupt */ val = readl(timer_of_base(&to) + TIMER_IRQ_EN_REG);