diff options
author | Dave Jones <davej@redhat.com> | 2005-06-26 01:58:30 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-26 03:24:55 +0400 |
commit | d7496cb75ec75b1e74283a481fb02f5d7ce7bdeb (patch) | |
tree | d716e849a363edd4a6a632e0acaaa31c164f83ea | |
parent | 72414d3f1d22fc3e311b162fca95c430048d38ce (diff) | |
download | linux-d7496cb75ec75b1e74283a481fb02f5d7ce7bdeb.tar.xz |
[PATCH] Fix vesafb/mtrr scaling problem.
vesafb will do really silly things like..
mtrr: type mismatch for e0000000,8000000 old: write-back new: write-combining
mtrr: type mismatch for e0000000,4000000 old: write-back new: write-combining
mtrr: type mismatch for e0000000,2000000 old: write-back new: write-combining
mtrr: type mismatch for e0000000,1000000 old: write-back new: write-combining
mtrr: type mismatch for e0000000,800000 old: write-back new: write-combining
mtrr: type mismatch for e0000000,400000 old: write-back new: write-combining
mtrr: type mismatch for e0000000,200000 old: write-back new: write-combining
mtrr: type mismatch for e0000000,100000 old: write-back new: write-combining
mtrr: type mismatch for e0000000,80000 old: write-back new: write-combining
mtrr: type mismatch for e0000000,40000 old: write-back new: write-combining
mtrr: type mismatch for e0000000,20000 old: write-back new: write-combining
mtrr: type mismatch for e0000000,10000 old: write-back new: write-combining
mtrr: type mismatch for e0000000,8000 old: write-back new: write-combining
mtrr: type mismatch for e0000000,4000 old: write-back new: write-combining
mtrr: type mismatch for e0000000,2000 old: write-back new: write-combining
mtrr: type mismatch for e0000000,1000 old: write-back new: write-combining
mtrr: size and base must be multiples of 4 kiB
mtrr: size: 0x800 base: 0xe0000000
mtrr: size and base must be multiples of 4 kiB
mtrr: size: 0x400 base: 0xe0000000
mtrr: size and base must be multiples of 4 kiB
mtrr: size: 0x200 base: 0xe0000000
mtrr: size and base must be multiples of 4 kiB
mtrr: size: 0x100 base: 0xe0000000
mtrr: size and base must be multiples of 4 kiB
mtrr: size: 0x80 base: 0xe0000000
mtrr: size and base must be multiples of 4 kiB
mtrr: size: 0x40 base: 0xe0000000
mtrr: size and base must be multiples of 4 kiB
mtrr: size: 0x20 base: 0xe0000000
mtrr: size and base must be multiples of 4 kiB
mtrr: size: 0x10 base: 0xe0000000
mtrr: size and base must be multiples of 4 kiB
mtrr: size: 0x8 base: 0xe0000000
mtrr: size and base must be multiples of 4 kiB
mtrr: size: 0x4 base: 0xe0000000
mtrr: size and base must be multiples of 4 kiB
mtrr: size: 0x2 base: 0xe0000000
mtrr: size and base must be multiples of 4 kiB
mtrr: size: 0x1 base: 0xe0000000
Stop scaling down at PAGE_SIZE.
Also fix up some broken indentation.
Signed-off-by: Dave Jones <davej@redhat.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/video/vesafb.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c index f3069b01e248..9ed1a931dd31 100644 --- a/drivers/video/vesafb.c +++ b/drivers/video/vesafb.c @@ -389,10 +389,11 @@ static int __init vesafb_probe(struct device *device) unsigned int temp_size = size_total; /* Find the largest power-of-two */ while (temp_size & (temp_size - 1)) - temp_size &= (temp_size - 1); - - /* Try and find a power of two to add */ - while (temp_size && mtrr_add(vesafb_fix.smem_start, temp_size, MTRR_TYPE_WRCOMB, 1)==-EINVAL) { + temp_size &= (temp_size - 1); + + /* Try and find a power of two to add */ + while (temp_size > PAGE_SIZE && + mtrr_add(vesafb_fix.smem_start, temp_size, MTRR_TYPE_WRCOMB, 1)==-EINVAL) { temp_size >>= 1; } } |