From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] MIPS: cpu-features: Use boot_cpu_type for CPU type based features
Date: Fri, 9 Jun 2023 10:24:23 +0200 [thread overview]
Message-ID: <20230609082423.GM8160@alpha.franken.de> (raw)
In-Reply-To: <20230607055122.26175-1-jiaxun.yang@flygoat.com>
On Wed, Jun 07, 2023 at 01:51:22PM +0800, Jiaxun Yang wrote:
> Some CPU feature macros were using current_cpu_type to mark feature
> availability.
>
> However current_cpu_type will use smp_processor_id, which is prohibited
> under preemptable context.
>
> Since those features are all uniform on all CPUs in a SMP system, use
> boot_cpu_type instead of current_cpu_type to fix preemptable kernel.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
> arch/mips/include/asm/cpu-features.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h
> index 2a0b90077b50..8c6d4a87db37 100644
> --- a/arch/mips/include/asm/cpu-features.h
> +++ b/arch/mips/include/asm/cpu-features.h
> @@ -125,7 +125,7 @@
> ({ \
> int __res; \
> \
> - switch (current_cpu_type()) { \
> + switch (boot_cpu_type()) { \
> case CPU_CAVIUM_OCTEON: \
> case CPU_CAVIUM_OCTEON_PLUS: \
> case CPU_CAVIUM_OCTEON2: \
> @@ -373,7 +373,7 @@
> ({ \
> int __res; \
> \
> - switch (current_cpu_type()) { \
> + switch (boot_cpu_type()) { \
> case CPU_M14KC: \
> case CPU_74K: \
> case CPU_1074K: \
> --
> 2.39.2 (Apple Git-143)
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
prev parent reply other threads:[~2023-06-09 9:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-07 5:51 Jiaxun Yang
2023-06-09 8:24 ` Thomas Bogendoerfer [this message]
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=20230609082423.GM8160@alpha.franken.de \
--to=tsbogend@alpha.franken.de \
--cc=jiaxun.yang@flygoat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=stable@vger.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
all inboxes | Powered by JetHome®