From: Thomas Gleixner <tglx@linutronix.de>
To: Jindong Yue <jindong.yue@nxp.com>
Cc: linux-kernel@vger.kernel.org, fweisbec@gmail.com, mingo@kernel.org
Subject: Re: [PATCH] tick/broadcast: Allow later probed device enter oneshot mode
Date: Mon, 29 Mar 2021 23:17:46 +0200 [thread overview]
Message-ID: <878s657j7p.ffs@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20210329052555.24487-1-jindong.yue@nxp.com>
On Mon, Mar 29 2021 at 13:25, Jindong Yue wrote:
> /*
> * Debugging: see timer_list.c
> @@ -115,8 +116,20 @@ void tick_install_broadcast_device(struct clock_event_device *dev)
> * notification the systems stays stuck in periodic mode
> * forever.
> */
> - if (dev->features & CLOCK_EVT_FEAT_ONESHOT)
> + if (dev->features & CLOCK_EVT_FEAT_ONESHOT) {
> tick_clock_notify();
If the kernel runs in oneshot mode already, then calling
tick_clock_notify() does not make sense.
> + /*
> + * If new broadcast device is installed after high resolution
> + * timers enabled, it can not switch to oneshot mode anymore.
This is not restricted to high resolution timers. The point is that
the mode is ONESHOT which might be either HIGHRES or NOHZ or both.
> + */
> + if (tick_broadcast_oneshot_active() &&
> + dev->event_handler != tick_handle_oneshot_broadcast) {
How would that condition ever be false for a newly installed device?
> + tick_broadcast_switch_to_oneshot();
> + }
So what you really want is:
if (!(dev->features & CLOCK_EVT_FEAT_ONESHOT))
return;
if (tick_broadcast_oneshot_active()) {
tick_broadcast_switch_to_oneshot();
return;
}
tick_clock_notify();
Thanks,
tglx
next prev parent reply other threads:[~2021-03-29 21:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-29 5:25 [PATCH] tick/broadcast: Allow later probed device enter oneshot mode Jindong Yue
2021-03-29 21:17 ` Thomas Gleixner [this message]
2021-03-30 12:27 ` [EXT] " J.d. Yue
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=878s657j7p.ffs@nanos.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=fweisbec@gmail.com \
--cc=jindong.yue@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
/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