intel-agp: Switch to wbinvd_on_all_cpus
Simplify if-statement while at it. [ hpa: we need to #include <asm/smp.h> ] Cc: Dave Jones <davej@redhat.com> Cc: David Airlie <airlied@linux.ie> Signed-off-by: Borislav Petkov <borislav.petkov@amd.com> LKML-Reference: <1264172467-25155-3-git-send-email-bp@amd64.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
a7b480e7f3
commit
48a719c238
1 changed files with 4 additions and 11 deletions
|
@ -8,6 +8,7 @@
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/pagemap.h>
|
#include <linux/pagemap.h>
|
||||||
#include <linux/agp_backend.h>
|
#include <linux/agp_backend.h>
|
||||||
|
#include <asm/smp.h>
|
||||||
#include "agp.h"
|
#include "agp.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -815,12 +816,6 @@ static void intel_i830_setup_flush(void)
|
||||||
intel_i830_fini_flush();
|
intel_i830_fini_flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
do_wbinvd(void *null)
|
|
||||||
{
|
|
||||||
wbinvd();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The chipset_flush interface needs to get data that has already been
|
/* The chipset_flush interface needs to get data that has already been
|
||||||
* flushed out of the CPU all the way out to main memory, because the GPU
|
* flushed out of the CPU all the way out to main memory, because the GPU
|
||||||
* doesn't snoop those buffers.
|
* doesn't snoop those buffers.
|
||||||
|
@ -837,12 +832,10 @@ static void intel_i830_chipset_flush(struct agp_bridge_data *bridge)
|
||||||
|
|
||||||
memset(pg, 0, 1024);
|
memset(pg, 0, 1024);
|
||||||
|
|
||||||
if (cpu_has_clflush) {
|
if (cpu_has_clflush)
|
||||||
clflush_cache_range(pg, 1024);
|
clflush_cache_range(pg, 1024);
|
||||||
} else {
|
else if (wbinvd_on_all_cpus() != 0)
|
||||||
if (on_each_cpu(do_wbinvd, NULL, 1) != 0)
|
|
||||||
printk(KERN_ERR "Timed out waiting for cache flush.\n");
|
printk(KERN_ERR "Timed out waiting for cache flush.\n");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The intel i830 automatically initializes the agp aperture during POST.
|
/* The intel i830 automatically initializes the agp aperture during POST.
|
||||||
|
|
Loading…
Add table
Reference in a new issue