Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp113611lqt; Mon, 18 Mar 2024 03:08:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWvUIEYy/hMw8ZxyCdD4Ruw98c5e7uJ1CO7jfunFP+1nBfmcZIniEHP+2THeqdW8JEcL7A9KJ1NCJIEUVE1K/0JPMjPsGRt92hBSAjicw== X-Google-Smtp-Source: AGHT+IFLvc+KT5fPPH6mTJXXidylbFaaard+Vy+zurJzVdfZT94De4pliR3M/I6F4/UQL40Rmtv8 X-Received: by 2002:a17:906:d92b:b0:a46:a3df:6a9e with SMTP id rn11-20020a170906d92b00b00a46a3df6a9emr3683491ejb.18.1710756481944; Mon, 18 Mar 2024 03:08:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710756481; cv=pass; d=google.com; s=arc-20160816; b=XSPghpzH0oVydkX/OcDYlV9XW8vQd3xxIDtJ+j7R4Y0IwTCYOAC60mFLflOcE0niF5 NFkxUeD6uK4xzO7vcZ6+73OMasMghGuu8Rkvo/8goM2F9M5nYgZ5NVqW46Z0KAWejcfD ZMm7v2EKsP3rTP8fh2gTb14x6QoQbOu7ftzr2GNLOD2/Az3PBLqW4WthT5vJUlNpWp0A qqe8Tk+hdCDJaZBmE2X0iQmrU78Y4ai4XkrlJUHn2l5HP9/Z26LQuve9b/nH/vlWjaTZ 1gzpkCyl3MnDUBoXMJp/iMkMTLK9/MNcoleyC8XwmDeBrwQete4WhAhUHRNNuF1x9l68 BTsg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=UjhdYcghU+6oGp0f0ppi3Vin6mzC87vD2TKJqS1tz6c=; fh=6cu+yRpTvdJPNszLCW+1Po4MBDyXYf2hR65rL6VH9ZE=; b=rE4S7vrpyF/TIYy2jmqJE5+ywc2UBr7nSN43AIIG/rNlnm0QQQweZwvzFhqf2d/U9q ZKrM66N/kCqbiBeK+tyMW1OMfFG/d+XvaPwYxipMKGoK7XVHGFDAAC/oDHhdd07Vkyx8 k+S0kCK8uF/vaoPm3SRvobsQ3i43WX5OMvRdKlphsoZE0iX2s9DTChSZ+7hneGDWh26T WsJAm+ZCpuAbT95oNFV1DeXSaf5RPBuQJzW3wsys7cz7XS5Jdsae3Xn1a9wCUyqZ9Xnp L275XvMc36WAqGdctt1bYaAmShxde+5ZgtH9gycU6zr1vdY5BM25oovb0zjhZzpOyTAz on9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qwULD6Xe; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-105944-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105944-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id he38-20020a1709073da600b00a46b02e31c5si1606902ejc.7.2024.03.18.03.08.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 03:08:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-105944-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=@linutronix.de header.s=2020 header.b=qwULD6Xe; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-105944-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105944-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 AA1941F22166 for ; Mon, 18 Mar 2024 10:08:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1EF172E64C; Mon, 18 Mar 2024 10:07:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qwULD6Xe"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="vKJTMyOp" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 7EC0A2C87A; Mon, 18 Mar 2024 10:07:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710756459; cv=none; b=fbTDnnn2FmVAzpud1KklVURNK0nUKkIOsM+e+vi6f0hREAjmCZNdjsmCTLIEvwVxPhrVvg+0WmiWHUpOdPh1IjnY7aI/r2wrw7vYC1DlcKEqVZH2KvuUjNd/JqKWzYBtGNL1tF916O+2NW/hnXWHtK/b8gT5+/6IbY3XUGQjy5w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710756459; c=relaxed/simple; bh=pj+rcMyOroe98gdifNXYG8iw5FTYjh/F7Hkr4AymIWk=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=p6tGty8G/qDzLrlf5ySPePPgskQDMdYNc9db1feTVebnoHjU8uCmoyI7QNycgBawmLRO5qIwhQ72BWpk4m8PwvV2CD+mYNGbdxSmeoZ6ZZFWbVN1lKg3llQzxJccOnxfgouYCmS6JoPRigQda2Vd3d10mK6BSkePXgM1srDcs64= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=qwULD6Xe; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=vKJTMyOp; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Mon, 18 Mar 2024 10:07:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1710756453; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UjhdYcghU+6oGp0f0ppi3Vin6mzC87vD2TKJqS1tz6c=; b=qwULD6Xe7+Y5FA7Zr6epn/BKRUohz4UiiNQtaaZSlSjvbK/S0imd0zGW1TTA3Uiq24X0/l jiWiPTZRRbXdzgzvnPNG63CtK9z2GV0GvH/Lm5ljFsllg2aFIagig09n/kD4et+1fpDPQp H4sRKq3rKJ65IrMnhaGclB7mevWJaLolHJHtAaqJ6JQY0qloG9qvMEOnncCPUTOL1oXhgn 5X7G0tcnfrB9qOVnMSEQYhfLoXKtQf6vOSS0QJPT9un89bY/EUBg1lW7IVW8YDqRTcBV0T Hxy7bFo/J5RIMMfk29rxMdhNqTfYN8neSS8TXoeMoD2ePuEKfrf0qu0pmO7NRQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1710756453; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UjhdYcghU+6oGp0f0ppi3Vin6mzC87vD2TKJqS1tz6c=; b=vKJTMyOpuiXqGadf8P82U0oPZVvi4XdbnCF6hXvTMnRp6XAkO/wLkcsSfWrEtawMq+qNui JxLH7CQcw2Pn3FBA== From: "tip-bot2 for Ley Foon Tan" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] clocksource/drivers/timer-riscv: Clear timer interrupt on timer initialization Cc: , Ley Foon Tan , Samuel Holland , Atish Patra , Daniel Lezcano , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240306172330.255844-1-leyfoon.tan@starfivetech.com> References: <20240306172330.255844-1-leyfoon.tan@starfivetech.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <171075645287.12214.16209590885523114527.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the timers/core branch of tip: Commit-ID: 8248ca30ef89f9cc74ace62ae1b9a22b5f16736c Gitweb: https://git.kernel.org/tip/8248ca30ef89f9cc74ace62ae1b9a22b5f16736c Author: Ley Foon Tan AuthorDate: Thu, 07 Mar 2024 01:23:30 +08:00 Committer: Daniel Lezcano CommitterDate: Wed, 13 Mar 2024 12:08:59 +01:00 clocksource/drivers/timer-riscv: Clear timer interrupt on timer initialization In the RISC-V specification, the stimecmp register doesn't have a default value. To prevent the timer interrupt from being triggered during timer initialization, clear the timer interrupt by writing stimecmp with a maximum value. Fixes: 9f7a8ff6391f ("RISC-V: Prefer sstc extension if available") Cc: Signed-off-by: Ley Foon Tan Reviewed-by: Samuel Holland Tested-by: Samuel Holland Reviewed-by: Atish Patra Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20240306172330.255844-1-leyfoon.tan@starfivetech.com --- drivers/clocksource/timer-riscv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c index e66dcbd..79bb9a9 100644 --- a/drivers/clocksource/timer-riscv.c +++ b/drivers/clocksource/timer-riscv.c @@ -108,6 +108,9 @@ static int riscv_timer_starting_cpu(unsigned int cpu) { struct clock_event_device *ce = per_cpu_ptr(&riscv_clock_event, cpu); + /* Clear timer interrupt */ + riscv_clock_event_stop(); + ce->cpumask = cpumask_of(cpu); ce->irq = riscv_clock_event_irq; if (riscv_timer_cannot_wake_cpu)