Commit 9c0bbb46 authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[AGPGART] Fix broken serverworks tlb flush routine.

This is horribly broken due to a jiffy wrap bug, we never get out of
the while loop, preventing booting on a kernel with this driver
compiled in. (See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=124495)

The warning message there has never been reported in any bug report
that google can find, so I'm of the opinion that this driver is trying
to be too clever for its own good.  Rip out the jiffies logic completely,
it should be totally unnecessary.
parent b9c78a05
...@@ -248,26 +248,13 @@ static int serverworks_fetch_size(void) ...@@ -248,26 +248,13 @@ static int serverworks_fetch_size(void)
*/ */
static void serverworks_tlbflush(struct agp_memory *temp) static void serverworks_tlbflush(struct agp_memory *temp)
{ {
unsigned long end; OUTREG8(serverworks_private.registers, SVWRKS_POSTFLUSH, 1);
while(INREG8(serverworks_private.registers, SVWRKS_POSTFLUSH) == 1)
OUTREG8(serverworks_private.registers, SVWRKS_POSTFLUSH, 0x01); cpu_relax();
end = jiffies + 3*HZ;
while(INREG8(serverworks_private.registers, OUTREG32(serverworks_private.registers, SVWRKS_DIRFLUSH, 1);
SVWRKS_POSTFLUSH) == 0x01) { while(INREG32(serverworks_private.registers, SVWRKS_DIRFLUSH) == 1)
if((signed)(end - jiffies) <= 0) { cpu_relax();
printk(KERN_ERR PFX "Posted write buffer flush took more"
"then 3 seconds\n");
}
}
OUTREG32(serverworks_private.registers, SVWRKS_DIRFLUSH, 0x00000001);
end = jiffies + 3*HZ;
while(INREG32(serverworks_private.registers,
SVWRKS_DIRFLUSH) == 0x00000001) {
if((signed)(end - jiffies) <= 0) {
printk(KERN_ERR PFX "TLB flush took more"
"then 3 seconds\n");
}
}
} }
static int serverworks_configure(void) 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