public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Joshua Hoblitt <josh@hoblitt.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	bugme-daemon@bugzilla.kernel.org, linux-kernel@vger.kernel.org,
	j_kernel@hoblitt.com, Arjan van de Ven <arjan@infradead.org>
Subject: Re: [Bug 11388] New: 2.6.27-rc3 warns about MTRR range; only 3 of 16gb of memory is usable
Date: Fri, 22 Aug 2008 08:24:59 +0200	[thread overview]
Message-ID: <20080822062459.GO14110@elte.hu> (raw)
In-Reply-To: <86802c440808212316t1c89321fl717fa80d2013f155@mail.gmail.com>


* Yinghai Lu <yhlu.kernel@gmail.com> wrote:

> > +               if (tmp != mask_lo) {
> > +                       WARN_ON("mtrr: your BIOS has set up an incorrect mask, fixing it up.\n");
> 
> can you change WARN_ON to WARN_ON_ONCE ?

the commit below does that. Note that the condition is 
WARN_ON(condition) or WARN(string) - WARN_ON(string) will just print a 
kernel stack unconditionally. Unfortunately there's no WARN_ONCE(). 
(Arjan?)

	Ingo

---------->
>From 1c8aa33e17dc4aa68b329d262fff253648a98adb Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@elte.hu>
Date: Fri, 22 Aug 2008 08:22:23 +0200
Subject: [PATCH] x86: work around MTRR mask setting, v2

improve the debug printout:

- make it actually display something
- print it only once

would be nice to have a WARN_ONCE() facility, to feed such things to
kerneloops.org.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/kernel/cpu/mtrr/generic.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
index 43102e0..cb7d3b6 100644
--- a/arch/x86/kernel/cpu/mtrr/generic.c
+++ b/arch/x86/kernel/cpu/mtrr/generic.c
@@ -401,7 +401,12 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base,
 		tmp |= ~((1<<(hi - 1)) - 1);
 
 		if (tmp != mask_lo) {
-			WARN_ON("mtrr: your BIOS has set up an incorrect mask, fixing it up.\n");
+			static int once = 1;
+
+			if (once) {
+				printk(KERN_INFO "mtrr: your BIOS has set up an incorrect mask, fixing it up.\n");
+				once = 0;
+			}
 			mask_lo = tmp;
 		}
 	}

  reply	other threads:[~2008-08-22  6:25 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-11388-27@http.bugzilla.kernel.org/>
2008-08-21  1:04 ` [Bug 11388] New: 2.6.27-rc3 warns about MTRR range; only 3 of 16gb of memory is usable Andrew Morton
2008-08-21  1:20   ` Yinghai Lu
2008-08-21  1:49     ` Yinghai Lu
2008-08-21 11:44       ` Ingo Molnar
2008-08-21 11:56         ` Ingo Molnar
2008-08-21 15:39           ` Yinghai Lu
2008-08-22  3:51             ` Ingo Molnar
2008-08-22  4:45               ` Yinghai Lu
2008-08-21 20:55       ` Joshua Hoblitt
2008-08-21 21:51         ` Yinghai Lu
2008-08-21 23:33           ` Joshua Hoblitt
2008-08-22  0:10             ` Joshua Hoblitt
2008-08-22  0:28               ` Yinghai Lu
2008-08-22  0:29                 ` Joshua Hoblitt
2008-08-22  1:00                   ` Joshua Hoblitt
2008-08-22  1:10                     ` Joshua Hoblitt
2008-08-22  1:55                       ` Yinghai Lu
2008-08-22  2:15                         ` Joshua Hoblitt
2008-08-22  2:26                           ` Yinghai Lu
2008-08-22  3:24                             ` Yinghai Lu
2008-08-22  3:50                               ` Ingo Molnar
2008-08-22  3:56                                 ` Ingo Molnar
2008-08-22  4:48                                   ` Yinghai Lu
2008-08-23  0:22                                     ` Joshua Hoblitt
2008-08-23  5:52                                       ` Yinghai Lu
2008-08-23 10:43                                         ` Ingo Molnar
2008-08-26  8:35                                           ` Joshua Hoblitt
2008-08-26  8:42                                             ` Ingo Molnar
2008-08-25 21:43                                   ` Joshua Hoblitt
2008-08-22  6:16                                 ` Yinghai Lu
2008-08-22  6:24                                   ` Ingo Molnar [this message]
2008-08-23 23:53                                     ` Arjan van de Ven
2008-08-25  9:17                                       ` Ingo Molnar
2008-08-22  3:26                             ` Joshua Hoblitt

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=20080822062459.GO14110@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=bugme-daemon@bugzilla.kernel.org \
    --cc=j_kernel@hoblitt.com \
    --cc=josh@hoblitt.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yhlu.kernel@gmail.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