1 From: Brandon Philips <bphilips@suse.de>
2 Subject: Avoid oops on G33 in 1MB stolen Mem case
4 Patch-Mainline: soon (see bug for ref)
6 This is similar to f443675affe3f16dd428e46f0f7fd3f4d703eeab which was
7 reverted because it broke with older XOrg driver. This patch only fixes
8 the 1MB stolen case since it causes an oops due to a calculation
11 This will not work with older X drivers without the accompanying patch
12 but I think avoiding an oops and making it possible to work with an
13 up-to-date xorg driver is reasonable.
15 Explanation of the oops:
17 > static void intel_i830_init_gtt_entries(void)
19 > } else if (IS_G33) {
20 > /* G33's GTT size defined in gmch_ctrl */
21 > switch (gmch_ctrl & G33_PGETBL_SIZE_MASK) {
22 > case G33_PGETBL_SIZE_1M:
30 Then since we have the BIOS setting 1MB for the device in the GMCH
31 control we get to here:
34 > switch (gmch_ctrl & I855_GMCH_GMS_MASK) {
35 > case I855_GMCH_GMS_STOLEN_1M:
36 > gtt_entries = MB(1) - KB(size);
39 MB(1) = 1 * 1024 * 1024
40 KB(1028) = 1028 * 1024
42 MB(1) - KB(1028) = -4096
44 > gtt_entries /= KB(4);
45 > intel_private.gtt_entries = gtt_entries;
47 We end up with -1 in gtt_entries.
49 This leads to intel_i915_configure reading/writing to areas outside of
50 mapped memory and the oops.
52 Signed-off-by: Brandon Philips <bphilips@suse.de>
53 Acked-by: Thomas Renninger <trenn@suse.de>
56 drivers/char/agp/intel-agp.c | 7 +++++++
57 1 file changed, 7 insertions(+)
59 --- a/drivers/char/agp/intel-agp.c
60 +++ b/drivers/char/agp/intel-agp.c
61 @@ -564,6 +564,13 @@ static void intel_i830_init_gtt_entries(
63 switch (gmch_ctrl & I855_GMCH_GMS_MASK) {
64 case I855_GMCH_GMS_STOLEN_1M:
67 + printk(KERN_WARNING PFX
68 + "Warning: G33 chipset with 1MB"
69 + " allocated. Older X.org Intel drivers"
70 + " will not work.\n");
72 gtt_entries = MB(1) - KB(size);
74 case I855_GMCH_GMS_STOLEN_4M: