From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Karthik Poosa <karthik.poosa@intel.com>
Cc: <intel-xe@lists.freedesktop.org>, <anshuman.gupta@intel.com>,
<badal.nilawar@intel.com>, <rui.zhang@intel.com>,
<jani.saarinen@intel.com>, <srinivas.pandruvada@intel.com>
Subject: Re: [PATCH] [core-for-CI PATCH] x86/apic: Stop the TSC Deadline timer during lapic timer shutdown
Date: Tue, 8 Oct 2024 13:34:12 -0400 [thread overview]
Message-ID: <ZwVtFJzWMUrTwg5C@intel.com> (raw)
In-Reply-To: <20241007135242.3028131-1-karthik.poosa@intel.com>
On Mon, Oct 07, 2024 at 07:22:42PM +0530, Karthik Poosa wrote:
> From: Zhang Rui <rui.zhang@intel.com>
>
> This is a core-for-CI patch for
> https://lore.kernel.org/all/20240929063521.17284-1-rui.zhang@intel.com/
>
> According to Intel SDM, for the local APIC timer,
> 1. "The initial-count register is a read-write register. A write of 0 to
> the initial-count register effectively stops the local APIC timer, in
> both one-shot and periodic mode."
> 2. "In TSC deadline mode, writes to the initial-count register are
> ignored; and current-count register always reads 0. Instead, timer
> behavior is controlled using the IA32_TSC_DEADLINE MSR."
> "In TSC-deadline mode, writing 0 to the IA32_TSC_DEADLINE MSR disarms
> the local-APIC timer."
>
> Current code in lapic_timer_shutdown() writes 0 to the initial-count
> register. This stops the local APIC timer for one-shot and periodic mode
> only. In TSC deadline mode, the timer is not properly stopped.
>
> Some CPUs are affected by this and they are woke up by the armed timer
> in s2idle in TSC deadline mode.
>
> Stop the TSC deadline timer in lapic_timer_shutdown() by writing 0 to
> MSR_IA32_TSC_DEADLINE.
>
> Fixes: 279f1461432c ("x86: apic: Use tsc deadline for oneshot when available")
> Link: https://lore.kernel.org/all/20240929063521.17284-1-rui.zhang@intel.com/
The problem I see here is that this seems stalled. No review there. Is that merged
in some branch and moving upstream and to stable?
Cc: Zhang Rui <rui.zhang@intel.com>
> References: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12344
The right reference link we should have in this topic/core-for-CI patch
is: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2766
showing the why we need the patch.
https://drm.pages.freedesktop.org/maintainer-tools/committer/core-for-CI.html
But was this really confirmed?
Anyway, I'm hesitant here mostly because I don't believe we should add this patch
if that is not getting propagated to Linus and/or stable trees.
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
>
> ---
> arch/x86/kernel/apic/apic.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
> index 6513c53c9459..d1006531729a 100644
> --- a/arch/x86/kernel/apic/apic.c
> +++ b/arch/x86/kernel/apic/apic.c
> @@ -441,6 +441,10 @@ static int lapic_timer_shutdown(struct clock_event_device *evt)
> v |= (APIC_LVT_MASKED | LOCAL_TIMER_VECTOR);
> apic_write(APIC_LVTT, v);
> apic_write(APIC_TMICT, 0);
> +
> + if (boot_cpu_has(X86_FEATURE_TSC_DEADLINE_TIMER))
> + wrmsrl(MSR_IA32_TSC_DEADLINE, 0);
> +
> return 0;
> }
>
> --
> 2.25.1
>
next prev parent reply other threads:[~2024-10-08 17:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 13:52 [PATCH] [core-for-CI PATCH] x86/apic: Stop the TSC Deadline timer during lapic timer shutdown Karthik Poosa
2024-10-07 18:20 ` ✓ CI.Patch_applied: success for " Patchwork
2024-10-07 18:20 ` ✗ CI.checkpatch: warning " Patchwork
2024-10-07 18:22 ` ✓ CI.KUnit: success " Patchwork
2024-10-07 18:33 ` ✓ CI.Build: " Patchwork
2024-10-07 18:35 ` ✓ CI.Hooks: " Patchwork
2024-10-07 18:37 ` ✓ CI.checksparse: " Patchwork
2024-10-07 19:19 ` ✓ CI.BAT: " Patchwork
2024-10-08 8:04 ` ✗ CI.FULL: failure " Patchwork
2024-10-08 9:18 ` [PATCH] [core-for-CI PATCH] " Nilawar, Badal
2024-10-08 17:34 ` Rodrigo Vivi [this message]
2024-10-08 17:37 ` Pandruvada, Srinivas
2024-10-09 18:23 ` Poosa, Karthik
2024-10-09 20:09 ` Pandruvada, Srinivas
2024-10-09 20:24 ` Rodrigo Vivi
2024-10-09 5:07 ` Borah, Chaitanya Kumar
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=ZwVtFJzWMUrTwg5C@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=badal.nilawar@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.saarinen@intel.com \
--cc=karthik.poosa@intel.com \
--cc=rui.zhang@intel.com \
--cc=srinivas.pandruvada@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.