[PATCH] vesafb: Fix mtrr bugs
[PATCH] vesafb: Fix mtrr bugs

>> vesafb: mode is 800x600x16, linelength=1600, pages=16
>> vesafb: scrolling: redraw
>> vesafb: Truecolor: size=0:5:6:5, shift=0:11:5:0
>> mtrr: type mismatch for fc000000,1000000 old: write-back new: write-
>> combining

Range is already set to write-back, vesafb attempts to add a write-combining
mtrr (default for vesafb).

>> mtrr: size and base must be multiples of 4 kiB

This is a bug, vesafb attempts to add a size < PAGE_SIZE triggering
the messages below.

To eliminate the warning messages, you can add the option mtrr:2 to add a
write-back mtrr for vesafb.  Or just use nomtrr option.

1. Fix algorithm for finding the best power of 2 size with mtrr_add().

2. Add option to choose the mtrr type by extending the mtrr boot option:

   mtrr:n where n

        0 = no mtrr (equivalent to using the nomtrr option)
        1 = uncachable
        2 = write back
        3 = write combining (default)
        4 = write through

Signed-off-by: Antonino Daplas <be03a811842969f6b435f66cb85a30eb479a8702@pol.net>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>

KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas