aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2010-06-01 15:33:08 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-06-02 03:50:37 -0400
commit79905ad50bcf025deb81382413719ed600734941 (patch)
tree20e5b02a6accf2bc73bf19f3ec2fc4a42f70eb26 /drivers
parent92e197095e0aa59273decbeaa4b63de58e342355 (diff)
agp/uninorth: Fix oops caused by flushing too much
This fixes a sporadic oops at boot on G5 Power Macs. The table_end variable has the address of the last byte of the table. Adding on PAGE_SIZE means we flush too much, and if the page after the table is not mapped for any reason, the kernel will oops. Instead we add on 1 because flush_dcache_range() interprets its second argument as the first byte past the range to be flushed. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/agp/uninorth-agp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c
index 95db71360d24..f845a8f718b3 100644
--- a/drivers/char/agp/uninorth-agp.c
+++ b/drivers/char/agp/uninorth-agp.c
@@ -415,7 +415,7 @@ static int uninorth_create_gatt_table(struct agp_bridge_data *bridge)
415 bridge->gatt_table_real = (u32 *) table; 415 bridge->gatt_table_real = (u32 *) table;
416 /* Need to clear out any dirty data still sitting in caches */ 416 /* Need to clear out any dirty data still sitting in caches */
417 flush_dcache_range((unsigned long)table, 417 flush_dcache_range((unsigned long)table,
418 (unsigned long)(table_end + PAGE_SIZE)); 418 (unsigned long)table_end + 1);
419 bridge->gatt_table = vmap(pages, (1 << page_order), 0, PAGE_KERNEL_NCG); 419 bridge->gatt_table = vmap(pages, (1 << page_order), 0, PAGE_KERNEL_NCG);
420 420
421 if (bridge->gatt_table == NULL) 421 if (bridge->gatt_table == NULL)