Commit 0ff541da authored by Dave Jones's avatar Dave Jones

[AGPGART] Fix serverworks TLB flush.

Go back to what 2.4 kernels used to do here, as if this hits,
the kernel just hangs indefinitly.

Actually an improvement over 2.4 - we now break; out of the loop
instead of just printing messages on timeouts.
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 32a36585
......@@ -242,13 +242,27 @@ static int serverworks_fetch_size(void)
*/
static void serverworks_tlbflush(struct agp_memory *temp)
{
unsigned long timeout;
writeb(1, serverworks_private.registers+SVWRKS_POSTFLUSH);
while (readb(serverworks_private.registers+SVWRKS_POSTFLUSH) == 1)
timeout = jiffies + 3*HZ;
while (readb(serverworks_private.registers+SVWRKS_POSTFLUSH) == 1) {
cpu_relax();
if (time_after(jiffies, timeout)) {
printk(KERN_ERR PFX "TLB post flush took more than 3 seconds\n");
break;
}
}
writel(1, serverworks_private.registers+SVWRKS_DIRFLUSH);
while(readl(serverworks_private.registers+SVWRKS_DIRFLUSH) == 1)
timeout = jiffies + 3*HZ;
while (readl(serverworks_private.registers+SVWRKS_DIRFLUSH) == 1) {
cpu_relax();
if (time_after(jiffies, timeout)) {
printk(KERN_ERR PFX "TLB Dir flush took more than 3 seconds\n");
break;
}
}
}
static int serverworks_configure(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment