From patchwork Mon Feb 13 18:26:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 56437 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2503158wrn; Mon, 13 Feb 2023 10:31:08 -0800 (PST) X-Google-Smtp-Source: AK7set9CIsYyStZvQ6J+iS34gKo1CV9hK83aK+FfuB6C/naLgrc1CG4tJ5w/J718X/DNiZO+IRBS X-Received: by 2002:a17:907:6da4:b0:8aa:c0d5:166d with SMTP id sb36-20020a1709076da400b008aac0d5166dmr28180160ejc.71.1676313068755; Mon, 13 Feb 2023 10:31:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676313068; cv=none; d=google.com; s=arc-20160816; b=flc6HHS0IvXGHwpj36x6UAh5Zg7raV+db0EuyOwHRb5FPFKWT76G78Ioo4WC7SAJP9 LABEnbpwEzDBznIvBzeBdUT/ft7467xKig+LLcPiptoOb87hXNVTcoFQjMIkzV6XRFNq AYWEMlbFJFmtJEfEakkZleOtY9ghxrMbHYIJo0uy9cHJTR55jSmmowrmmNPJZO3Prptk GoKGKMAFBei+g996xOFyBn4bYLc9gUI3JzLhpmLrWXc4ax+Nn31DktNTgfiKbirU09Eo UDYkEWVPoOlleV5cw51Znfnr8xPGQu4Q4BnifopT+Y4Eht7uOMS/TFXNa3/gutPAXjyI cCSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=jRvsYlPKAkyUONMmY3Do21DCFIfU1YIyXzRXIXHlfu4=; b=d0MFsLE3CoAoN4PKL1W4gip26lcBk67bzQjZ80/tttox5EKoHVXMhGLDcWxEBs/SEC RUALd2hxyogwgzW4zR2G3TXuxgN7dtRYOmFmDFmXWyOws+9vqak0dlpWJbEUGK6nVlxK zFI+nfney9VE4eL6NjmbQHO4B8rLjZwk+Qgo/yiVoXaBczGwiCKDeJYOzLSnQZa+0Uyp e90vpqn3BavD4yaLZIjZ2umUs9+9zz0X1vQx8l34oo/dpTNGNn0ctSQDoIrAZqY4OQB6 5XsJKjhuzXCKQ57E/EVUIPnRTYf1GJiJQ6h0PAZU+0+LXkXAvMqiIPSx47QQw9ZXbqsy aDGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=HXeCE88T; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cq18-20020a170906d51200b00872236c2754si13220821ejc.223.2023.02.13.10.30.45; Mon, 13 Feb 2023 10:31:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=HXeCE88T; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231269AbjBMS07 (ORCPT + 99 others); Mon, 13 Feb 2023 13:26:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230043AbjBMS02 (ORCPT ); Mon, 13 Feb 2023 13:26:28 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EF802104; Mon, 13 Feb 2023 10:26:27 -0800 (PST) Date: Mon, 13 Feb 2023 18:26:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1676312784; 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=jRvsYlPKAkyUONMmY3Do21DCFIfU1YIyXzRXIXHlfu4=; b=HXeCE88Thb6qPKdWbaw9ml5YuX50g+buEMzqbRSyzOx/SJ51VdRqJwcH2JKzXjigyHhaQG M90VPyeNEqqfX7ekyoh8a3hf1H4Fdx1kECuRdy4LgbctVdL0O270GINRmen54PhsFRIsDA yq1KDFwM9RcZXACqRZdEMPQJElBAGVUszn3xbU33CGPj9eTKkb2vQ49pSMfDfRNfSALMJh DqCUxWRpYvxa0gSTe0ZM/xYqoUqKAwoVvopl7vYvE7RTFk1Bmnn7/bRSMlu0Weed521Zh9 fsqR1hYFJ4pS581Wu2CTso0I73URFkSRRdRZWUM9igxDeiA/Sp1ozMNI58jUPA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1676312784; 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=jRvsYlPKAkyUONMmY3Do21DCFIfU1YIyXzRXIXHlfu4=; b=3oLrymvHZkmkMkiMnofWpJKl1aN0v5FK9rEH2K7pwpo4rxgUfh0vRYQzdARV1gvDxxHvue jP9wmTNkBvQqGRDQ== From: "tip-bot2 for Lad Prabhakar" 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/riscv: Get rid of clocksource_arch_init() callback Cc: Lad Prabhakar , Samuel Holland , Conor Dooley , Daniel Lezcano , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221229224601.103851-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221229224601.103851-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Message-ID: <167631278366.4906.10317855823309761779.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753590571925376382?= X-GMAIL-MSGID: =?utf-8?q?1757741652254151674?= The following commit has been merged into the timers/core branch of tip: Commit-ID: 3aff0403f814df6ce2377a6ecf61dd7750a3925f Gitweb: https://git.kernel.org/tip/3aff0403f814df6ce2377a6ecf61dd7750a3925f Author: Lad Prabhakar AuthorDate: Thu, 29 Dec 2022 22:46:01 Committer: Daniel Lezcano CommitterDate: Mon, 13 Feb 2023 13:10:17 +01:00 clocksource/drivers/riscv: Get rid of clocksource_arch_init() callback Having a clocksource_arch_init() callback always sets vdso_clock_mode to VDSO_CLOCKMODE_ARCHTIMER if GENERIC_GETTIMEOFDAY is enabled, this is required for the riscv-timer. This works for platforms where just riscv-timer clocksource is present. On platforms where other clock sources are available we want them to register with vdso_clock_mode set to VDSO_CLOCKMODE_NONE. On the Renesas RZ/Five SoC OSTM block can be used as clocksource [0], to avoid multiple clock sources being registered as VDSO_CLOCKMODE_ARCHTIMER move setting of vdso_clock_mode in the riscv-timer driver instead of doing this in clocksource_arch_init() callback as done similarly for ARM/64 architecture. [0] drivers/clocksource/renesas-ostm.c Signed-off-by: Lad Prabhakar Tested-by: Samuel Holland Reviewed-by: Conor Dooley Reviewed-by: Samuel Holland Link: https://lore.kernel.org/r/20221229224601.103851-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Daniel Lezcano --- arch/riscv/Kconfig | 1 - arch/riscv/kernel/time.c | 9 --------- drivers/clocksource/timer-riscv.c | 5 +++++ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index e2b6560..9c687da 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -12,7 +12,6 @@ config 32BIT config RISCV def_bool y - select ARCH_CLOCKSOURCE_INIT select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2 select ARCH_HAS_BINFMT_FLAT diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c index 1cf21db..babaf3b 100644 --- a/arch/riscv/kernel/time.c +++ b/arch/riscv/kernel/time.c @@ -33,12 +33,3 @@ void __init time_init(void) tick_setup_hrtimer_broadcast(); } - -void clocksource_arch_init(struct clocksource *cs) -{ -#ifdef CONFIG_GENERIC_GETTIMEOFDAY - cs->vdso_clock_mode = VDSO_CLOCKMODE_ARCHTIMER; -#else - cs->vdso_clock_mode = VDSO_CLOCKMODE_NONE; -#endif -} diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c index adf7f98..d8cb629 100644 --- a/drivers/clocksource/timer-riscv.c +++ b/drivers/clocksource/timer-riscv.c @@ -78,6 +78,11 @@ static struct clocksource riscv_clocksource = { .mask = CLOCKSOURCE_MASK(64), .flags = CLOCK_SOURCE_IS_CONTINUOUS, .read = riscv_clocksource_rdtime, +#if IS_ENABLED(CONFIG_GENERIC_GETTIMEOFDAY) + .vdso_clock_mode = VDSO_CLOCKMODE_ARCHTIMER, +#else + .vdso_clock_mode = VDSO_CLOCKMODE_NONE, +#endif }; static int riscv_timer_starting_cpu(unsigned int cpu)