Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: walter.chang@mediatek.com
Cc: Mark Rutland <mark.rutland@arm.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	wsd_upstream@mediatek.com, stanley.chu@mediatek.com,
	Chun-hung.Wu@mediatek.com, Freddy.Hsin@mediatek.com,
	stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] clocksource/drivers/arm_arch_timer: Disable timer before programming CVAL
Date: Mon, 17 Jul 2023 10:19:08 +0100	[thread overview]
Message-ID: <867cqyvqsz.wl-maz@kernel.org> (raw)
In-Reply-To: <20230717090735.19370-1-walter.chang@mediatek.com>

On Mon, 17 Jul 2023 10:07:34 +0100,
<walter.chang@mediatek.com> wrote:
> 
> From: Walter Chang <walter.chang@mediatek.com>
> 
> Due to the fact that the use of `writeq_relaxed()` to program CVAL is
> not guaranteed to be atomic, it is necessary to disable the timer before
> programming CVAL.
> 
> However, if the MMIO timer is already enabled and has not yet expired,
> there is a possibility of unexpected behavior occurring: when the CPU
> enters the idle state during this period, and if the CPU's local event
> is earlier than the broadcast event, the following process occurs:
> 
> tick_broadcast_enter()
>   tick_broadcast_oneshot_control(TICK_BROADCAST_ENTER)
>     __tick_broadcast_oneshot_control()
>       ___tick_broadcast_oneshot_control()
>         tick_broadcast_set_event()
>           clockevents_program_event()
>             set_next_event_mem()
> 
> During this process, the MMIO timer remains enabled while programming
> CVAL. To prevent such behavior, disable timer explicitly prior to
> programming CVAL.
> 
> Fixes: 8b82c4f883a7 ("clocksource/drivers/arm_arch_timer: Move MMIO timer programming over to CVAL")
> Cc: stable@vger.kernel.org
> Signed-off-by: Walter Chang <walter.chang@mediatek.com>

Acked-by: Marc Zyngier <maz@kernel.org>

	M.

-- 
Without deviation from the norm, progress is not possible.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

       reply	other threads:[~2023-07-17  9:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230717090735.19370-1-walter.chang@mediatek.com>
2023-07-17  9:19 ` Marc Zyngier [this message]
2023-07-17  9:22 ` [PATCH] clocksource/drivers/arm_arch_timer: Disable timer before programming CVAL AngeloGioacchino Del Regno
     [not found] ` <9c428d54c07f60e79c63119621bf03b797f79a37.camel@mediatek.com>
2023-08-18 10:06   ` Daniel Lezcano

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=867cqyvqsz.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=Chun-hung.Wu@mediatek.com \
    --cc=Freddy.Hsin@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=stanley.chu@mediatek.com \
    --cc=tglx@linutronix.de \
    --cc=walter.chang@mediatek.com \
    --cc=wsd_upstream@mediatek.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