Received: by 2002:ab2:6991:0:b0:1f2:fff1:ace7 with SMTP id v17csp134760lqo; Wed, 27 Mar 2024 08:49:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVDSJq5NqLPiTUf7pTlZ4Tf75y3Z2sKjDj0pXpNWeeOMFAoYLBmZ1DDwAdRHc8QC4T57gajE8D7qeBzO/cj6VdsDW06R5ZGE716iLRcZA== X-Google-Smtp-Source: AGHT+IEOZJArduQ0BGnEELkPWLDS//8usjX/uVyXkzmp7hRqqlauNZIGWfmntywqdX1BHizwh8pW X-Received: by 2002:a05:620a:b8d:b0:78a:3954:9d53 with SMTP id k13-20020a05620a0b8d00b0078a39549d53mr1583713qkh.50.1711554589883; Wed, 27 Mar 2024 08:49:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711554589; cv=pass; d=google.com; s=arc-20160816; b=OKVA+YJxsORIAE1h/uwNwk3HBlelSdo3qvPhlh3W0Wx8BPimu1rA1W/uawX7hXdzIq E+rSEkxDxKfH4GX8YnxbT4jCwUrQnltlJajsNqQfUZ7v/fXLhO4Jz/nRxrY5+i+KEqVF Bb+zmsKp+QgB0iDURGINiMlL+9LY5BuMOFsSQwojGWmEcA3NdOGOyS7FYsrtz+jnrjue 0lKCPYLNaI7MGxKCtsEMQlkKvi655VH3ms6DG+eDv870z5cl99LGgLEaCCf+twjaPUgn Ki5qxjO9ZCcKMLLklv2ANQ8J5Q2oPjZtsybl8mqpRZ03d4L9qQ4Qv0xUj5WKuu1Neor/ kePg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/GmwF5HxGed1Ck9ZPY9KgMvSCNsC3sDNE7MYe7SMQIw=; fh=m+lkMSgpAsPrsBPjNkIveMqClHfEKCUqtpjmyG590AA=; b=USZcwLx7x1axSuUNQw7lt2gwqlV+ssSkQHSbGjTBoBne8yFgZOMeL3//jJC6NtHyXN pZTI6r16D5pJRNqwok3yvexFmdKpaAhQ4KoSh87lgmGbxjab3zUzDFxqQ4kwSPY79RVE lpdfUuWAzwbiYUVn9K3JoqLgvB1GjSWDeHpuDQqoOPQ5zAWsANivtHWa/od1T5meaG2J yDya9/qymeO6Lcp4UKHcZrlN+IcatYjEi2gJi7g1NBs0A3o4+yUG6JYSAOmOr1YBKPCB +NhlU2+4b6Snzmw4SJ8BU1K621lqlY5EuW35M4q2MyjpBrANxUKaGErGzKksFSqkWVW5 pkcA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Sr1y1Cuu; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-121568-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121568-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a16-20020a05620a125000b007883c2043d3si10163863qkl.139.2024.03.27.08.49.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 08:49:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-121568-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Sr1y1Cuu; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-121568-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121568-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 934901C3157A for ; Wed, 27 Mar 2024 15:49:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D573131735; Wed, 27 Mar 2024 15:48:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Sr1y1Cuu" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 90D1C131732 for ; Wed, 27 Mar 2024 15:48:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711554501; cv=none; b=VS1lmQlJ/i4tfEhm422EukChvRV4GSWJtr1VlaFZRLzXFFoI74Yx/MoW+b/4FxL+AjaTSuwdb+WSS8VHoPFozYWJgtLR4XZZ1LPb2z6Aai4CywpmQb8h598rwzjGMKljSAfvtoM6oxQSdAS0xWwaHg1QQF0wpYjY5RLAEYKx1+k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711554501; c=relaxed/simple; bh=kxw8lEOeXnx/duF9z7ST9TT/zC6EoGrvtJe8oJFI1B0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F1hOieLV/PYxIiL5qF3GJFnV8DCni4bXu3QpWkc1wsHSVNFUCk+VYDWS9k72ggM1bcmUBp4qkqzKNLY4V8t4ZBJj7+rMsAFOtm7J9HjDE+jT1FrduRfNzoRR4LulFK2R16f40bUAVpmzxTml4pBtlbxIE3Nb2ZEPnFbbnLRcOIs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Sr1y1Cuu; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A95BC433C7; Wed, 27 Mar 2024 15:48:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711554501; bh=kxw8lEOeXnx/duF9z7ST9TT/zC6EoGrvtJe8oJFI1B0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sr1y1Cuu9f/Se064mDUn1HaCUkTnbO9IBcwOnhO4s3a/Mlvj19hhrxttE8kNOJA1i zW0nSCuYqRkkblNx79/0IToZ+uYKPrVtK/RsRTGET65JvBUlbnBr+xnURpFy6E9uEO Jsc+HyY1Qqo4OpmJ5FHxS0LBgybRWxjAhhIC2DbLn+PzW/Mry+jN1z3i0/FuRNrs0A T0BNpgtrWjidXAsNZVrDC5m0wr0xCw1IWoUuwrYkFCsnQe19gwecezPAQgkZcYdkCK Jl7Orhrx+qfMJ4Tv93a6bLdHSbX/8kFx+KwKZCKZ40GSm5YwG8T0gWZ6tGf2kVX46Y V+Yf/i5ucujfA== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Daniel Lezcano , Thomas Gleixner Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] clocksource/drivers/timer-riscv: Add set_state_oneshot_stopped Date: Wed, 27 Mar 2024 23:35:00 +0800 Message-ID: <20240327153502.2133-2-jszhang@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240327153502.2133-1-jszhang@kernel.org> References: <20240327153502.2133-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To avoid spurious timer interrupts when KTIME_MAX is used, we need to configure set_state_oneshot_stopped(). Although implementing this is optional, it still affects things like power management for the extra timer interrupt. Check commit 8fff52fd5093 ("clockevents: Introduce CLOCK_EVT_STATE_ONESHOT_STOPPED state") for more information. Signed-off-by: Jisheng Zhang --- drivers/clocksource/timer-riscv.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c index 48ce50c5f5e6..e661fc037337 100644 --- a/drivers/clocksource/timer-riscv.c +++ b/drivers/clocksource/timer-riscv.c @@ -69,11 +69,12 @@ static int riscv_clock_shutdown(struct clock_event_device *evt) static unsigned int riscv_clock_event_irq; static DEFINE_PER_CPU(struct clock_event_device, riscv_clock_event) = { - .name = "riscv_timer_clockevent", - .features = CLOCK_EVT_FEAT_ONESHOT, - .rating = 100, - .set_next_event = riscv_clock_next_event, - .set_state_shutdown = riscv_clock_shutdown, + .name = "riscv_timer_clockevent", + .features = CLOCK_EVT_FEAT_ONESHOT, + .rating = 100, + .set_next_event = riscv_clock_next_event, + .set_state_shutdown = riscv_clock_shutdown, + .set_state_oneshot_stopped = riscv_clock_shutdown, }; /* -- 2.43.0