From: Hans de Goede <hdegoede@redhat.com>
To: Mike Travis <mike.travis@hpe.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Steve Wahl <steve.wahl@hpe.com>,
x86@kernel.org
Cc: Dimitri Sivanich <dimitri.sivanich@hpe.com>,
Andy Shevchenko <andy@infradead.org>,
Darren Hart <dvhart@infradead.org>,
"H. Peter Anvin" <hpa@zytor.com>,
Russ Anderson <russ.anderson@hpe.com>,
linux-kernel@vger.kernel.org,
platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH] x86/platform/uv: Dont use smp_processor_id while preemptable
Date: Sat, 21 May 2022 15:57:55 +0200 [thread overview]
Message-ID: <ed048405-9b22-d0eb-907a-dc00433db507@redhat.com> (raw)
In-Reply-To: <20220520203755.266337-1-mike.travis@hpe.com>
Hi Mike,
On 5/20/22 22:37, Mike Travis wrote:
> To avoid a "BUG: using smp_processor_id() in preemptible" debug
> warning message, disable preemption around use of the processor id.
>
> Signed-off-by: Mike Travis <mike.travis@hpe.com>
> Reviewed-by: Steve Wahl <steve.wahl@hpe.com>
> Reviewed-by: Dimitri Sivanich <dimitri.sivanich@hpe.com>
A git blame shows that this code has been around for quite
a while; so presumably this should be backported to some of
the stable kernel series ?
Maybe add an appropriate Cc: stable tag with the range of
kernels this should be added to and/or add a Fixes: tag?
Regards,
Hans
> ---
> arch/x86/platform/uv/uv_time.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/platform/uv/uv_time.c b/arch/x86/platform/uv/uv_time.c
> index 54663f3e00cb..094190814a28 100644
> --- a/arch/x86/platform/uv/uv_time.c
> +++ b/arch/x86/platform/uv/uv_time.c
> @@ -275,14 +275,17 @@ static int uv_rtc_unset_timer(int cpu, int force)
> */
> static u64 uv_read_rtc(struct clocksource *cs)
> {
> - unsigned long offset;
> + unsigned long offset, time;
> + unsigned int cpu = get_cpu();
>
> if (uv_get_min_hub_revision_id() == 1)
> offset = 0;
> else
> - offset = (uv_blade_processor_id() * L1_CACHE_BYTES) % PAGE_SIZE;
> + offset = (uv_cpu_blade_processor_id(cpu) * L1_CACHE_BYTES) % PAGE_SIZE;
>
> - return (u64)uv_read_local_mmr(UVH_RTC | offset);
> + time = (u64)uv_read_local_mmr(UVH_RTC | offset);
> + put_cpu();
> + return time;
> }
>
> /*
next prev parent reply other threads:[~2022-05-21 13:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-20 20:37 [PATCH] x86/platform/uv: Dont use smp_processor_id while preemptable Mike Travis
2022-05-21 13:57 ` Hans de Goede [this message]
2022-05-21 18:50 ` Travis, Mike
2022-05-26 15:30 ` Dave Hansen
2022-05-26 22:53 ` Travis, Mike
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=ed048405-9b22-d0eb-907a-dc00433db507@redhat.com \
--to=hdegoede@redhat.com \
--cc=andy@infradead.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=dimitri.sivanich@hpe.com \
--cc=dvhart@infradead.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.travis@hpe.com \
--cc=mingo@redhat.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=russ.anderson@hpe.com \
--cc=steve.wahl@hpe.com \
--cc=tglx@linutronix.de \
--cc=x86@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