From: Joshua Yeong <joshua.yeong@starfivetech.com>
To: Anup Patel <apatel@ventanamicro.com>
Cc: <daniel.lezcano@linaro.org>, <tglx@linutronix.de>,
<paul.walmsley@sifive.com>, <palmer@dabbelt.com>,
<aou@eecs.berkeley.edu>, <leyfoon.tan@starfivetech.com>,
<linux-kernel@vger.kernel.org>, <linux-riscv@lists.infradead.org>
Subject: Re: [PATCH 1/1] clocksource/timer-risc: Add riscv_clock_shutdown callback
Date: Wed, 15 Nov 2023 15:52:42 +0800 [thread overview]
Message-ID: <f373645c-1e89-df76-e545-21bf0ba9ee8f@starfivetech.com> (raw)
In-Reply-To: <CAK9=C2VXxNjKOq1XqQ9t6iVELdj2fFi85K77xNCOfdf3WRdy8w@mail.gmail.com>
Hi Anup,
On 15-Nov-23 3:00 PM, Anup Patel wrote:
> On Wed, Nov 15, 2023 at 11:49 AM Joshua Yeong
> <joshua.yeong@starfivetech.com> wrote:
>> Add clocksource detach/shutdown callback to disable RISC-V timer interrupt when
>> switching out riscv timer as clock source
>>
>> Signed-off-by: Joshua Yeong <joshua.yeong@starfivetech.com>
>> ---
>> drivers/clocksource/timer-riscv.c | 7 +++++++
>> 1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c
>> index da3071b387eb..588a05459b6a 100644
>> --- a/drivers/clocksource/timer-riscv.c
>> +++ b/drivers/clocksource/timer-riscv.c
>> @@ -50,12 +50,19 @@ static int riscv_clock_next_event(unsigned long delta,
>> return 0;
>> }
>>
>> +static int riscv_clock_shutdown(struct clock_event_device *evt)
>> +{
>> + sbi_set_timer(-1);
> Use riscv_clock_event_stop() here.
You mean replacing riscv_clock_shutdown as riscv_clock_event_stop?
>
>> + return 0;
>> +}
>> +
>> 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,
>> };
>>
>> /*
>> --
>> 2.25.1
>>
> Regards,
> Anup
next prev parent reply other threads:[~2023-11-15 7:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-15 6:18 [PATCH 1/1] clocksource/timer-risc: Add riscv_clock_shutdown callback Joshua Yeong
2023-11-15 7:00 ` Anup Patel
2023-11-15 7:52 ` Joshua Yeong [this message]
2023-11-15 16:24 ` Anup Patel
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=f373645c-1e89-df76-e545-21bf0ba9ee8f@starfivetech.com \
--to=joshua.yeong@starfivetech.com \
--cc=aou@eecs.berkeley.edu \
--cc=apatel@ventanamicro.com \
--cc=daniel.lezcano@linaro.org \
--cc=leyfoon.tan@starfivetech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=tglx@linutronix.de \
/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