From: Dave Jones <davej@suse.de>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] K6-2 Write allocate bug.
Date: Mon, 19 Nov 2001 14:17:48 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.30.0111191349370.22614-100000@Appserv.suse.de> (raw)
Linus,
Patch below reformats some ugly compound ifs, and in the process
fixes up a bug where we end up poking the WHCR in old-style and new-style
on some K6-2's (Due to a missing (c->x86_mask>7) (See 2nd hunk of patch).
regards,
Dave.
diff -urN --exclude-from=/home/davej/.exclude linux-2.4.15-pre5/arch/i386/kernel/setup.c linux-2.4.15-pre5-dj/arch/i386/kernel/setup.c
--- linux-2.4.15-pre5/arch/i386/kernel/setup.c Mon Nov 19 12:08:00 2001
+++ linux-2.4.15-pre5-dj/arch/i386/kernel/setup.c Mon Nov 19 12:22:26 2001
@@ -1233,13 +1233,12 @@
}
/* K6 with old style WHCR */
- if( c->x86_model < 8 ||
- (c->x86_model== 8 && c->x86_mask < 8))
- {
+ if (c->x86_model < 8 ||
+ (c->x86_model== 8 && c->x86_mask < 8)) {
/* We can only write allocate on the low 508Mb */
if(mbytes>508)
mbytes=508;
-
+
rdmsr(MSR_K6_WHCR, l, h);
if ((l&0x0000FFFF)==0) {
unsigned long flags;
@@ -1250,14 +1249,14 @@
local_irq_restore(flags);
printk(KERN_INFO "Enabling old style K6 write allocation for %d Mb\n",
mbytes);
-
}
break;
}
- if (c->x86_model == 8 || c->x86_model == 9 || c->x86_model == 13)
- {
+
+ if ((c->x86_model == 8 && c->x86_mask >7) ||
+ c->x86_model == 9 || c->x86_model == 13) {
/* The more serious chips .. */
-
+
if(mbytes>4092)
mbytes=4092;
@@ -1274,10 +1273,8 @@
}
/* Set MTRR capability flag if appropriate */
- if ( (c->x86_model == 13) ||
- (c->x86_model == 9) ||
- ((c->x86_model == 8) &&
- (c->x86_mask >= 8)) )
+ if (c->x86_model == 13 || c->x86_model == 9 ||
+ (c->x86_model == 8 && c->x86_mask >= 8))
set_bit(X86_FEATURE_K6_MTRR, &c->x86_capability);
break;
}
--
| Dave Jones. http://www.codemonkey.org.uk
| SuSE Labs
reply other threads:[~2001-11-19 13:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=Pine.LNX.4.30.0111191349370.22614-100000@Appserv.suse.de \
--to=davej@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.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;
as well as URLs for NNTP newsgroup(s).