public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Dave Young <hidave.darkstar@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	Dave Jones <davej@codemonkey.org.uk>,
	cpufreq@www.linux.org.uk
Subject: Re: [PATCH]gx-suspmod.c use boot_cpu_data instead of current_cpu_data
Date: Tue, 24 Jul 2007 23:40:45 -0700	[thread overview]
Message-ID: <20070724234045.2cec5525.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070725141905.GA4567@darkstar.te-china.tietoenator.com>

On Wed, 25 Jul 2007 14:19:05 +0000 Dave Young <hidave.darkstar@gmail.com> wrote:

> Hi,
> in preemptible kernel will report BUG: using smp_processor_id() in preemptible, so use boot_cpu_data instead of current_cpu_data.
> 
> Signed-off-by: Dave Young <hidave.darkstar@gmail.com> 
> 
> ---
> arch/i386/kernel/cpu/cpufreq/gx-suspmod.c |    4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff -pur linux/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c linux.new/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
> --- linux/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c	2007-07-25 14:11:06.000000000 +0000
> +++ linux.new/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c	2007-07-25 13:57:29.000000000 +0000
> @@ -181,8 +181,8 @@ static __init struct pci_dev *gx_detect_
>  	struct pci_dev *gx_pci = NULL;
>  
>  	/* check if CPU is a MediaGX or a Geode. */
> -	if ((current_cpu_data.x86_vendor != X86_VENDOR_NSC) &&
> -	    (current_cpu_data.x86_vendor != X86_VENDOR_CYRIX)) {
> +	if ((boot_cpu_data.x86_vendor != X86_VENDOR_NSC) &&
> +	    (boot_cpu_data.x86_vendor != X86_VENDOR_CYRIX)) {
>  		dprintk("error: no MediaGX/Geode processor found!\n");
>  		return NULL;
>  	}

um, I suspect it really wants to get at the current CPU.  But putting a
preempt_disable() around just that code is meaningless: the current CPU
could change immediately before or after the code block. It needs deeper
fixing, methinks.


  reply	other threads:[~2007-07-25  6:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-25 14:19 [PATCH]gx-suspmod.c use boot_cpu_data instead of current_cpu_data Dave Young
2007-07-25  6:40 ` Andrew Morton [this message]
2007-07-26  4:20   ` Dave Young
2007-07-26  4:26     ` Andrew Morton
2007-07-26 16:46       ` Dave Jones
2007-07-26 17:11         ` Alan Cox
2007-07-26  7:55   ` Hiroshi Miura

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=20070724234045.2cec5525.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cpufreq@www.linux.org.uk \
    --cc=davej@codemonkey.org.uk \
    --cc=hidave.darkstar@gmail.com \
    --cc=linux-kernel@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