From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Nick Hu <nick.hu@sifive.com>,
greentime.hu@sifive.com, zong.li@sifive.com,
"Rafael J. Wysocki" <rafael@kernel.org>,
Pavel Machek <pavel@ucw.cz>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Thomas Gleixner <tglx@linutronix.de>,
Andrew Jones <ajones@ventanamicro.com>,
Conor Dooley <conor.dooley@microchip.com>,
Samuel Holland <samuel.holland@sifive.com>,
Sunil V L <sunilvl@ventanamicro.com>,
linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: Anup Patel <anup@brainfault.org>
Subject: Re: [PATCH v3 2/2] clocksource/drivers/timer-riscv: Stop stimecmp when cpu hotplug
Date: Mon, 28 Oct 2024 10:44:50 +0100 [thread overview]
Message-ID: <5f7179ec-e4ce-4644-8a60-ce407a4d2f11@linaro.org> (raw)
In-Reply-To: <20241028033928.223218-3-nick.hu@sifive.com>
On 28/10/2024 04:39, Nick Hu wrote:
> Stop the timer when the cpu is going to be offline otherwise the
> timer interrupt may be pending while performing power-down.
>
> Suggested-by: Anup Patel <anup@brainfault.org>
> Link: https://lore.kernel.org/lkml/20240829033904.477200-3-nick.hu@sifive.com/T/#u
> Signed-off-by: Nick Hu <nick.hu@sifive.com>
> Reviewed-by: Anup Patel <anup@brainfault.org>
> ---
> drivers/clocksource/timer-riscv.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c
> index 48ce50c5f5e6..166dee14e46b 100644
> --- a/drivers/clocksource/timer-riscv.c
> +++ b/drivers/clocksource/timer-riscv.c
> @@ -127,6 +127,12 @@ static int riscv_timer_starting_cpu(unsigned int cpu)
> static int riscv_timer_dying_cpu(unsigned int cpu)
> {
> disable_percpu_irq(riscv_clock_event_irq);
> + /*
> + * Stop the timer when the cpu is going to be offline otherwise
> + * the timer interrupt may be pending while performing power-down.
> + */
> + riscv_clock_event_stop();
> +
> return 0;
> }
Should it not be the opposite?
First stop the clock which clears the interrupt and then disable the irq?
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
next prev parent reply other threads:[~2024-10-28 9:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-28 3:39 [PATCH v3 0/2] Support SSTC while PM operations Nick Hu
2024-10-28 3:39 ` [PATCH v3 1/2] riscv: Add stimecmp save and restore Nick Hu
2024-10-28 4:01 ` Anup Patel
2024-10-28 3:39 ` [PATCH v3 2/2] clocksource/drivers/timer-riscv: Stop stimecmp when cpu hotplug Nick Hu
2024-10-28 9:44 ` Daniel Lezcano [this message]
2024-10-29 7:52 ` Nick Hu
2025-03-27 3:25 ` [PATCH v3 0/2] Support SSTC while PM operations patchwork-bot+linux-riscv
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5f7179ec-e4ce-4644-8a60-ce407a4d2f11@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=ajones@ventanamicro.com \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=conor.dooley@microchip.com \
--cc=greentime.hu@sifive.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=nick.hu@sifive.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=pavel@ucw.cz \
--cc=rafael@kernel.org \
--cc=samuel.holland@sifive.com \
--cc=sunilvl@ventanamicro.com \
--cc=tglx@linutronix.de \
--cc=zong.li@sifive.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®